45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { apiRequest, ApiResponse } from "./api-utils";
|
|
|
|
export interface LibTag {
|
|
key: string;
|
|
label: string;
|
|
variant?: string;
|
|
}
|
|
|
|
export interface ContentLibraryGroup {
|
|
companyId: number;
|
|
projectId: number;
|
|
projectName: string;
|
|
libTotal: number;
|
|
libEnabled: number;
|
|
libraries: {
|
|
id: number;
|
|
name: string;
|
|
status: number;
|
|
itemCount: number;
|
|
callCount?: number;
|
|
lastCallTime?: string;
|
|
createTime: string;
|
|
libTags?: LibTag[];
|
|
}[];
|
|
}
|
|
|
|
export interface ContentLibrarySummary {
|
|
projects: number;
|
|
libraries: number;
|
|
zeroCall?: number;
|
|
emptyLib?: number;
|
|
highFreq?: number;
|
|
}
|
|
|
|
export async function getPlatformContentLibraryGrouped(
|
|
keyword = "",
|
|
classification = "",
|
|
): Promise<ApiResponse<{ groups: ContentLibraryGroup[]; summary: ContentLibrarySummary }>> {
|
|
const params = new URLSearchParams();
|
|
if (keyword) params.set("keyword", keyword);
|
|
if (classification && classification !== "all") params.set("classification", classification);
|
|
const q = params.toString();
|
|
return apiRequest(`/content-library/grouped${q ? `?${q}` : ""}`);
|
|
}
|