diff --git a/apps/web-antd/src/api/infra/file-config/index.ts b/apps/web-antd/src/api/infra/file-config/index.ts new file mode 100644 index 00000000..5ebb1103 --- /dev/null +++ b/apps/web-antd/src/api/infra/file-config/index.ts @@ -0,0 +1,63 @@ +import { type PageParam, requestClient } from '#/api/request'; + +export namespace FileConfigApi { + export interface FileClientConfig { + basePath: string; + host?: string; + port?: number; + username?: string; + password?: string; + mode?: string; + endpoint?: string; + bucket?: string; + accessKey?: string; + accessSecret?: string; + domain: string; + } + + export interface FileConfigVO { + id: number; + name: string; + storage?: number; + master: boolean; + visible: boolean; + config: FileClientConfig; + remark: string; + createTime: Date; + } +} + +// 查询文件配置列表 +export function getFileConfigPage(params: PageParam) { + return requestClient.get('/infra/file-config/page', { params }); +} + +// 查询文件配置详情 +export function getFileConfig(id: number) { + return requestClient.get(`/infra/file-config/get?id=${id}`); +} + +// 更新文件配置为主配置 +export function updateFileConfigMaster(id: number) { + return requestClient.put(`/infra/file-config/update-master?id=${id}`); +} + +// 新增文件配置 +export function createFileConfig(data: FileConfigApi.FileConfigVO) { + return requestClient.post('/infra/file-config/create', data); +} + +// 修改文件配置 +export function updateFileConfig(data: FileConfigApi.FileConfigVO) { + return requestClient.put('/infra/file-config/update', data); +} + +// 删除文件配置 +export function deleteFileConfig(id: number) { + return requestClient.delete(`/infra/file-config/delete?id=${id}`); +} + +// 测试文件配置 +export function testFileConfig(id: number) { + return requestClient.get(`/infra/file-config/test?id=${id}`); +} diff --git a/apps/web-antd/src/components/action-buttons/action-buttons.vue b/apps/web-antd/src/components/action-buttons/action-buttons.vue index 64b83318..c338cab2 100644 --- a/apps/web-antd/src/components/action-buttons/action-buttons.vue +++ b/apps/web-antd/src/components/action-buttons/action-buttons.vue @@ -130,6 +130,7 @@ const handleMenuClick = (e: any) => {