Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
2. 退款的时候可以退回分成
91 lines
2.3 KiB
TypeScript
91 lines
2.3 KiB
TypeScript
import { requestClient } from '#/api/request';
|
|
|
|
const prefix = 'file-gallery/';
|
|
|
|
export interface FileGalleryItem {
|
|
id: number;
|
|
url: string;
|
|
file_name?: string;
|
|
file_size: number;
|
|
file_size_text: string;
|
|
type?: number;
|
|
type_text?: string;
|
|
type_icon?: string;
|
|
group_ids?: number[];
|
|
created_at?: string;
|
|
original_name?: string;
|
|
object_key?: string;
|
|
source?: number;
|
|
}
|
|
|
|
export interface FileTypeItem {
|
|
id: number;
|
|
name: string;
|
|
icon?: string;
|
|
value: number;
|
|
suffix: string;
|
|
sort: number;
|
|
}
|
|
|
|
export interface FileGalleryDetail extends FileGalleryItem {
|
|
source_text?: string;
|
|
updated_at?: string;
|
|
}
|
|
|
|
export async function getFileGalleryList(params?: {
|
|
page?: number;
|
|
page_size?: number;
|
|
pid?: number;
|
|
type?: number;
|
|
group_id?: number;
|
|
keyword?: string;
|
|
}) {
|
|
return requestClient.get<{
|
|
items: FileGalleryItem[];
|
|
total: number;
|
|
page: number;
|
|
page_size: number;
|
|
}>(`${prefix}list`, { params });
|
|
}
|
|
|
|
export async function getFileGalleryDetail(id: number) {
|
|
return requestClient.get<FileGalleryDetail>(`${prefix}detail`, { params: { id } });
|
|
}
|
|
|
|
export async function deleteFileGalleryItem(id: number) {
|
|
return requestClient.post<any>(`${prefix}delete`, { id });
|
|
}
|
|
|
|
export async function renameFileGalleryItem(id: number, file_name: string) {
|
|
return requestClient.post<any>(`${prefix}rename`, { id, file_name });
|
|
}
|
|
|
|
export async function moveFileGalleryType(id: number, type: number) {
|
|
return requestClient.post<any>(`${prefix}move-type`, { id, type });
|
|
}
|
|
|
|
export async function batchArchiveFiles() {
|
|
return requestClient.post<{
|
|
reclassified: number;
|
|
file_name_filled: number;
|
|
}>(`${prefix}batch-archive`);
|
|
}
|
|
|
|
export async function getFileTypes() {
|
|
return requestClient.get<FileTypeItem[]>(`${prefix}file-types`);
|
|
}
|
|
|
|
export async function syncFileGalleryFromOss() {
|
|
return requestClient.post<{ synced: number; skipped: number; scanned: number }>(`${prefix}sync-oss`);
|
|
}
|
|
|
|
/** 文件加入自定义分组 */
|
|
export async function addFileToGroup(file_id: number, group_id: number) {
|
|
return requestClient.post<any>(`${prefix}add-to-group`, { file_id, group_id });
|
|
}
|
|
|
|
/** 文件移出自定义分组 */
|
|
export async function removeFileFromGroup(file_id: number, group_id: number) {
|
|
return requestClient.post<any>(`${prefix}remove-from-group`, { file_id, group_id });
|
|
}
|