index.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import request from '@/config/axios'
  2. export interface ConfigVO {
  3. id: number
  4. category: string
  5. name: string
  6. key: string
  7. value: string
  8. type: number
  9. visible: boolean
  10. remark: string
  11. createTime: Date
  12. }
  13. export interface ConfigPageReqVO extends PageParam {
  14. name?: string
  15. key?: string
  16. type?: number
  17. createTime?: Date[]
  18. }
  19. export interface ConfigExportReqVO {
  20. name?: string
  21. key?: string
  22. type?: number
  23. createTime?: Date[]
  24. }
  25. // 查询参数列表
  26. export const getConfigPage = (params: ConfigPageReqVO) => {
  27. return request.get({ url: '/infra/config/page', params })
  28. }
  29. // 查询参数详情
  30. export const getConfig = (id: number) => {
  31. return request.get({ url: '/infra/config/get?id=' + id })
  32. }
  33. // 根据参数键名查询参数值
  34. export const getConfigKeyApi = (configKey: string) => {
  35. return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
  36. }
  37. // 新增参数
  38. export const createConfigApi = (data: ConfigVO) => {
  39. return request.post({ url: '/infra/config/create', data })
  40. }
  41. // 修改参数
  42. export const updateConfigApi = (data: ConfigVO) => {
  43. return request.put({ url: '/infra/config/update', data })
  44. }
  45. // 删除参数
  46. export const deleteConfigApi = (id: number) => {
  47. return request.delete({ url: '/infra/config/delete?id=' + id })
  48. }
  49. // 导出参数
  50. export const exportConfigApi = (params: ConfigExportReqVO) => {
  51. return request.download({ url: '/infra/config/export', params })
  52. }