feat: update
This commit is contained in:
73
types/api.ts
Normal file
73
types/api.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* API 相关类型定义
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页请求参数
|
||||
*/
|
||||
export interface PaginationParams {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
sortBy?: string;
|
||||
sortOrder?: 'asc' | 'desc';
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页响应数据
|
||||
*/
|
||||
export interface PaginationResponse<T> {
|
||||
list: T[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
totalPages: number;
|
||||
hasMore: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表响应数据
|
||||
*/
|
||||
export interface ListResponse<T> {
|
||||
items: T[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID 参数
|
||||
*/
|
||||
export interface IdParams {
|
||||
id: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量操作参数
|
||||
*/
|
||||
export interface BatchParams {
|
||||
ids: (string | number)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索参数
|
||||
*/
|
||||
export interface SearchParams {
|
||||
keyword: string;
|
||||
filters?: Record<string, any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传响应
|
||||
*/
|
||||
export interface UploadResponse {
|
||||
url: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
mimeType: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用操作响应
|
||||
*/
|
||||
export interface OperationResponse {
|
||||
success: boolean;
|
||||
message?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user