index.ts 1.7 KB

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