63 lines
1.0 KiB
TypeScript
63 lines
1.0 KiB
TypeScript
/** 基本实体模型 */
|
||
export type Model = {
|
||
id?: number;
|
||
|
||
createdAt?: number;
|
||
updatedAt?: number;
|
||
deletedAt?: number;
|
||
}
|
||
|
||
/** 基本返回对象 */
|
||
export type Response<T> = {
|
||
code: number;
|
||
msg?: string;
|
||
data: T;
|
||
}
|
||
|
||
/** 临时文件返回 */
|
||
export type TempFileResponse = {
|
||
|
||
/** 临时文件 ID */
|
||
id: string;
|
||
|
||
/** 过期于 */
|
||
expireAt: number;
|
||
}
|
||
|
||
/** 基本页面查询对象 */
|
||
export type QueryPage = {
|
||
|
||
/** 页面下标,从 0 开始 */
|
||
index: number;
|
||
|
||
/** 单页数据量 */
|
||
size: number;
|
||
|
||
/** 排序 */
|
||
orderMap?: { [key: string]: OrderType };
|
||
|
||
/** 全等比较条件(AND 连接) */
|
||
equalsExample?: { [key: string]: string | number | undefined | null };
|
||
|
||
/** 模糊查询条件(OR 连接) */
|
||
likeExample?: { [key: string]: string | undefined | null };
|
||
}
|
||
|
||
/** 排序方式 */
|
||
export enum OrderType {
|
||
ASC = "ASC",
|
||
DESC = "DESC"
|
||
}
|
||
|
||
/** 页面查询返回 */
|
||
export type QueryPageResult<T> = {
|
||
total: number;
|
||
list: T[];
|
||
}
|
||
|
||
/** 键值对对象 */
|
||
export type KeyValue<T> = {
|
||
key: string;
|
||
value: T;
|
||
}
|