index.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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: any
  19. master: boolean
  20. visible: boolean
  21. config: FileClientConfig
  22. remark: string
  23. createTime: Date
  24. }
  25. // 查询文件配置列表
  26. export const getFileConfigPage = (params: PageParam) => {
  27. return request.get({ url: '/infra/file-config/page', params })
  28. }
  29. // 查询文件配置详情
  30. export const getFileConfig = (id: number) => {
  31. return request.get({ url: '/infra/file-config/get?id=' + id })
  32. }
  33. // 更新文件配置为主配置
  34. export const updateFileConfigMaster = (id: number) => {
  35. return request.put({ url: '/infra/file-config/update-master?id=' + id })
  36. }
  37. // 新增文件配置
  38. export const createFileConfig = (data: FileConfigVO) => {
  39. return request.post({ url: '/infra/file-config/create', data })
  40. }
  41. // 修改文件配置
  42. export const updateFileConfig = (data: FileConfigVO) => {
  43. return request.put({ url: '/infra/file-config/update', data })
  44. }
  45. // 删除文件配置
  46. export const deleteFileConfig = (id: number) => {
  47. return request.delete({ url: '/infra/file-config/delete?id=' + id })
  48. }
  49. // 测试文件配置
  50. export const testFileConfig = (id: number) => {
  51. return request.get({ url: '/infra/file-config/test?id=' + id })
  52. }