- 统一调整 admin.ts 文件中的接口定义缩进格式 - 优化 animated-theme-toggler.tsx 组件的代码结构和缩进 - 规范 app-config-modal.tsx 中 JSX 元素的嵌套格式 - 整理 app-providers.tsx 中的组件层级缩进 - 标准化 app-theme.ts 中的对象属性缩进格式
34 lines
759 B
TypeScript
34 lines
759 B
TypeScript
import { apiGet, compactApiParams } from "@/services/api/request";
|
|
|
|
export type AssetLibraryItem = {
|
|
id: string;
|
|
title: string;
|
|
type: "text" | "image" | "video";
|
|
coverUrl: string;
|
|
tags: string[];
|
|
category: string;
|
|
description: string;
|
|
content: string;
|
|
url: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
};
|
|
|
|
export type AssetLibraryResponse = {
|
|
items: AssetLibraryItem[];
|
|
tags: string[];
|
|
total: number;
|
|
};
|
|
|
|
export type AssetLibraryQuery = {
|
|
keyword?: string;
|
|
type?: string;
|
|
tag?: string[];
|
|
page?: number;
|
|
pageSize?: number;
|
|
};
|
|
|
|
export async function fetchAssetLibrary(query: AssetLibraryQuery = {}) {
|
|
return apiGet<AssetLibraryResponse>("/api/assets", compactApiParams(query));
|
|
}
|