2024-10-09 16:45:34 +08:00
|
|
|
import { http } from '@/api/service/request';
|
|
|
|
import type { BaseResult, ResultTable } from '@/api/service/types';
|
|
|
|
|
2024-10-12 16:57:13 +08:00
|
|
|
/** 系统文件管理---获取系统文件管理列表 */
|
2024-10-09 16:45:34 +08:00
|
|
|
export const fetchGetFilesList = (data: any) => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<BaseResult<ResultTable>>('get', `files/getFilesList/${data.currentPage}/${data.pageSize}`, {
|
|
|
|
params: data,
|
|
|
|
});
|
2024-10-09 16:45:34 +08:00
|
|
|
};
|
|
|
|
|
2024-10-23 13:46:46 +08:00
|
|
|
/** 系统文件管理---根据Id下载系统文件 */
|
2024-10-13 02:41:56 +08:00
|
|
|
export const downloadFilesByFileId = (data: any) => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<any>('get', `files/downloadFilesByFileId/${data.id}`, { responseType: 'blob' });
|
2024-10-13 02:41:56 +08:00
|
|
|
};
|
|
|
|
|
2024-10-22 15:55:48 +08:00
|
|
|
/** 系统文件管理---批量下载系统文件 */
|
2024-10-13 02:41:56 +08:00
|
|
|
export const downloadFilesByFilepath = (data: any) => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<any>('get', `files/downloadFilesByFilepath`, { params: data }, { responseType: 'blob' });
|
2024-10-12 16:57:13 +08:00
|
|
|
};
|
|
|
|
|
2024-10-14 14:12:43 +08:00
|
|
|
/** 系统文件管理---获取所有文件类型 */
|
|
|
|
export const fetchGetAllMediaTypes = () => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<BaseResult<any>>('get', `files/noManage/getAllMediaTypes`);
|
2024-10-14 14:12:43 +08:00
|
|
|
};
|
|
|
|
|
2024-10-22 13:34:01 +08:00
|
|
|
/** 系统文件管理---获取所有文件存储基础路径 */
|
2024-10-14 14:12:43 +08:00
|
|
|
export const fetchGetAllFilesStoragePath = () => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<BaseResult<any>>('get', `files/noManage/getAllFilesStoragePath`);
|
2024-10-14 14:12:43 +08:00
|
|
|
};
|
|
|
|
|
2024-10-12 16:57:13 +08:00
|
|
|
/** 系统文件管理---添加系统文件管理 */
|
2024-10-09 16:45:34 +08:00
|
|
|
export const fetchAddFiles = (data: any) => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<BaseResult<any>>(
|
|
|
|
'post',
|
|
|
|
'files/addFiles',
|
|
|
|
{ data },
|
|
|
|
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
|
|
|
);
|
2024-10-09 16:45:34 +08:00
|
|
|
};
|
|
|
|
|
2024-10-12 16:57:13 +08:00
|
|
|
/** 系统文件管理---更新系统文件管理 */
|
2024-10-09 16:45:34 +08:00
|
|
|
export const fetchUpdateFiles = (data: any) => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<BaseResult<object>>(
|
|
|
|
'put',
|
|
|
|
'files/updateFiles',
|
|
|
|
{ data },
|
|
|
|
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
|
|
|
);
|
2024-10-09 16:45:34 +08:00
|
|
|
};
|
|
|
|
|
2024-10-12 16:57:13 +08:00
|
|
|
/** 系统文件管理---删除系统文件管理 */
|
2024-10-09 16:45:34 +08:00
|
|
|
export const fetchDeleteFiles = (data: any) => {
|
2025-04-24 13:43:37 +08:00
|
|
|
return http.request<BaseResult<any>>('delete', 'files/deleteFiles', { data });
|
2024-10-09 16:45:34 +08:00
|
|
|
};
|