Files
yudao-ui-admin-vben/src/api/system/errorCode/index.ts

50 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-03-18 21:42:23 +08:00
import { defHttp } from '@/utils/http/axios'
export interface ErrorCodeVO {
id: number
type: number
applicationName: string
code: number
message: string
memo: string
createTime: Date
}
export interface ErrorCodePageReqVO extends PageParam {
type?: number
applicationName?: string
code?: number
message?: string
createTime?: Date[]
}
// 查询错误码列表
2023-03-22 23:17:05 +08:00
export function getErrorCodePage(params: ErrorCodePageReqVO) {
2023-03-18 21:42:23 +08:00
return defHttp.get({ url: '/system/error-code/page', params })
}
// 查询错误码详情
2023-03-22 23:17:05 +08:00
export function getErrorCode(id: number) {
2023-07-29 18:46:43 +08:00
return defHttp.get({ url: `/system/error-code/get?id=${id}` })
2023-03-18 21:42:23 +08:00
}
// 新增错误码
2023-03-22 23:17:05 +08:00
export function createErrorCode(data: ErrorCodeVO) {
2023-03-18 21:42:23 +08:00
return defHttp.post({ url: '/system/error-code/create', data })
}
// 修改错误码
2023-03-22 23:17:05 +08:00
export function updateErrorCode(data: ErrorCodeVO) {
2023-03-18 21:42:23 +08:00
return defHttp.put({ url: '/system/error-code/update', data })
}
// 删除错误码
2023-03-22 23:17:05 +08:00
export function deleteErrorCode(id: number) {
2023-07-29 18:46:43 +08:00
return defHttp.delete({ url: `/system/error-code/delete?id=${id}` })
2023-03-18 21:42:23 +08:00
}
2023-03-20 17:17:39 +08:00
2023-03-18 21:42:23 +08:00
// 导出错误码
2023-03-22 23:17:05 +08:00
export function excelErrorCode(params: ErrorCodePageReqVO) {
2023-03-20 17:50:37 +08:00
return defHttp.download({ url: '/system/error-code/export-excel', params }, '错误码.xls')
2023-03-18 21:42:23 +08:00
}