提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export interface FilePageReqVO extends PageParam { |
|
4 |
path?: string |
|
5 |
type?: string |
|
6 |
createTime?: Date[] |
|
7 |
} |
|
8 |
|
|
9 |
// 文件预签名地址 Response VO |
|
10 |
export interface FilePresignedUrlRespVO { |
|
11 |
// 文件配置编号 |
|
12 |
configId: number |
|
13 |
// 文件上传 URL |
|
14 |
uploadUrl: string |
|
15 |
// 文件 URL |
|
16 |
url: string |
|
17 |
} |
|
18 |
|
|
19 |
// 查询文件列表 |
|
20 |
export const getFilePage = (params: FilePageReqVO) => { |
|
21 |
return request.get({ url: '/infra/file/page', params }) |
|
22 |
} |
|
23 |
|
|
24 |
// 删除文件 |
|
25 |
export const deleteFile = (id: number) => { |
|
26 |
return request.delete({ url: '/infra/file/delete?id=' + id }) |
|
27 |
} |
|
28 |
|
|
29 |
// 获取文件预签名地址 |
|
30 |
export const getFilePresignedUrl = (path: string) => { |
|
31 |
return request.get<FilePresignedUrlRespVO>({ |
|
32 |
url: '/infra/file/presigned-url', |
|
33 |
params: { path } |
|
34 |
}) |
|
35 |
} |
|
36 |
|
|
37 |
// 创建文件 |
|
38 |
export const createFile = (data: any) => { |
|
39 |
return request.post({ url: '/infra/file/create', data }) |
|
40 |
} |
|
41 |
|
|
42 |
// 上传文件 |
|
43 |
export const updateFile = (data: any) => { |
|
44 |
return request.upload({ url: '/infra/file/upload', data }) |
|
45 |
} |