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. 退款的时候可以退回分成
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import { requestClient } from '#/api/request';
|
|
|
|
const prefix = 'file-group/';
|
|
|
|
export interface FileGroupRecord {
|
|
id: number;
|
|
name: string;
|
|
sort: number;
|
|
created_at?: number;
|
|
updated_at?: number;
|
|
}
|
|
|
|
export interface FileGroupOptionItem {
|
|
id: number;
|
|
name: string;
|
|
sort: number;
|
|
}
|
|
|
|
/** 分组选项缓存结构 */
|
|
export interface FileGroupCachePayload {
|
|
hash: string;
|
|
items: FileGroupOptionItem[];
|
|
}
|
|
|
|
/**
|
|
* 管理端分组列表
|
|
*/
|
|
export async function getFileGroupList() {
|
|
return requestClient.get<FileGroupRecord[]>(`${prefix}list`);
|
|
}
|
|
|
|
/**
|
|
* 带 hash 的分组选项:无变化时 result 为 0
|
|
*/
|
|
export async function getFileGroupOptions(hash?: string) {
|
|
return requestClient.get<FileGroupOptionItem[] | 0>(`${prefix}options`, {
|
|
params: hash ? { hash } : undefined,
|
|
});
|
|
}
|
|
|
|
export async function createFileGroup(data: Partial<FileGroupRecord>) {
|
|
return requestClient.post<any>(`${prefix}create`, data);
|
|
}
|
|
|
|
export async function updateFileGroup(data: Partial<FileGroupRecord> & { id: number }) {
|
|
return requestClient.post<any>(`${prefix}update`, data);
|
|
}
|
|
|
|
export async function deleteFileGroup(id: number) {
|
|
return requestClient.post<any>(`${prefix}delete`, { id });
|
|
}
|