2022-11-03 16:55:01 +08:00
|
|
|
import request from '@/config/axios'
|
2022-11-22 17:12:45 +08:00
|
|
|
|
2022-11-29 23:23:33 +08:00
|
|
|
export interface FileClientConfig {
|
2022-11-22 17:12:45 +08:00
|
|
|
basePath: string
|
2022-11-29 23:23:33 +08:00
|
|
|
host?: string
|
|
|
|
port?: number
|
|
|
|
username?: string
|
|
|
|
password?: string
|
|
|
|
mode?: string
|
|
|
|
endpoint?: string
|
|
|
|
bucket?: string
|
|
|
|
accessKey?: string
|
|
|
|
accessSecret?: string
|
2022-11-22 17:12:45 +08:00
|
|
|
domain: string
|
|
|
|
}
|
|
|
|
export interface FileConfigVO {
|
|
|
|
id: number
|
|
|
|
name: string
|
2022-11-28 23:13:20 +08:00
|
|
|
storage: number
|
2022-11-22 17:12:45 +08:00
|
|
|
master: boolean
|
|
|
|
visible: boolean
|
2022-11-29 23:23:33 +08:00
|
|
|
config: FileClientConfig
|
2022-11-22 17:12:45 +08:00
|
|
|
remark: string
|
2022-11-29 23:23:33 +08:00
|
|
|
createTime: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FileConfigPageReqVO extends PageParam {
|
|
|
|
name?: string
|
|
|
|
storage?: number
|
|
|
|
createTime?: Date[]
|
2022-11-22 17:12:45 +08:00
|
|
|
}
|
2022-07-18 19:06:37 +08:00
|
|
|
|
|
|
|
// 查询文件配置列表
|
2022-11-29 23:23:33 +08:00
|
|
|
export const getFileConfigPageApi = (params: FileConfigPageReqVO) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/file-config/page', params })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 查询文件配置详情
|
|
|
|
export const getFileConfigApi = (id: number) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/file-config/get?id=' + id })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 更新文件配置为主配置
|
|
|
|
export const updateFileConfigMasterApi = (id: number) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/file-config/update-master?id=' + id })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 新增文件配置
|
2022-07-19 22:33:54 +08:00
|
|
|
export const createFileConfigApi = (data: FileConfigVO) => {
|
|
|
|
return request.post({ url: '/infra/file-config/create', data })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 修改文件配置
|
2022-07-19 22:33:54 +08:00
|
|
|
export const updateFileConfigApi = (data: FileConfigVO) => {
|
|
|
|
return request.put({ url: '/infra/file-config/update', data })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 删除文件配置
|
|
|
|
export const deleteFileConfigApi = (id: number) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.delete({ url: '/infra/file-config/delete?id=' + id })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 测试文件配置
|
|
|
|
export const testFileConfigApi = (id: number) => {
|
2022-07-19 22:33:54 +08:00
|
|
|
return request.get({ url: '/infra/file-config/test?id=' + id })
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|