index.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import request from '@/config/axios'
  2. export interface FileClientConfig {
  3. basePath: string
  4. host?: string
  5. port?: number
  6. username?: string
  7. password?: string
  8. mode?: string
  9. endpoint?: string
  10. bucket?: string
  11. accessKey?: string
  12. accessSecret?: string
  13. domain: string
  14. }
  15. export interface FileConfigVO {
  16. id: number
  17. name: string
  18. storage: number
  19. master: boolean
  20. visible: boolean
  21. config: FileClientConfig
  22. remark: string
  23. createTime: Date
  24. }
  25. export interface FileConfigPageReqVO extends PageParam {
  26. name?: string
  27. storage?: number
  28. createTime?: Date[]
  29. }
  30. // 查询文件配置列表
  31. export const getFileConfigPageApi = (params: FileConfigPageReqVO) => {
  32. return request.get({ url: '/infra/file-config/page', params })
  33. }
  34. // 查询文件配置详情
  35. export const getFileConfigApi = (id: number) => {
  36. return request.get({ url: '/infra/file-config/get?id=' + id })
  37. }
  38. // 更新文件配置为主配置
  39. export const updateFileConfigMasterApi = (id: number) => {
  40. return request.get({ url: '/infra/file-config/update-master?id=' + id })
  41. }
  42. // 新增文件配置
  43. export const createFileConfigApi = (data: FileConfigVO) => {
  44. return request.post({ url: '/infra/file-config/create', data })
  45. }
  46. // 修改文件配置
  47. export const updateFileConfigApi = (data: FileConfigVO) => {
  48. return request.put({ url: '/infra/file-config/update', data })
  49. }
  50. // 删除文件配置
  51. export const deleteFileConfigApi = (id: number) => {
  52. return request.delete({ url: '/infra/file-config/delete?id=' + id })
  53. }
  54. // 测试文件配置
  55. export const testFileConfigApi = (id: number) => {
  56. return request.get({ url: '/infra/file-config/test?id=' + id })
  57. }