Files
timi-web/src/types/Model.ts
T
2026-08-07 10:46:14 +08:00

61 lines
951 B
TypeScript

// 基本实体模型
export type Model = {
id?: string;
createdAt?: number;
updatedAt?: number;
deletedAt?: number;
}
export type ApiResponse<T> = {
code: number;
message: string;
messageCode: string;
success: boolean;
fail: boolean;
data: T;
}
export type Page<T> = {
orderMap?: { [K in keyof T]?: OrderType };
equalsExample?: Partial<T>;
likesExample?: Partial<T>;
} & BasePage;
export type BasePage = {
index: number;
size: number;
}
export type OrderType = "ASC" | "DESC";
export type PageResult<T> = {
total: number;
list: T[];
}
// 携带验证码的请求体
export type CaptchaData<T> = {
captchaId: string;
captcha: string;
data: T;
}
// 图形验证码
export type CaptchaResult = {
id: string;
data: string;
}
export type ImageType = "IR-AUTO" | "IR-SMOOTH" | "IR-PIXELATED";
export type KeyValue<V, K = string> = {
key: K;
value?: V;
}
export type LabelValue<L, V = string> = {
label: L;
value?: V;
}