init6
This commit is contained in:
85
shared/dist/types/base.d.ts
vendored
Normal file
85
shared/dist/types/base.d.ts
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* 基础类型定义
|
||||
* Base type definitions for the application
|
||||
*/
|
||||
/**
|
||||
* 基础实体接口 - 所有实体都应该有的基础字段
|
||||
* Base entity interface - common fields for all entities
|
||||
*/
|
||||
export interface BaseEntity {
|
||||
id: number;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
/**
|
||||
* API 响应基础结构
|
||||
* Base API response structure
|
||||
*/
|
||||
export interface ApiResponse<T = any> {
|
||||
success: boolean;
|
||||
data?: T;
|
||||
message?: string;
|
||||
error?: string;
|
||||
}
|
||||
/**
|
||||
* 分页查询参数
|
||||
* Pagination query parameters
|
||||
*/
|
||||
export interface PaginationParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* 分页响应结构
|
||||
* Paginated response structure
|
||||
*/
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
pagination: {
|
||||
page: number;
|
||||
limit: number;
|
||||
total: number;
|
||||
totalPages: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 查询操作符枚举
|
||||
* Query operators enum
|
||||
*/
|
||||
export declare enum QueryOperator {
|
||||
EQUALS = "equals",
|
||||
NOT_EQUALS = "not_equals",
|
||||
CONTAINS = "contains",
|
||||
NOT_CONTAINS = "not_contains",
|
||||
STARTS_WITH = "starts_with",
|
||||
ENDS_WITH = "ends_with",
|
||||
GREATER_THAN = "gt",
|
||||
GREATER_THAN_OR_EQUAL = "gte",
|
||||
LESS_THAN = "lt",
|
||||
LESS_THAN_OR_EQUAL = "lte",
|
||||
IN = "in",
|
||||
NOT_IN = "not_in",
|
||||
IS_NULL = "is_null",
|
||||
IS_NOT_NULL = "is_not_null"
|
||||
}
|
||||
/**
|
||||
* 查询条件接口
|
||||
* Query condition interface
|
||||
*/
|
||||
export interface QueryCondition {
|
||||
field: string;
|
||||
operator: QueryOperator;
|
||||
value?: any;
|
||||
}
|
||||
/**
|
||||
* 通用查询参数
|
||||
* Universal query parameters
|
||||
*/
|
||||
export interface UniversalQueryParams extends PaginationParams {
|
||||
conditions?: QueryCondition[];
|
||||
orderBy?: {
|
||||
field: string;
|
||||
direction: 'asc' | 'desc';
|
||||
}[];
|
||||
}
|
||||
//# sourceMappingURL=base.d.ts.map
|
||||
1
shared/dist/types/base.d.ts.map
vendored
Normal file
1
shared/dist/types/base.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;CACF;AAED;;;GAGG;AACH,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,OAAO;IACnB,qBAAqB,QAAQ;IAC7B,SAAS,OAAO;IAChB,kBAAkB,QAAQ;IAC1B,EAAE,OAAO;IACT,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,aAAa,CAAA;IACvB,KAAK,CAAC,EAAE,GAAG,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,UAAU,CAAC,EAAE,cAAc,EAAE,CAAA;IAC7B,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,KAAK,GAAG,MAAM,CAAA;KAC1B,EAAE,CAAA;CACJ"}
|
||||
26
shared/dist/types/base.js
vendored
Normal file
26
shared/dist/types/base.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 基础类型定义
|
||||
* Base type definitions for the application
|
||||
*/
|
||||
/**
|
||||
* 查询操作符枚举
|
||||
* Query operators enum
|
||||
*/
|
||||
export var QueryOperator;
|
||||
(function (QueryOperator) {
|
||||
QueryOperator["EQUALS"] = "equals";
|
||||
QueryOperator["NOT_EQUALS"] = "not_equals";
|
||||
QueryOperator["CONTAINS"] = "contains";
|
||||
QueryOperator["NOT_CONTAINS"] = "not_contains";
|
||||
QueryOperator["STARTS_WITH"] = "starts_with";
|
||||
QueryOperator["ENDS_WITH"] = "ends_with";
|
||||
QueryOperator["GREATER_THAN"] = "gt";
|
||||
QueryOperator["GREATER_THAN_OR_EQUAL"] = "gte";
|
||||
QueryOperator["LESS_THAN"] = "lt";
|
||||
QueryOperator["LESS_THAN_OR_EQUAL"] = "lte";
|
||||
QueryOperator["IN"] = "in";
|
||||
QueryOperator["NOT_IN"] = "not_in";
|
||||
QueryOperator["IS_NULL"] = "is_null";
|
||||
QueryOperator["IS_NOT_NULL"] = "is_not_null";
|
||||
})(QueryOperator || (QueryOperator = {}));
|
||||
//# sourceMappingURL=base.js.map
|
||||
1
shared/dist/types/base.js.map
vendored
Normal file
1
shared/dist/types/base.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8CH;;;GAGG;AACH,MAAM,CAAN,IAAY,aAeX;AAfD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,8CAA6B,CAAA;IAC7B,4CAA2B,CAAA;IAC3B,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,8CAA6B,CAAA;IAC7B,iCAAgB,CAAA;IAChB,2CAA0B,CAAA;IAC1B,0BAAS,CAAA;IACT,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,4CAA2B,CAAA;AAC7B,CAAC,EAfW,aAAa,KAAb,aAAa,QAexB"}
|
||||
8
shared/dist/types/index.d.ts
vendored
Normal file
8
shared/dist/types/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* 类型定义导出索引
|
||||
* Types export index
|
||||
*/
|
||||
export * from './base.js';
|
||||
export * from './post.js';
|
||||
export * from './user.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
shared/dist/types/index.d.ts.map
vendored
Normal file
1
shared/dist/types/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
|
||||
8
shared/dist/types/index.js
vendored
Normal file
8
shared/dist/types/index.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* 类型定义导出索引
|
||||
* Types export index
|
||||
*/
|
||||
export * from './base.js';
|
||||
export * from './post.js';
|
||||
export * from './user.js';
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
shared/dist/types/index.js.map
vendored
Normal file
1
shared/dist/types/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
|
||||
23
shared/dist/types/post.d.ts
vendored
Normal file
23
shared/dist/types/post.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Post 类型定义
|
||||
* 基于 Prisma 生成的类型
|
||||
*/
|
||||
export interface Post {
|
||||
id: number;
|
||||
title: string;
|
||||
content: string | null;
|
||||
published: boolean;
|
||||
createdAt: Date | string;
|
||||
updatedAt: Date | string;
|
||||
}
|
||||
export interface CreatePostInput {
|
||||
title: string;
|
||||
content?: string;
|
||||
published?: boolean;
|
||||
}
|
||||
export interface UpdatePostInput {
|
||||
title?: string;
|
||||
content?: string;
|
||||
published?: boolean;
|
||||
}
|
||||
//# sourceMappingURL=post.d.ts.map
|
||||
1
shared/dist/types/post.d.ts.map
vendored
Normal file
1
shared/dist/types/post.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/types/post.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;IACxB,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
||||
6
shared/dist/types/post.js
vendored
Normal file
6
shared/dist/types/post.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Post 类型定义
|
||||
* 基于 Prisma 生成的类型
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=post.js.map
|
||||
1
shared/dist/types/post.js.map
vendored
Normal file
1
shared/dist/types/post.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../src/types/post.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
||||
58
shared/dist/types/user.d.ts
vendored
Normal file
58
shared/dist/types/user.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 用户相关类型定义
|
||||
* User-related type definitions
|
||||
*/
|
||||
import type { BaseEntity } from './base.js';
|
||||
/**
|
||||
* 用户实体接口
|
||||
* User entity interface
|
||||
*/
|
||||
export interface User extends BaseEntity {
|
||||
name: string;
|
||||
email: string;
|
||||
age?: number;
|
||||
}
|
||||
/**
|
||||
* 创建用户输入类型
|
||||
* Create user input type
|
||||
*/
|
||||
export interface CreateUserInput {
|
||||
name: string;
|
||||
email: string;
|
||||
age?: number;
|
||||
}
|
||||
/**
|
||||
* 更新用户输入类型
|
||||
* Update user input type
|
||||
*/
|
||||
export interface UpdateUserInput {
|
||||
name?: string;
|
||||
email?: string;
|
||||
age?: number;
|
||||
}
|
||||
/**
|
||||
* 用户查询参数类型
|
||||
* User query parameters type
|
||||
*/
|
||||
export interface UserQueryParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
search?: string;
|
||||
minAge?: number;
|
||||
maxAge?: number;
|
||||
}
|
||||
/**
|
||||
* 邮箱查询参数类型
|
||||
* Email query parameters type
|
||||
*/
|
||||
export interface EmailQuery {
|
||||
email: string;
|
||||
}
|
||||
/**
|
||||
* 用户ID参数类型
|
||||
* User ID parameters type
|
||||
*/
|
||||
export interface UserIdParams {
|
||||
id: number;
|
||||
}
|
||||
//# sourceMappingURL=user.d.ts.map
|
||||
1
shared/dist/types/user.d.ts.map
vendored
Normal file
1
shared/dist/types/user.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C;;;GAGG;AACH,MAAM,WAAW,IAAK,SAAQ,UAAU;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;CACX"}
|
||||
6
shared/dist/types/user.js
vendored
Normal file
6
shared/dist/types/user.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 用户相关类型定义
|
||||
* User-related type definitions
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=user.js.map
|
||||
1
shared/dist/types/user.js.map
vendored
Normal file
1
shared/dist/types/user.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
||||
Reference in New Issue
Block a user