Files
xxk-proxy/ui/src/api/common.ts
T
2026-06-11 10:31:24 +08:00

58 lines
1.0 KiB
TypeScript

/**
* 通用 API 类型定义
*/
/** API 响应结构 */
export interface ApiResponse<T = any> {
/** 响应码 */
code: string;
/** 响应数据 */
data: T;
/** 响应消息 */
msg: string;
}
/** 基础查询参数 */
export interface BaseQueryParams {
/** 页码 */
pageNum: number;
/** 每页记录数 */
pageSize: number;
/** 排序字段 */
sortBy?: string;
/** 排序方式(正序:ASC;反序:DESC) */
order?: string;
}
/** 分页数据结构(仅分页接口) */
export interface PageResult<T> {
/** 数据列表 */
list: T[];
/** 总记录数 */
total: number;
}
/** 下拉选项 */
export interface OptionItem {
/** 选项值 */
value: string | number;
/** 选项标签 */
label: string;
/** 子选项 */
children?: OptionItem[];
}
/** Excel 导入结果 */
export interface ExcelResult {
/** 响应码 */
code: string;
/** 无效数据数量 */
invalidCount: number;
/** 有效数据数量 */
validCount: number;
/** 错误信息列表 */
messageList: string[];
}