create-pardx-scaffold 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/package.json +1 -1
  2. package/template/apps/api/config.local.yaml +1 -89
  3. package/template/apps/api/generated/db/index.ts +39 -0
  4. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/discord-auth/discord-auth.service.ts +19 -12
  5. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/email-auth/email-auth.service.ts +19 -12
  6. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/file-source/file-source.service.ts +20 -13
  7. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/google-auth/google-auth.service.ts +19 -12
  8. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/mobile-auth/mobile-auth.service.ts +19 -12
  9. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/risk-detection-record/risk-detection-record.service.ts +14 -7
  10. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/system-task-queue/system-task-queue.service.ts +14 -7
  11. package/template/apps/api/{libs/domain/db/src → generated/db}/modules/wechat-auth/wechat-auth.service.ts +19 -12
  12. package/template/apps/api/generated/prisma-client/client.d.ts +1 -0
  13. package/template/apps/api/generated/prisma-client/client.js +5 -0
  14. package/template/apps/api/generated/prisma-client/default.d.ts +1 -0
  15. package/template/apps/api/generated/prisma-client/default.js +5 -0
  16. package/template/apps/api/generated/prisma-client/edge.d.ts +1 -0
  17. package/template/apps/api/generated/prisma-client/edge.js +378 -0
  18. package/template/apps/api/generated/prisma-client/index-browser.js +406 -0
  19. package/template/apps/api/generated/prisma-client/index.d.ts +22599 -0
  20. package/template/apps/api/generated/prisma-client/index.js +378 -0
  21. package/template/apps/api/generated/prisma-client/package.json +144 -0
  22. package/template/apps/api/generated/prisma-client/query_compiler_fast_bg.js +2 -0
  23. package/template/apps/api/generated/prisma-client/query_compiler_fast_bg.wasm +0 -0
  24. package/template/apps/api/generated/prisma-client/query_compiler_fast_bg.wasm-base64.js +2 -0
  25. package/template/apps/api/generated/prisma-client/runtime/client.d.ts +3304 -0
  26. package/template/apps/api/generated/prisma-client/runtime/client.js +86 -0
  27. package/template/apps/api/generated/prisma-client/runtime/index-browser.d.ts +87 -0
  28. package/template/apps/api/generated/prisma-client/runtime/index-browser.js +6 -0
  29. package/template/apps/api/generated/prisma-client/runtime/wasm-compiler-edge.js +76 -0
  30. package/template/apps/api/generated/prisma-client/schema.prisma +353 -0
  31. package/template/apps/api/generated/prisma-client/wasm-edge-light-loader.mjs +5 -0
  32. package/template/apps/api/generated/prisma-client/wasm-worker-loader.mjs +5 -0
  33. package/template/apps/api/libs/infra/common/config/dto/config.dto.ts +0 -5
  34. package/template/apps/api/libs/infra/common/config/validation/index.ts +0 -2
  35. package/template/apps/api/libs/infra/common/config/validation/yaml.validation.ts +0 -33
  36. package/template/apps/api/prisma/schema.prisma +1 -0
  37. package/template/apps/api/scripts/generate-db-crud.js +90 -34
  38. package/template/apps/api/tsconfig.json +10 -6
  39. package/template/apps/web/.env.example +1 -1
  40. package/template/apps/web/config.ts +8 -7
  41. package/template/apps/web/hooks/useNotificationSSE.ts +2 -1
  42. package/template/apps/web/hooks/useVersionCheck.ts +2 -1
  43. package/template/apps/web/lib/api/hooks/use-python-task.ts +2 -1
  44. package/template/scripts/generate-prisma-enums.js +2 -1
  45. package/template/scripts/generate-prisma-enums.ts +2 -1
  46. package/template/scripts/init-project.js +54 -30
  47. package/template/apps/api/libs/domain/db/package.json +0 -11
  48. package/template/apps/api/libs/domain/db/src/index.ts +0 -14
  49. package/template/apps/api/libs/domain/db/tsconfig.lib.json +0 -9
  50. package/template/apps/web/lib/config.ts +0 -163
  51. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/country-code/country-code.module.ts +0 -0
  52. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/country-code/country-code.service.ts +0 -0
  53. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/country-code/index.ts +0 -0
  54. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/discord-auth/discord-auth.module.ts +0 -0
  55. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/discord-auth/index.ts +0 -0
  56. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/email-auth/email-auth.module.ts +0 -0
  57. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/email-auth/index.ts +0 -0
  58. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/file-source/file-source.module.ts +0 -0
  59. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/file-source/index.ts +0 -0
  60. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/google-auth/google-auth.module.ts +0 -0
  61. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/google-auth/index.ts +0 -0
  62. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/message/index.ts +0 -0
  63. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/message/message.module.ts +0 -0
  64. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/message/message.service.ts +0 -0
  65. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/mobile-auth/index.ts +0 -0
  66. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/mobile-auth/mobile-auth.module.ts +0 -0
  67. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/risk-detection-record/index.ts +0 -0
  68. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/risk-detection-record/risk-detection-record.module.ts +0 -0
  69. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/system-task-queue/index.ts +0 -0
  70. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/system-task-queue/system-task-queue.module.ts +0 -0
  71. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/user-info/index.ts +0 -0
  72. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/user-info/user-info.module.ts +0 -0
  73. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/user-info/user-info.service.ts +0 -0
  74. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/wechat-auth/index.ts +0 -0
  75. /package/template/apps/api/{libs/domain/db/src → generated/db}/modules/wechat-auth/wechat-auth.module.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pardx-scaffold",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Scaffold a new project from PardxAI monorepo (git-tracked files)",
5
5
  "license": "MIT",
6
6
  "bin": "./cli.js",
@@ -1,6 +1,5 @@
1
1
  app:
2
2
  name: 'pardx'
3
- ChineseName: 'Pardx'
4
3
  version: '2.1.0'
5
4
  apiVersion: '1' # API 版本号
6
5
  minClientVersion: '0.0.1' # 最低兼容前端版本
@@ -11,17 +10,9 @@ app:
11
10
  MaxPageSize: 500
12
11
  defaultPageSize: 100
13
12
  defaultMiniPageSize: 30
14
- canCreateTrail: true
15
13
  defaultVendor: 'tos'
16
14
  defaultBucketPublic: false
17
- enableRetryMechanism: true
18
- enableEnhancedLogging: true
19
- maxRetries: 3
20
- baseRetryDelay: 1000
21
15
  nestLogOutput: 'both'
22
- audioTranscribe:
23
- statusUpdateMode: 'polling'
24
- pollingInterval: 30
25
16
  zones:
26
17
  - zone: 'cn'
27
18
  locale: 'zh-CN'
@@ -29,9 +20,6 @@ app:
29
20
  defaultPublicBucket: 'tos-pardx-files'
30
21
  transcodeBucket: 'tos-pardx-files'
31
22
 
32
- uploadConfig:
33
- chrunkSize: 8388608 #1024 * 1024 * 8
34
-
35
23
  ipinfo:
36
24
  url: 'https://ipinfo.io'
37
25
  token: 'f23c2d43721815'
@@ -107,9 +95,6 @@ rateLimit:
107
95
  userIds: [] # 管理员用户 ID
108
96
  apiKeys: [] # 内部服务 API Key
109
97
 
110
- pinecone:
111
- apiKey: 'cd14c373-cf91-4857-bdba-8384386193d5'
112
-
113
98
  # jwt 配置
114
99
  jwt:
115
100
  secret: '0EHAmnd9i82n'
@@ -150,18 +135,9 @@ redis:
150
135
  - name: 'shortCode'
151
136
  key: 'pardx:shortCode:'
152
137
  expireIn: -1
153
- - name: 'dailyQuestion'
154
- key: 'pardx:daily-question:'
155
- expireIn: 86400 # 24小时 (每天过期)
156
- - name: 'checkInStatus'
157
- key: 'pardx:check-in-status:'
158
- expireIn: 86400 # 24小时 (每天过期)
159
138
  - name: 'emailCodeDevice'
160
139
  key: 'pardx:emailCode:device:'
161
140
  expireIn: 180 # 3分钟
162
- - name: 'emailCodeEmail'
163
- key: 'pardx:emailCode:Email:'
164
- expireIn: 180 # 3分钟
165
141
  - name: 'emailCodePerDay'
166
142
  key: 'pardx:emailCode:EmailNumPerDay:'
167
143
  expireIn: 86400
@@ -179,93 +155,29 @@ redis:
179
155
  - name: 'subscription'
180
156
  key: 'pardx:subscription:'
181
157
  expireIn: 600 # 10分钟
182
- - name: 'subscriptionList'
183
- key: 'pardx:subscription:list:'
184
- expireIn: 300 # 5分钟(列表缓存时间较短,保证数据新鲜度)
185
- - name: 'notificationList'
186
- key: 'pardx:notification:list:'
187
- expireIn: 300 # 5分钟(通知列表缓存时间较短,保证数据新鲜度)
188
- - name: 'notificationStats'
189
- key: 'pardx:notification:stats:'
190
- expireIn: 60 # 1分钟(统计数据更新频繁,缓存时间更短)
191
158
  - name: 'privateDownloadUrl'
192
159
  key: 'pardx:file:fileurl:'
193
160
  expireIn: 30 #1小时
194
161
  - name: 'ipinfo'
195
162
  key: 'pardx:ipinfo:ip:'
196
163
  expireIn: 2592000 #30天
197
- - name: 'transferSaveForlder'
198
- key: 'pardx:transferSave:folderIds:'
199
- expireIn: 86400
200
- - name: 'recycleBinTask'
201
- key: 'pardx:recycleTask:fileSystemIds:'
202
- expireIn: 86400
203
- - name: 'moveFolder'
204
- key: 'pardx:moveFolder:folderIds:'
205
- expireIn: 86400
206
- # Long-term Memory System Cache (长期记忆系统缓存)
207
- - name: 'userPreferences'
208
- key: 'pardx:memory:preferences:'
209
- expireIn: 300 # 5分钟 (参考 Python 最佳实践)
210
- - name: 'memoryStats'
211
- key: 'pardx:memory:stats:'
212
- expireIn: 300 # 5分钟
213
- - name: 'preferenceStats'
214
- key: 'pardx:memory:preferenceStats:'
215
- expireIn: 300 # 5分钟
216
- - name: 'processTaskIdList' # 正在处理的taskId
217
- key: 'pardx:processTaskList:taskId:'
218
- expireIn: 86400
219
- - name: 'taskFileList' # 正在处理的task里面剩余处理的fsIds
220
- key: 'pardx:taskFileList:fsIds:'
221
- expireIn: 86400
222
164
  # ========== 业务实体缓存 (用于 @Cacheable 装饰器) ==========
223
165
  - name: 'userInfo' # 用户信息缓存
224
166
  key: 'pardx:cache:user:'
225
167
  expireIn: 1800 # 30分钟,提升登录响应速度
226
- - name: 'spaceInfo' # 空间信息缓存
227
- key: 'pardx:cache:space:'
228
- expireIn: 1800 # 30分钟
229
- - name: 'planInfo' # 套餐信息缓存
230
- key: 'pardx:cache:plan:'
231
- expireIn: 300 # 5分钟,变更频率低,查询频繁
232
168
  - name: 'permissions' # 权限配置缓存
233
169
  key: 'pardx:cache:perm:'
234
170
  expireIn: 600 # 10分钟,基础配置,变更少
235
171
  - name: 'modulePermission' # 模块级权限缓存
236
172
  key: 'pardx:cache:modulePerm:'
237
173
  expireIn: 300 # 5分钟
238
- - name: 'userRole' # 用户角色缓存 (包含 baseRole)
239
- key: 'pardx:cache:userRole:'
240
- expireIn: 3600 # 1小时
241
- - name: 'userInfoCache' # 旧的用户缓存 (保持兼容)
242
- key: 'pardx:user:'
243
- expireIn: -1
244
174
  - name: 'systemTask'
245
175
  key: 'pardx:task:'
246
176
  expireIn: -1
247
- - name: 'stockTask'
248
- key: 'pardx:stockTask:'
249
- expireIn: 86400
250
- - name: 'systemTaskListenerLock'
251
- key: 'pardx:taskListener:'
252
- expireIn: 15
253
- - name: 'taskLock'
254
- key: 'pardx:tasks:'
255
- expireIn: 10
256
- - name: 'tradeCache'
257
- key: 'pardx:file:fileurl:'
258
- expireIn: 30 #30s
259
177
  - name: 'sseChannel'
260
178
  key: 'pardx:sseChannel:'
261
179
  expireIn: 86400
262
- - name: 'wxAccessToken'
263
- key: 'pardx:wx:accessToken:'
264
- expireIn: 7200
265
- - name: 'wxmpQrcode'
266
- key: 'pardx:wxmp:qrcode:'
267
- expireIn: 300
268
- # ⚠️ P2: 流式识别会话数据持久化(Redis)
180
+ # 流式识别会话数据持久化(Redis)
269
181
  - name: 'streamingAsrSession'
270
182
  key: 'pardx:streaming-asr:session:'
271
183
  expireIn: 7200 # 2小时(与会话最大时长一致)
@@ -0,0 +1,39 @@
1
+ /**
2
+ * DB Services - All Services
3
+ *
4
+ * This file exports all DB services:
5
+ * - Auto-generated CRUD services (managed by generate-db-crud.js)
6
+ * - Hand-written domain services (custom business logic)
7
+ *
8
+ * Auto-generated services provide standard CRUD operations:
9
+ * - get(where) - findFirst with soft delete filter
10
+ * - getById(id) - findUnique by primary key
11
+ * - getByXxx(value) - findUnique by unique field
12
+ * - list(where, pagination) - paginated findMany
13
+ * - count(where) - count with soft delete filter
14
+ * - create(data) - create record
15
+ * - update(where, data) - update record
16
+ * - delete(where) - delete record
17
+ *
18
+ * DO NOT EDIT the auto-generated exports below.
19
+ * Hand-written services: user-info, country-code, message (EXCLUDE_MODELS)
20
+ */
21
+
22
+ // ============================================================================
23
+ // Hand-written domain services (EXCLUDE_MODELS - not overwritten by generator)
24
+ // ============================================================================
25
+ export * from './modules/user-info';
26
+ export * from './modules/country-code';
27
+ export * from './modules/message';
28
+
29
+ // ============================================================================
30
+ // Auto-generated CRUD services (managed by generate-db-crud.js)
31
+ // ============================================================================
32
+ export * from './modules/wechat-auth';
33
+ export * from './modules/google-auth';
34
+ export * from './modules/discord-auth';
35
+ export * from './modules/mobile-auth';
36
+ export * from './modules/email-auth';
37
+ export * from './modules/risk-detection-record';
38
+ export * from './modules/system-task-queue';
39
+ export * from './modules/file-source';
@@ -21,8 +21,8 @@ export class DiscordAuthService extends TransactionalServiceBase {
21
21
  @HandlePrismaError(DbOperationType.QUERY)
22
22
  async get(
23
23
  where: Prisma.DiscordAuthWhereInput,
24
- additional?: { select?: Prisma.DiscordAuthSelect },
25
- ): Promise<DiscordAuth | null> {
24
+ additional?: { select?: Prisma.DiscordAuthSelect; include?: Prisma.DiscordAuthInclude },
25
+ ): Promise<Partial<DiscordAuth> & any | null> {
26
26
  return this.getReadClient().discordAuth.findFirst({
27
27
  where: { ...where, isDeleted: false },
28
28
  ...additional,
@@ -32,8 +32,8 @@ export class DiscordAuthService extends TransactionalServiceBase {
32
32
  @HandlePrismaError(DbOperationType.QUERY)
33
33
  async getById(
34
34
  id: string,
35
- additional?: { select?: Prisma.DiscordAuthSelect },
36
- ): Promise<DiscordAuth | null> {
35
+ additional?: { select?: Prisma.DiscordAuthSelect; include?: Prisma.DiscordAuthInclude },
36
+ ): Promise<Partial<DiscordAuth> & any | null> {
37
37
  return this.getReadClient().discordAuth.findUnique({
38
38
  where: { discordId: id, isDeleted: false },
39
39
  ...additional,
@@ -44,12 +44,12 @@ export class DiscordAuthService extends TransactionalServiceBase {
44
44
  async list(
45
45
  where: Prisma.DiscordAuthWhereInput,
46
46
  pagination?: {
47
- orderBy?: Prisma.DiscordAuthOrderByWithRelationInput;
47
+ orderBy?: Prisma.DiscordAuthOrderByWithRelationInput|Prisma.DiscordAuthOrderByWithRelationInput[];
48
48
  limit?: number;
49
49
  page?: number;
50
50
  },
51
- additional?: { select?: Prisma.DiscordAuthSelect },
52
- ): Promise<{ list: DiscordAuth[]; total: number; page: number; limit: number }> {
51
+ additional?: { select?: Prisma.DiscordAuthSelect; include?: Prisma.DiscordAuthInclude },
52
+ ): Promise<{ list: (Partial<DiscordAuth> & any)[]; total: number; page: number; limit: number }> {
53
53
  const {
54
54
  orderBy = { createdAt: 'desc' },
55
55
  limit = this.appConfig.MaxPageSize,
@@ -73,11 +73,18 @@ export class DiscordAuthService extends TransactionalServiceBase {
73
73
  return { list, total, page, limit };
74
74
  }
75
75
 
76
+ @HandlePrismaError(DbOperationType.QUERY)
77
+ async count(where?: Prisma.DiscordAuthWhereInput): Promise<number> {
78
+ return this.getReadClient().discordAuth.count({
79
+ where: where ? { ...where, isDeleted: false } : { isDeleted: false },
80
+ });
81
+ }
82
+
76
83
  @HandlePrismaError(DbOperationType.CREATE)
77
84
  async create(
78
85
  data: Prisma.DiscordAuthCreateInput,
79
- additional?: { select?: Prisma.DiscordAuthSelect },
80
- ): Promise<DiscordAuth> {
86
+ additional?: { select?: Prisma.DiscordAuthSelect; include?: Prisma.DiscordAuthInclude },
87
+ ): Promise<Partial<DiscordAuth> & any> {
81
88
  return this.getWriteClient().discordAuth.create({ data, ...additional });
82
89
  }
83
90
 
@@ -85,8 +92,8 @@ export class DiscordAuthService extends TransactionalServiceBase {
85
92
  async update(
86
93
  where: Prisma.DiscordAuthWhereUniqueInput,
87
94
  data: Prisma.DiscordAuthUpdateInput,
88
- additional?: { select?: Prisma.DiscordAuthSelect },
89
- ): Promise<DiscordAuth> {
95
+ additional?: { select?: Prisma.DiscordAuthSelect; include?: Prisma.DiscordAuthInclude },
96
+ ): Promise<Partial<DiscordAuth> & any> {
90
97
  return this.getWriteClient().discordAuth.update({
91
98
  where,
92
99
  data,
@@ -95,7 +102,7 @@ export class DiscordAuthService extends TransactionalServiceBase {
95
102
  }
96
103
 
97
104
  @HandlePrismaError(DbOperationType.DELETE)
98
- async delete(where: Prisma.DiscordAuthWhereUniqueInput): Promise<DiscordAuth> {
105
+ async delete(where: Prisma.DiscordAuthWhereUniqueInput): Promise<Partial<DiscordAuth> & any> {
99
106
  return this.getWriteClient().discordAuth.delete({ where });
100
107
  }
101
108
  }
@@ -21,8 +21,8 @@ export class EmailAuthService extends TransactionalServiceBase {
21
21
  @HandlePrismaError(DbOperationType.QUERY)
22
22
  async get(
23
23
  where: Prisma.EmailAuthWhereInput,
24
- additional?: { select?: Prisma.EmailAuthSelect },
25
- ): Promise<EmailAuth | null> {
24
+ additional?: { select?: Prisma.EmailAuthSelect; include?: Prisma.EmailAuthInclude },
25
+ ): Promise<Partial<EmailAuth> & any | null> {
26
26
  return this.getReadClient().emailAuth.findFirst({
27
27
  where: { ...where, isDeleted: false },
28
28
  ...additional,
@@ -32,8 +32,8 @@ export class EmailAuthService extends TransactionalServiceBase {
32
32
  @HandlePrismaError(DbOperationType.QUERY)
33
33
  async getById(
34
34
  id: string,
35
- additional?: { select?: Prisma.EmailAuthSelect },
36
- ): Promise<EmailAuth | null> {
35
+ additional?: { select?: Prisma.EmailAuthSelect; include?: Prisma.EmailAuthInclude },
36
+ ): Promise<Partial<EmailAuth> & any | null> {
37
37
  return this.getReadClient().emailAuth.findUnique({
38
38
  where: { email: id, isDeleted: false },
39
39
  ...additional,
@@ -44,12 +44,12 @@ export class EmailAuthService extends TransactionalServiceBase {
44
44
  async list(
45
45
  where: Prisma.EmailAuthWhereInput,
46
46
  pagination?: {
47
- orderBy?: Prisma.EmailAuthOrderByWithRelationInput;
47
+ orderBy?: Prisma.EmailAuthOrderByWithRelationInput|Prisma.EmailAuthOrderByWithRelationInput[];
48
48
  limit?: number;
49
49
  page?: number;
50
50
  },
51
- additional?: { select?: Prisma.EmailAuthSelect },
52
- ): Promise<{ list: EmailAuth[]; total: number; page: number; limit: number }> {
51
+ additional?: { select?: Prisma.EmailAuthSelect; include?: Prisma.EmailAuthInclude },
52
+ ): Promise<{ list: (Partial<EmailAuth> & any)[]; total: number; page: number; limit: number }> {
53
53
  const {
54
54
  orderBy = { createdAt: 'desc' },
55
55
  limit = this.appConfig.MaxPageSize,
@@ -73,11 +73,18 @@ export class EmailAuthService extends TransactionalServiceBase {
73
73
  return { list, total, page, limit };
74
74
  }
75
75
 
76
+ @HandlePrismaError(DbOperationType.QUERY)
77
+ async count(where?: Prisma.EmailAuthWhereInput): Promise<number> {
78
+ return this.getReadClient().emailAuth.count({
79
+ where: where ? { ...where, isDeleted: false } : { isDeleted: false },
80
+ });
81
+ }
82
+
76
83
  @HandlePrismaError(DbOperationType.CREATE)
77
84
  async create(
78
85
  data: Prisma.EmailAuthCreateInput,
79
- additional?: { select?: Prisma.EmailAuthSelect },
80
- ): Promise<EmailAuth> {
86
+ additional?: { select?: Prisma.EmailAuthSelect; include?: Prisma.EmailAuthInclude },
87
+ ): Promise<Partial<EmailAuth> & any> {
81
88
  return this.getWriteClient().emailAuth.create({ data, ...additional });
82
89
  }
83
90
 
@@ -85,8 +92,8 @@ export class EmailAuthService extends TransactionalServiceBase {
85
92
  async update(
86
93
  where: Prisma.EmailAuthWhereUniqueInput,
87
94
  data: Prisma.EmailAuthUpdateInput,
88
- additional?: { select?: Prisma.EmailAuthSelect },
89
- ): Promise<EmailAuth> {
95
+ additional?: { select?: Prisma.EmailAuthSelect; include?: Prisma.EmailAuthInclude },
96
+ ): Promise<Partial<EmailAuth> & any> {
90
97
  return this.getWriteClient().emailAuth.update({
91
98
  where,
92
99
  data,
@@ -95,7 +102,7 @@ export class EmailAuthService extends TransactionalServiceBase {
95
102
  }
96
103
 
97
104
  @HandlePrismaError(DbOperationType.DELETE)
98
- async delete(where: Prisma.EmailAuthWhereUniqueInput): Promise<EmailAuth> {
105
+ async delete(where: Prisma.EmailAuthWhereUniqueInput): Promise<Partial<EmailAuth> & any> {
99
106
  return this.getWriteClient().emailAuth.delete({ where });
100
107
  }
101
108
  }
@@ -21,8 +21,8 @@ export class FileSourceService extends TransactionalServiceBase {
21
21
  @HandlePrismaError(DbOperationType.QUERY)
22
22
  async get(
23
23
  where: Prisma.FileSourceWhereInput,
24
- additional?: { select?: Prisma.FileSourceSelect },
25
- ): Promise<FileSource | null> {
24
+ additional?: { select?: Prisma.FileSourceSelect; include?: Prisma.FileSourceInclude },
25
+ ): Promise<Partial<FileSource> & any | null> {
26
26
  return this.getReadClient().fileSource.findFirst({
27
27
  where: { ...where, isDeleted: false },
28
28
  ...additional,
@@ -32,8 +32,8 @@ export class FileSourceService extends TransactionalServiceBase {
32
32
  @HandlePrismaError(DbOperationType.QUERY)
33
33
  async getById(
34
34
  id: string,
35
- additional?: { select?: Prisma.FileSourceSelect },
36
- ): Promise<FileSource | null> {
35
+ additional?: { select?: Prisma.FileSourceSelect; include?: Prisma.FileSourceInclude },
36
+ ): Promise<Partial<FileSource> & any | null> {
37
37
  return this.getReadClient().fileSource.findUnique({
38
38
  where: { id: id, isDeleted: false },
39
39
  ...additional,
@@ -41,7 +41,7 @@ export class FileSourceService extends TransactionalServiceBase {
41
41
  }
42
42
 
43
43
  @HandlePrismaError(DbOperationType.QUERY)
44
- async getByKey(value: string, additional?: { select?: Prisma.FileSourceSelect }): Promise<FileSource | null> {
44
+ async getByKey(value: string, additional?: { select?: Prisma.FileSourceSelect; include?: Prisma.FileSourceInclude }): Promise<FileSource & any | null> {
45
45
  return this.getReadClient().fileSource.findUnique({
46
46
  where: { key: value, isDeleted: false },
47
47
  ...additional,
@@ -52,12 +52,12 @@ export class FileSourceService extends TransactionalServiceBase {
52
52
  async list(
53
53
  where: Prisma.FileSourceWhereInput,
54
54
  pagination?: {
55
- orderBy?: Prisma.FileSourceOrderByWithRelationInput;
55
+ orderBy?: Prisma.FileSourceOrderByWithRelationInput|Prisma.FileSourceOrderByWithRelationInput[];
56
56
  limit?: number;
57
57
  page?: number;
58
58
  },
59
- additional?: { select?: Prisma.FileSourceSelect },
60
- ): Promise<{ list: FileSource[]; total: number; page: number; limit: number }> {
59
+ additional?: { select?: Prisma.FileSourceSelect; include?: Prisma.FileSourceInclude },
60
+ ): Promise<{ list: (Partial<FileSource> & any)[]; total: number; page: number; limit: number }> {
61
61
  const {
62
62
  orderBy = { createdAt: 'desc' },
63
63
  limit = this.appConfig.MaxPageSize,
@@ -81,11 +81,18 @@ export class FileSourceService extends TransactionalServiceBase {
81
81
  return { list, total, page, limit };
82
82
  }
83
83
 
84
+ @HandlePrismaError(DbOperationType.QUERY)
85
+ async count(where?: Prisma.FileSourceWhereInput): Promise<number> {
86
+ return this.getReadClient().fileSource.count({
87
+ where: where ? { ...where, isDeleted: false } : { isDeleted: false },
88
+ });
89
+ }
90
+
84
91
  @HandlePrismaError(DbOperationType.CREATE)
85
92
  async create(
86
93
  data: Prisma.FileSourceCreateInput,
87
- additional?: { select?: Prisma.FileSourceSelect },
88
- ): Promise<FileSource> {
94
+ additional?: { select?: Prisma.FileSourceSelect; include?: Prisma.FileSourceInclude },
95
+ ): Promise<Partial<FileSource> & any> {
89
96
  return this.getWriteClient().fileSource.create({ data, ...additional });
90
97
  }
91
98
 
@@ -93,8 +100,8 @@ export class FileSourceService extends TransactionalServiceBase {
93
100
  async update(
94
101
  where: Prisma.FileSourceWhereUniqueInput,
95
102
  data: Prisma.FileSourceUpdateInput,
96
- additional?: { select?: Prisma.FileSourceSelect },
97
- ): Promise<FileSource> {
103
+ additional?: { select?: Prisma.FileSourceSelect; include?: Prisma.FileSourceInclude },
104
+ ): Promise<Partial<FileSource> & any> {
98
105
  return this.getWriteClient().fileSource.update({
99
106
  where,
100
107
  data,
@@ -103,7 +110,7 @@ export class FileSourceService extends TransactionalServiceBase {
103
110
  }
104
111
 
105
112
  @HandlePrismaError(DbOperationType.DELETE)
106
- async delete(where: Prisma.FileSourceWhereUniqueInput): Promise<FileSource> {
113
+ async delete(where: Prisma.FileSourceWhereUniqueInput): Promise<Partial<FileSource> & any> {
107
114
  return this.getWriteClient().fileSource.delete({ where });
108
115
  }
109
116
  }
@@ -21,8 +21,8 @@ export class GoogleAuthService extends TransactionalServiceBase {
21
21
  @HandlePrismaError(DbOperationType.QUERY)
22
22
  async get(
23
23
  where: Prisma.GoogleAuthWhereInput,
24
- additional?: { select?: Prisma.GoogleAuthSelect },
25
- ): Promise<GoogleAuth | null> {
24
+ additional?: { select?: Prisma.GoogleAuthSelect; include?: Prisma.GoogleAuthInclude },
25
+ ): Promise<Partial<GoogleAuth> & any | null> {
26
26
  return this.getReadClient().googleAuth.findFirst({
27
27
  where: { ...where, isDeleted: false },
28
28
  ...additional,
@@ -32,8 +32,8 @@ export class GoogleAuthService extends TransactionalServiceBase {
32
32
  @HandlePrismaError(DbOperationType.QUERY)
33
33
  async getById(
34
34
  id: string,
35
- additional?: { select?: Prisma.GoogleAuthSelect },
36
- ): Promise<GoogleAuth | null> {
35
+ additional?: { select?: Prisma.GoogleAuthSelect; include?: Prisma.GoogleAuthInclude },
36
+ ): Promise<Partial<GoogleAuth> & any | null> {
37
37
  return this.getReadClient().googleAuth.findUnique({
38
38
  where: { sub: id, isDeleted: false },
39
39
  ...additional,
@@ -44,12 +44,12 @@ export class GoogleAuthService extends TransactionalServiceBase {
44
44
  async list(
45
45
  where: Prisma.GoogleAuthWhereInput,
46
46
  pagination?: {
47
- orderBy?: Prisma.GoogleAuthOrderByWithRelationInput;
47
+ orderBy?: Prisma.GoogleAuthOrderByWithRelationInput|Prisma.GoogleAuthOrderByWithRelationInput[];
48
48
  limit?: number;
49
49
  page?: number;
50
50
  },
51
- additional?: { select?: Prisma.GoogleAuthSelect },
52
- ): Promise<{ list: GoogleAuth[]; total: number; page: number; limit: number }> {
51
+ additional?: { select?: Prisma.GoogleAuthSelect; include?: Prisma.GoogleAuthInclude },
52
+ ): Promise<{ list: (Partial<GoogleAuth> & any)[]; total: number; page: number; limit: number }> {
53
53
  const {
54
54
  orderBy = { createdAt: 'desc' },
55
55
  limit = this.appConfig.MaxPageSize,
@@ -73,11 +73,18 @@ export class GoogleAuthService extends TransactionalServiceBase {
73
73
  return { list, total, page, limit };
74
74
  }
75
75
 
76
+ @HandlePrismaError(DbOperationType.QUERY)
77
+ async count(where?: Prisma.GoogleAuthWhereInput): Promise<number> {
78
+ return this.getReadClient().googleAuth.count({
79
+ where: where ? { ...where, isDeleted: false } : { isDeleted: false },
80
+ });
81
+ }
82
+
76
83
  @HandlePrismaError(DbOperationType.CREATE)
77
84
  async create(
78
85
  data: Prisma.GoogleAuthCreateInput,
79
- additional?: { select?: Prisma.GoogleAuthSelect },
80
- ): Promise<GoogleAuth> {
86
+ additional?: { select?: Prisma.GoogleAuthSelect; include?: Prisma.GoogleAuthInclude },
87
+ ): Promise<Partial<GoogleAuth> & any> {
81
88
  return this.getWriteClient().googleAuth.create({ data, ...additional });
82
89
  }
83
90
 
@@ -85,8 +92,8 @@ export class GoogleAuthService extends TransactionalServiceBase {
85
92
  async update(
86
93
  where: Prisma.GoogleAuthWhereUniqueInput,
87
94
  data: Prisma.GoogleAuthUpdateInput,
88
- additional?: { select?: Prisma.GoogleAuthSelect },
89
- ): Promise<GoogleAuth> {
95
+ additional?: { select?: Prisma.GoogleAuthSelect; include?: Prisma.GoogleAuthInclude },
96
+ ): Promise<Partial<GoogleAuth> & any> {
90
97
  return this.getWriteClient().googleAuth.update({
91
98
  where,
92
99
  data,
@@ -95,7 +102,7 @@ export class GoogleAuthService extends TransactionalServiceBase {
95
102
  }
96
103
 
97
104
  @HandlePrismaError(DbOperationType.DELETE)
98
- async delete(where: Prisma.GoogleAuthWhereUniqueInput): Promise<GoogleAuth> {
105
+ async delete(where: Prisma.GoogleAuthWhereUniqueInput): Promise<Partial<GoogleAuth> & any> {
99
106
  return this.getWriteClient().googleAuth.delete({ where });
100
107
  }
101
108
  }
@@ -21,8 +21,8 @@ export class MobileAuthService extends TransactionalServiceBase {
21
21
  @HandlePrismaError(DbOperationType.QUERY)
22
22
  async get(
23
23
  where: Prisma.MobileAuthWhereInput,
24
- additional?: { select?: Prisma.MobileAuthSelect },
25
- ): Promise<MobileAuth | null> {
24
+ additional?: { select?: Prisma.MobileAuthSelect; include?: Prisma.MobileAuthInclude },
25
+ ): Promise<Partial<MobileAuth> & any | null> {
26
26
  return this.getReadClient().mobileAuth.findFirst({
27
27
  where: { ...where, isDeleted: false },
28
28
  ...additional,
@@ -32,8 +32,8 @@ export class MobileAuthService extends TransactionalServiceBase {
32
32
  @HandlePrismaError(DbOperationType.QUERY)
33
33
  async getById(
34
34
  id: string,
35
- additional?: { select?: Prisma.MobileAuthSelect },
36
- ): Promise<MobileAuth | null> {
35
+ additional?: { select?: Prisma.MobileAuthSelect; include?: Prisma.MobileAuthInclude },
36
+ ): Promise<Partial<MobileAuth> & any | null> {
37
37
  return this.getReadClient().mobileAuth.findUnique({
38
38
  where: { mobile: id, isDeleted: false },
39
39
  ...additional,
@@ -44,12 +44,12 @@ export class MobileAuthService extends TransactionalServiceBase {
44
44
  async list(
45
45
  where: Prisma.MobileAuthWhereInput,
46
46
  pagination?: {
47
- orderBy?: Prisma.MobileAuthOrderByWithRelationInput;
47
+ orderBy?: Prisma.MobileAuthOrderByWithRelationInput|Prisma.MobileAuthOrderByWithRelationInput[];
48
48
  limit?: number;
49
49
  page?: number;
50
50
  },
51
- additional?: { select?: Prisma.MobileAuthSelect },
52
- ): Promise<{ list: MobileAuth[]; total: number; page: number; limit: number }> {
51
+ additional?: { select?: Prisma.MobileAuthSelect; include?: Prisma.MobileAuthInclude },
52
+ ): Promise<{ list: (Partial<MobileAuth> & any)[]; total: number; page: number; limit: number }> {
53
53
  const {
54
54
  orderBy = { createdAt: 'desc' },
55
55
  limit = this.appConfig.MaxPageSize,
@@ -73,11 +73,18 @@ export class MobileAuthService extends TransactionalServiceBase {
73
73
  return { list, total, page, limit };
74
74
  }
75
75
 
76
+ @HandlePrismaError(DbOperationType.QUERY)
77
+ async count(where?: Prisma.MobileAuthWhereInput): Promise<number> {
78
+ return this.getReadClient().mobileAuth.count({
79
+ where: where ? { ...where, isDeleted: false } : { isDeleted: false },
80
+ });
81
+ }
82
+
76
83
  @HandlePrismaError(DbOperationType.CREATE)
77
84
  async create(
78
85
  data: Prisma.MobileAuthCreateInput,
79
- additional?: { select?: Prisma.MobileAuthSelect },
80
- ): Promise<MobileAuth> {
86
+ additional?: { select?: Prisma.MobileAuthSelect; include?: Prisma.MobileAuthInclude },
87
+ ): Promise<Partial<MobileAuth> & any> {
81
88
  return this.getWriteClient().mobileAuth.create({ data, ...additional });
82
89
  }
83
90
 
@@ -85,8 +92,8 @@ export class MobileAuthService extends TransactionalServiceBase {
85
92
  async update(
86
93
  where: Prisma.MobileAuthWhereUniqueInput,
87
94
  data: Prisma.MobileAuthUpdateInput,
88
- additional?: { select?: Prisma.MobileAuthSelect },
89
- ): Promise<MobileAuth> {
95
+ additional?: { select?: Prisma.MobileAuthSelect; include?: Prisma.MobileAuthInclude },
96
+ ): Promise<Partial<MobileAuth> & any> {
90
97
  return this.getWriteClient().mobileAuth.update({
91
98
  where,
92
99
  data,
@@ -95,7 +102,7 @@ export class MobileAuthService extends TransactionalServiceBase {
95
102
  }
96
103
 
97
104
  @HandlePrismaError(DbOperationType.DELETE)
98
- async delete(where: Prisma.MobileAuthWhereUniqueInput): Promise<MobileAuth> {
105
+ async delete(where: Prisma.MobileAuthWhereUniqueInput): Promise<Partial<MobileAuth> & any> {
99
106
  return this.getWriteClient().mobileAuth.delete({ where });
100
107
  }
101
108
  }
@@ -22,7 +22,7 @@ export class RiskDetectionRecordService extends TransactionalServiceBase {
22
22
  async get(
23
23
  where: Prisma.RiskDetectionRecordWhereInput,
24
24
  additional?: { select?: Prisma.RiskDetectionRecordSelect },
25
- ): Promise<RiskDetectionRecord | null> {
25
+ ): Promise<Partial<RiskDetectionRecord> & any | null> {
26
26
  return this.getReadClient().riskDetectionRecord.findFirst({
27
27
  where: { ...where, isDeleted: false },
28
28
  ...additional,
@@ -33,7 +33,7 @@ export class RiskDetectionRecordService extends TransactionalServiceBase {
33
33
  async getById(
34
34
  id: string,
35
35
  additional?: { select?: Prisma.RiskDetectionRecordSelect },
36
- ): Promise<RiskDetectionRecord | null> {
36
+ ): Promise<Partial<RiskDetectionRecord> & any | null> {
37
37
  return this.getReadClient().riskDetectionRecord.findUnique({
38
38
  where: { id: id, isDeleted: false },
39
39
  ...additional,
@@ -44,12 +44,12 @@ export class RiskDetectionRecordService extends TransactionalServiceBase {
44
44
  async list(
45
45
  where: Prisma.RiskDetectionRecordWhereInput,
46
46
  pagination?: {
47
- orderBy?: Prisma.RiskDetectionRecordOrderByWithRelationInput;
47
+ orderBy?: Prisma.RiskDetectionRecordOrderByWithRelationInput|Prisma.RiskDetectionRecordOrderByWithRelationInput[];
48
48
  limit?: number;
49
49
  page?: number;
50
50
  },
51
51
  additional?: { select?: Prisma.RiskDetectionRecordSelect },
52
- ): Promise<{ list: RiskDetectionRecord[]; total: number; page: number; limit: number }> {
52
+ ): Promise<{ list: (Partial<RiskDetectionRecord> & any)[]; total: number; page: number; limit: number }> {
53
53
  const {
54
54
  orderBy = { createdAt: 'desc' },
55
55
  limit = this.appConfig.MaxPageSize,
@@ -73,11 +73,18 @@ export class RiskDetectionRecordService extends TransactionalServiceBase {
73
73
  return { list, total, page, limit };
74
74
  }
75
75
 
76
+ @HandlePrismaError(DbOperationType.QUERY)
77
+ async count(where?: Prisma.RiskDetectionRecordWhereInput): Promise<number> {
78
+ return this.getReadClient().riskDetectionRecord.count({
79
+ where: where ? { ...where, isDeleted: false } : { isDeleted: false },
80
+ });
81
+ }
82
+
76
83
  @HandlePrismaError(DbOperationType.CREATE)
77
84
  async create(
78
85
  data: Prisma.RiskDetectionRecordCreateInput,
79
86
  additional?: { select?: Prisma.RiskDetectionRecordSelect },
80
- ): Promise<RiskDetectionRecord> {
87
+ ): Promise<Partial<RiskDetectionRecord> & any> {
81
88
  return this.getWriteClient().riskDetectionRecord.create({ data, ...additional });
82
89
  }
83
90
 
@@ -86,7 +93,7 @@ export class RiskDetectionRecordService extends TransactionalServiceBase {
86
93
  where: Prisma.RiskDetectionRecordWhereUniqueInput,
87
94
  data: Prisma.RiskDetectionRecordUpdateInput,
88
95
  additional?: { select?: Prisma.RiskDetectionRecordSelect },
89
- ): Promise<RiskDetectionRecord> {
96
+ ): Promise<Partial<RiskDetectionRecord> & any> {
90
97
  return this.getWriteClient().riskDetectionRecord.update({
91
98
  where,
92
99
  data,
@@ -95,7 +102,7 @@ export class RiskDetectionRecordService extends TransactionalServiceBase {
95
102
  }
96
103
 
97
104
  @HandlePrismaError(DbOperationType.DELETE)
98
- async delete(where: Prisma.RiskDetectionRecordWhereUniqueInput): Promise<RiskDetectionRecord> {
105
+ async delete(where: Prisma.RiskDetectionRecordWhereUniqueInput): Promise<Partial<RiskDetectionRecord> & any> {
99
106
  return this.getWriteClient().riskDetectionRecord.delete({ where });
100
107
  }
101
108
  }