Files
cunkebao_v3/SuperAdmin/lib/platform-api.ts
Manus AI 5517457929 sync: 以本地为准同步全量变更至 GitHub
含四端需求文档、前端/后端/超管/触客宝迭代及部署脚本更新;未拉取远程。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 04:24:56 +08:00

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}` : ""}`);
}