/** * 所有服务端接口的统一响应结构。 * 前端调用 /api/* 时统一接收这个格式。 */ export interface ICommonResponse { /** 业务状态码:0 = 成功,其他值为对应错误码 */ code: number; /** 响应数据:成功时为实际数据,无数据或失败时为 null */ data: T | null; /** 提示信息:成功或失败时展示给前端的文案 */ msg: string; } /** 语义化的成功响应类型,code 固定为字面量 0,便于类型收窄 */ export type ISuccessResponse = ICommonResponse & { code: 0 }; /** 语义化的错误响应类型 */ export type IErrorResponse = ICommonResponse & { code: number }; export * from "./openai"; export * from "./user";