gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import type { PageParam, PageResult } from '..\..\..\packages\effects\request\src';
 
import { requestClient } from '#/api/request';
 
export namespace InfraFileConfigApi {
  /** 文件客户端配置 */
  export interface FileClientConfig {
    basePath: string;
    host?: string;
    port?: number;
    username?: string;
    password?: string;
    mode?: string;
    endpoint?: string;
    bucket?: string;
    accessKey?: string;
    accessSecret?: string;
    pathStyle?: boolean;
    enablePublicAccess?: boolean;
    region?: string;
    domain: string;
  }
 
  /** 文件配置信息 */
  export interface FileConfig {
    id?: number;
    name: string;
    storage?: number;
    master: boolean;
    visible: boolean;
    config: FileClientConfig;
    remark: string;
    createTime?: Date;
  }
}
 
/** 查询文件配置列表 */
export function getFileConfigPage(params: PageParam) {
  return requestClient.get<PageResult<InfraFileConfigApi.FileConfig>>(
    '/infra/file-config/page',
    {
      params,
    },
  );
}
 
/** 查询文件配置详情 */
export function getFileConfig(id: number) {
  return requestClient.get<InfraFileConfigApi.FileConfig>(
    `/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: InfraFileConfigApi.FileConfig) {
  return requestClient.post('/infra/file-config/create', data);
}
 
/** 修改文件配置 */
export function updateFileConfig(data: InfraFileConfigApi.FileConfig) {
  return requestClient.put('/infra/file-config/update', data);
}
 
/** 删除文件配置 */
export function deleteFileConfig(id: number) {
  return requestClient.delete(`/infra/file-config/delete?id=${id}`);
}
 
/** 批量删除文件配置 */
export function deleteFileConfigList(ids: number[]) {
  return requestClient.delete(
    `/infra/file-config/delete-list?ids=${ids.join(',')}`,
  );
}
 
/** 测试文件配置 */
export function testFileConfig(id: number) {
  return requestClient.get(`/infra/file-config/test?id=${id}`);
}