2022-11-03 16:55:01 +08:00
|
|
|
import request from '@/config/axios'
|
2022-11-22 15:10:00 +08:00
|
|
|
|
2022-11-22 17:12:45 +08:00
|
|
|
export interface ConfigVO {
|
2022-11-22 15:10:00 +08:00
|
|
|
id: number
|
2022-11-29 23:23:33 +08:00
|
|
|
category: string
|
2022-11-22 15:10:00 +08:00
|
|
|
name: string
|
|
|
|
key: string
|
|
|
|
value: string
|
2022-11-29 23:23:33 +08:00
|
|
|
type: number
|
2022-11-22 15:10:00 +08:00
|
|
|
visible: boolean
|
|
|
|
remark: string
|
2022-11-29 23:23:33 +08:00
|
|
|
createTime: Date
|
2022-11-22 15:10:00 +08:00
|
|
|
}
|
2022-11-22 15:46:32 +08:00
|
|
|
|
2022-11-22 15:10:00 +08:00
|
|
|
export interface ConfigPageReqVO extends PageParam {
|
|
|
|
name?: string
|
2022-11-29 23:23:33 +08:00
|
|
|
key?: string
|
2022-11-22 15:10:00 +08:00
|
|
|
type?: number
|
2022-11-29 23:23:33 +08:00
|
|
|
createTime?: Date[]
|
2022-11-22 15:10:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ConfigExportReqVO {
|
|
|
|
name?: string
|
2022-11-29 23:23:33 +08:00
|
|
|
key?: string
|
2022-11-22 15:10:00 +08:00
|
|
|
type?: number
|
2022-11-29 23:23:33 +08:00
|
|
|
createTime?: Date[]
|
2022-11-22 15:10:00 +08:00
|
|
|
}
|
2022-07-18 19:06:37 +08:00
|
|
|
|
|
|
|
// 查询参数列表
|
2022-11-22 15:10:00 +08:00
|
|
|
export const getConfigPageApi = (params: ConfigPageReqVO) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/config/page', params })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 查询参数详情
|
|
|
|
export const getConfigApi = (id: number) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/config/get?id=' + id })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 根据参数键名查询参数值
|
|
|
|
export const getConfigKeyApi = (configKey: string) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 新增参数
|
2022-07-19 22:33:54 +08:00
|
|
|
export const createConfigApi = (data: ConfigVO) => {
|
|
|
|
return request.post({ url: '/infra/config/create', data })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 修改参数
|
2022-07-19 22:33:54 +08:00
|
|
|
export const updateConfigApi = (data: ConfigVO) => {
|
|
|
|
return request.put({ url: '/infra/config/update', data })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 删除参数
|
|
|
|
export const deleteConfigApi = (id: number) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.delete({ url: '/infra/config/delete?id=' + id })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 导出参数
|
2022-11-22 15:10:00 +08:00
|
|
|
export const exportConfigApi = (params: ConfigExportReqVO) => {
|
2022-07-25 21:03:14 +08:00
|
|
|
return request.download({ url: '/infra/config/export', params })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|