@djvlc/openapi-user-client 1.7.15 → 1.8.1

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.
@@ -1,524 +1,323 @@
1
1
  # Schema 组件索引
2
+ # 与 docs/user-api/openapi.yaml 保持一致
2
3
 
3
4
  # ============================================================================
4
- # 通用
5
- # ============================================================================
6
-
7
- # ============================================================================
8
- # 统一响应结构(与 platform 仓库保持一致)
5
+ # 统一响应结构
9
6
  # ============================================================================
10
7
 
11
8
  SuccessResponse:
12
9
  type: object
13
10
  required: [success, code, message, data, timestamp, path]
14
- description: 成功响应(ApiSuccessResponse,与 types/src/common/api.ts 保持一致)
11
+ description: 成功响应(BaseResponseVo)
15
12
  properties:
16
13
  success:
17
14
  type: boolean
18
- enum: [true]
15
+ description: 请求是否成功
19
16
  example: true
20
- description: 是否成功(固定为 true)
21
17
  code:
22
18
  type: string
23
- example: OK
24
19
  description: 业务状态码
20
+ example: OK
25
21
  message:
26
22
  type: string
27
- example: 操作成功
28
23
  description: 响应消息
24
+ example: 操作成功
29
25
  data:
30
- description: 响应数据(泛型 T)
26
+ type: object
27
+ description: 响应数据
31
28
  timestamp:
32
- type: integer
33
- format: int64
29
+ type: number
30
+ description: 响应时间戳
34
31
  example: 1702300000000
35
- description: 响应时间戳(Unix 毫秒时间戳,number)
36
32
  path:
37
33
  type: string
38
- example: /api/user/pages/resolve
39
34
  description: 请求路径
35
+ example: /api/users
40
36
  requestId:
41
37
  type: string
38
+ description: 请求ID
42
39
  example: uuid-string
43
- description: 请求 ID(可选)
40
+ traceId:
41
+ type: string
42
+ description: 链路追踪ID(用于全链路定位问题)
43
+ example: trace-uuid-string
44
44
 
45
45
  ErrorResponse:
46
46
  type: object
47
47
  required: [success, code, message, timestamp, path]
48
- description: 错误响应(ApiErrorResponse,与 types/src/common/api.ts 保持一致)
48
+ description: 错误响应(ErrorResponseVo)
49
49
  properties:
50
50
  success:
51
51
  type: boolean
52
- enum: [false]
52
+ description: 请求是否成功
53
53
  example: false
54
- description: 是否成功(固定为 false)
55
54
  code:
56
55
  type: string
57
- example: VALIDATION_INVALID_PARAMS
58
- description: 错误码(ErrorCode | string)
56
+ description: 错误码
57
+ example: USER_NOT_FOUND
59
58
  message:
60
59
  type: string
61
- example: 请求参数无效
62
- description: 错误消息(用户可读)
63
- data:
64
- type: object
65
- additionalProperties: true
66
- description: 错误详情(Record<string, unknown>,与 types ApiErrorResponse.data 一致)
60
+ description: 错误消息
61
+ example: 用户不存在
67
62
  timestamp:
68
- type: integer
69
- format: int64
63
+ type: number
64
+ description: 响应时间戳
70
65
  example: 1702300000000
71
- description: 响应时间戳(Unix 毫秒时间戳,number)
72
66
  path:
73
67
  type: string
74
- example: /api/user/pages/resolve
75
68
  description: 请求路径
69
+ example: /api/users/123
76
70
  requestId:
77
71
  type: string
72
+ description: 请求ID
78
73
  example: uuid-string
79
- description: 请求 ID(可选)
80
74
  traceId:
81
75
  type: string
82
- example: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
83
- description: 链路追踪 ID(可选,用于分布式追踪)
76
+ description: 链路追踪ID(用于全链路定位问题)
77
+ example: trace-uuid-string
84
78
 
85
79
  # ============================================================================
86
- # 页面相关
80
+ # 通用分页
87
81
  # ============================================================================
88
82
 
89
- PageResponse:
90
- allOf:
91
- - $ref: '#/SuccessResponse'
92
- - type: object
93
- properties:
94
- data:
95
- type: object
96
- required: [pageId, version, meta]
97
- properties:
98
- pageId:
99
- type: string
100
- description: 页面 ID
101
- version:
102
- type: string
103
- description: 页面版本
104
- meta:
105
- type: object
106
- properties:
107
- title:
108
- type: string
109
- description: 页面标题
110
- description:
111
- type: string
112
- description: 页面描述
113
- integrity:
114
- type: string
115
- description: 完整性哈希
83
+ PaginationMeta:
84
+ type: object
85
+ required: [page, pageSize, total, totalPages, hasNext, hasPrevious]
86
+ description: 分页元数据(PageMetaVo)
87
+ properties:
88
+ page:
89
+ type: number
90
+ description: 当前页码
91
+ example: 1
92
+ pageSize:
93
+ type: number
94
+ description: 每页条数
95
+ example: 10
96
+ total:
97
+ type: number
98
+ description: 总条数
99
+ example: 100
100
+ totalPages:
101
+ type: number
102
+ description: 总页数
103
+ example: 10
104
+ hasNext:
105
+ type: boolean
106
+ description: 是否有下一页
107
+ example: true
108
+ hasPrevious:
109
+ type: boolean
110
+ description: 是否有上一页
111
+ example: false
116
112
 
117
- ResolvePageResponse:
118
- allOf:
119
- - $ref: '#/SuccessResponse'
120
- - type: object
121
- properties:
122
- data:
123
- type: object
124
- required: [pageId, resolvedVersionId, cdnBase, snapshotUrl, manifestUrl, ops, etag, cacheTtlSeconds]
125
- properties:
126
- pageId:
127
- type: string
128
- description: 页面 ID(UniqueId)
129
- resolvedVersionId:
130
- type: string
131
- description: 解析后的页面版本 ID(考虑灰度/回滚后的实际版本,UniqueId)
132
- cdnBase:
133
- type: string
134
- format: uri
135
- description: CDN 基础地址
136
- snapshotUrl:
137
- type: string
138
- format: uri
139
- description: snapshot.json 的完整 URL
140
- manifestUrl:
141
- type: string
142
- format: uri
143
- description: manifest.json 的完整 URL
144
- ops:
145
- $ref: '#/OpsConfig'
146
- description: 运维配置(killSwitch、blockedComponents、flags)
147
- etag:
148
- type: string
149
- description: 内容哈希(用于缓存验证)
150
- cacheTtlSeconds:
151
- type: integer
152
- minimum: 0
153
- maximum: 300
154
- default: 30
155
- description: 缓存 TTL(秒),建议 10~30 秒
156
- traceId:
157
- type: string
158
- description: 链路追踪 ID(全链路透传,与 types 可观测原则一致)
159
- runtimeVersion:
160
- type: string
161
- pattern: '^\d+\.\d+\.\d+$'
162
- description: 运行时版本(SemVer,与 manifest.runtime.version 一致)
163
- rolloutMatch:
164
- type: object
165
- description: 灰度匹配信息(可选,用于调试)
166
- properties:
167
- strategyId:
168
- type: string
169
- description: 匹配的策略 ID
170
- strategyName:
171
- type: string
172
- description: 匹配的策略名称
173
- isDefault:
174
- type: boolean
175
- description: 是否使用默认版本
176
- snapshot:
177
- type: object
178
- description: 完整快照(仅当 includeSnapshot=1 时返回,CDN 失败保底使用)
179
- properties:
180
- page:
181
- type: object
182
- description: 页面 Schema(PageSnapshotPage)
183
- properties:
184
- schemaVersion:
185
- type: string
186
- pageId:
187
- type: string
188
- pageVersion:
189
- type: string
190
- pattern: '^\d+\.\d+\.\d+$'
191
- title:
192
- type: string
193
- initialState:
194
- type: object
195
- additionalProperties: true
196
- bindings:
197
- type: array
198
- items:
199
- type: object
200
- root:
201
- type: object
202
- config:
203
- type: object
204
- manifest:
205
- type: object
206
- description: 组件锁定清单(PageSnapshotManifest)
207
- properties:
208
- components:
209
- type: array
210
- items:
211
- type: object
212
- properties:
213
- name:
214
- type: string
215
- version:
216
- type: string
217
- pattern: '^\d+\.\d+\.\d+$'
218
- integrity:
219
- type: string
220
- pattern: '^sha(256|384|512)-'
221
- assetsUrl:
222
- type: string
223
- format: uri
224
- entrypoints:
225
- type: object
226
- properties:
227
- js:
228
- type: string
229
- css:
230
- type: string
231
- chunks:
232
- type: array
233
- items:
234
- type: string
235
- runtime:
236
- type: object
237
- properties:
238
- version:
239
- type: string
240
- pattern: '^\d+\.\d+\.\d+$'
241
- minVersion:
242
- type: string
243
- pattern: '^\d+\.\d+\.\d+$'
244
- definitionsDigest:
245
- type: object
246
- description: 绑定的 Definition 版本摘要(DefinitionsDigest)
247
- properties:
248
- actions:
249
- type: array
250
- items:
251
- type: object
252
- properties:
253
- id:
254
- type: string
255
- name:
256
- type: string
257
- versionId:
258
- type: string
259
- hash:
260
- type: string
261
- queries:
262
- type: array
263
- items:
264
- type: object
265
- properties:
266
- id:
267
- type: string
268
- name:
269
- type: string
270
- versionId:
271
- type: string
272
- hash:
273
- type: string
274
- meta:
275
- type: object
276
- description: 元数据(PageSnapshotMeta)
277
- properties:
278
- pageId:
279
- type: string
280
- pageVersionId:
281
- type: string
282
- publishId:
283
- type: string
284
- schemaVersion:
285
- type: string
286
- createdAt:
287
- type: string
288
- format: date-time
289
- createdBy:
290
- type: string
291
- contentHash:
292
- type: string
293
- bindings:
294
- type: object
295
- properties:
296
- componentVersions:
297
- type: array
298
- items:
299
- type: string
300
- definitionVersions:
301
- type: array
302
- items:
303
- type: string
304
- runtimeVersion:
305
- type: string
306
- pattern: '^\d+\.\d+\.\d+$'
307
- env:
308
- type: string
309
- enum: [preview, staging, prod]
113
+ CursorPaginationMeta:
114
+ type: object
115
+ description: 游标分页元数据(PageRecordsMetaVo)
116
+ properties:
117
+ pageSize:
118
+ type: number
119
+ description: 每页条数
120
+ pageToken:
121
+ type: string
122
+ description: 下一页游标
123
+
124
+ # ============================================================================
125
+ # 页面相关
126
+ # ============================================================================
310
127
 
311
- ResourceManifests:
128
+ ResolvePageResponse:
312
129
  type: object
130
+ required: [pageId, resolvedVersionId, cdnBase, snapshotUrl, manifestUrl, ops, etag, cacheTtlSeconds]
131
+ description: 页面解析响应(PageResolveResponseVo)
313
132
  properties:
314
- components:
315
- type: array
316
- items:
317
- $ref: '#/ComponentManifest'
318
- description: 组件资源清单
319
- actions:
320
- type: array
321
- items:
322
- $ref: '#/ActionManifest'
323
- description: 动作资源清单
324
- queries:
325
- type: array
326
- items:
327
- $ref: '#/QueryManifest'
328
- description: 查询资源清单
133
+ pageId:
134
+ type: string
135
+ description: 页面 ID
136
+ example: page_123456
137
+ resolvedVersionId:
138
+ type: string
139
+ description: 解析后的页面版本 ID
140
+ example: pv_20240101_abc
141
+ cdnBase:
142
+ type: string
143
+ description: CDN 基础 URL
144
+ example: https://cdn.example.com
145
+ snapshotUrl:
146
+ type: string
147
+ description: Snapshot URL
148
+ example: https://cdn.example.com/pages/page_123456/snapshot.json
149
+ manifestUrl:
150
+ type: string
151
+ description: Manifest URL
152
+ example: https://cdn.example.com/pages/page_123456/manifest.json
153
+ ops:
154
+ description: 运维配置
155
+ allOf:
156
+ - $ref: '#/OpsConfig'
157
+ etag:
158
+ type: string
159
+ description: ETag(用于缓存)
160
+ example: '"abc123"'
161
+ cacheTtlSeconds:
162
+ type: number
163
+ description: 缓存 TTL(秒)
164
+ example: 300
165
+ traceId:
166
+ type: string
167
+ description: 链路追踪 ID
168
+ runtimeVersion:
169
+ type: string
170
+ description: 运行时版本(SemVer)
171
+ example: 1.0.0
329
172
 
330
- ComponentManifest:
173
+ ManifestComponent:
331
174
  type: object
332
- required: [componentType, version, entryUrl]
175
+ required: [name, version, source, integrity]
176
+ description: 组件清单项(ManifestComponentSwaggerVo)
333
177
  properties:
334
- componentType:
178
+ name:
335
179
  type: string
336
- description: 组件类型
180
+ description: 组件名称(Custom Element 标签名)
181
+ example: djvlc-button
337
182
  version:
338
183
  type: string
339
- description: 组件版本
340
- entryUrl:
184
+ description: 版本号
185
+ example: 1.0.0
186
+ source:
187
+ type: string
188
+ description: 组件来源
189
+ enum: [bundled, remote]
190
+ entry:
341
191
  type: string
342
- format: uri
343
- description: 组件入口 URL
344
- styleUrl:
192
+ description: 入口 URL(remote 组件必填)
193
+ styleEntry:
345
194
  type: string
346
- format: uri
347
- description: 样式文件 URL
195
+ description: 样式入口 URL
348
196
  integrity:
349
197
  type: string
350
198
  description: SRI 完整性哈希
351
- blocked:
352
- type: boolean
353
- description: 是否被阻断
354
- fallback:
355
- type: string
356
- description: 降级组件类型
357
-
358
- ActionManifest:
359
- type: object
360
- required: [actionId, actionDefinitionVersionId]
361
- properties:
362
- actionId:
363
- type: string
364
- description: 动作 ID
365
- actionDefinitionVersionId:
366
- type: string
367
- description: 动作定义版本 ID
368
- actionType:
369
- type: string
370
- enum: [claim, signin, lottery, reserve, bind, task_complete, vote, share, form_submit, navigate, setState, showToast, refreshData, custom]
371
- description: 动作类型
372
- builtin:
199
+ preload:
373
200
  type: boolean
374
- description: 是否内置动作
201
+ description: 是否预加载
375
202
 
376
- QueryManifest:
203
+ ManifestRuntime:
377
204
  type: object
378
- required: [queryId, queryVersionId]
205
+ required: [version, minVersion]
206
+ description: Runtime 版本信息(ManifestRuntimeVo)
379
207
  properties:
380
- queryId:
208
+ version:
381
209
  type: string
382
- description: 查询 ID
383
- queryVersionId:
210
+ description: 版本
211
+ example: 1.0.0
212
+ minVersion:
384
213
  type: string
385
- description: 查询定义版本 ID
386
- cacheTtl:
387
- type: integer
388
- description: 缓存 TTL(秒)
214
+ description: 最低兼容版本
215
+ example: 0.9.0
389
216
 
390
- # 与 types/page/snapshot.ts KillSwitchItem 对齐
391
- KillSwitchItem:
217
+ ManifestResponse:
392
218
  type: object
393
- required: [targetType, targetId, enabled]
394
- description: Kill-Switch 条目
219
+ required: [pageVersionId, manifestVersion, components, runtime]
220
+ description: 组件清单响应(ManifestSwaggerVo)
395
221
  properties:
396
- targetType:
397
- type: string
398
- enum: [action, component, feature, page, query]
399
- description: 目标类型
400
- targetId:
401
- type: string
402
- description: 目标 ID(actionType/componentName/featureKey/pageId/queryId)
403
- enabled:
404
- type: boolean
405
- description: 是否启用(true = 被关闭)
406
- reason:
407
- type: string
408
- description: 关闭原因
409
- enabledAt:
410
- type: string
411
- format: date-time
412
- description: 关闭时间(ISO8601)
413
- enabledBy:
222
+ pageVersionId:
414
223
  type: string
415
- description: 关闭操作者
416
- userMessage:
224
+ description: 页面版本 ID
225
+ manifestVersion:
417
226
  type: string
418
- description: 用户提示消息
227
+ description: 清单版本
228
+ components:
229
+ description: 组件列表
230
+ type: array
231
+ items:
232
+ $ref: '#/ManifestComponent'
233
+ runtime:
234
+ description: Runtime 版本
235
+ allOf:
236
+ - $ref: '#/ManifestRuntime'
419
237
 
420
- # 与 types/page/snapshot.ts BlockedComponentItem 对齐
421
- BlockedComponentItem:
238
+ BlockedComponent:
422
239
  type: object
423
- required: [name, reason]
424
- description: 被阻断的组件条目
240
+ required: [name, reason, blockedAt, blockedBy]
241
+ description: 被阻断的组件(BlockedComponentVo)
425
242
  properties:
426
243
  name:
427
244
  type: string
428
245
  description: 组件名称
429
246
  version:
430
247
  type: string
431
- pattern: '^\d+\.\d+\.\d+$'
432
- description: 组件版本(可选,不指定则阻断所有版本)
248
+ description: 组件版本(不填则阻断所有版本)
433
249
  reason:
434
250
  type: string
435
251
  description: 阻断原因
436
252
  blockedAt:
437
253
  type: string
438
- format: date-time
439
- description: 阻断时间(ISO8601)
254
+ description: 阻断时间
440
255
  blockedBy:
441
256
  type: string
442
- description: 阻断操作者
443
- fallbackVersion:
444
- type: string
445
- pattern: '^\d+\.\d+\.\d+$'
446
- description: 降级版本(可选)
447
- urgent:
257
+ description: 操作者
258
+
259
+ DegradeConfig:
260
+ type: object
261
+ required: [enabled, mode]
262
+ description: 降级配置(DegradeConfigVo)
263
+ properties:
264
+ enabled:
448
265
  type: boolean
449
- description: 是否紧急阻断
266
+ description: 是否启用降级
267
+ mode:
268
+ type: string
269
+ description: 降级模式
270
+ enum: [fallback, static, error]
271
+ message:
272
+ type: string
273
+ description: 降级消息
450
274
 
451
275
  OpsConfig:
452
276
  type: object
453
- description: 运维配置(运行时下发,与 types/page/snapshot.ts OpsConfig 对齐)
454
- required: [killSwitch, blockedComponents, flags]
277
+ required: [killSwitch, blockedComponents, blockedPages, featureFlags, degradeConfig]
278
+ description: 运维配置(OpsConfigVo)
455
279
  properties:
456
- configVersionId:
457
- type: string
458
- description: 配置版本 ID(用于缓存失效)
459
280
  killSwitch:
281
+ type: boolean
282
+ description: 全局 kill-switch
283
+ blockedComponents:
284
+ description: 被阻断的组件列表
460
285
  type: array
461
286
  items:
462
- $ref: '#/KillSwitchItem'
463
- description: Kill-Switch 列表(被紧急关闭的功能/动作)
464
- blockedComponents:
287
+ $ref: '#/BlockedComponent'
288
+ blockedPages:
289
+ description: 被阻断的页面列表
465
290
  type: array
466
291
  items:
467
- $ref: '#/BlockedComponentItem'
468
- description: 被阻断的组件列表
469
- flags:
292
+ type: string
293
+ featureFlags:
470
294
  type: object
295
+ description: 功能开关
471
296
  additionalProperties:
472
297
  type: boolean
473
- description: 功能开关(Feature Flags)
474
- expiresAt:
475
- type: string
476
- format: date-time
477
- description: 配置过期时间(ISO8601)
298
+ degradeConfig:
299
+ description: 降级配置
300
+ allOf:
301
+ - $ref: '#/DegradeConfig'
478
302
 
479
303
  # ============================================================================
480
304
  # Action Gateway 动作相关
481
305
  # ============================================================================
482
306
 
483
- ExecuteActionRequest:
484
- type: object
485
- required: [actionType, params, context]
486
- description: 动作执行请求(ActionExecuteRequest)
487
- properties:
488
- actionType:
489
- type: string
490
- enum: [claim, signin, lottery, reserve, bind, task_complete, vote, share, form_submit, navigate, setState, showToast, refreshData, custom]
491
- description: 动作类型(ActionType | string)
492
- actionDefinitionVersionId:
493
- type: string
494
- description: 动作定义版本 ID(可选,不提供则使用最新稳定版,UniqueId)
495
- params:
496
- type: object
497
- additionalProperties: true
498
- description: 动作参数(Record<string, JsonValue>)
499
- context:
500
- $ref: '#/ActionClientContext'
501
- description: 客户端上下文(ActionClientContext,必填)
502
- idempotencyKey:
503
- type: string
504
- minLength: 16
505
- maxLength: 128
506
- description: 幂等键(部分策略需要客户端提供,防重复提交)
507
-
508
307
  ActionClientContext:
509
308
  type: object
510
- description: 动作执行上下文(ActionClientContext,问题追溯必须字段)
511
309
  required: [pageVersionId]
310
+ description: 动作执行上下文(ActionContextDto)
512
311
  properties:
513
312
  pageVersionId:
514
313
  type: string
515
- description: 页面版本 ID(不可变,UniqueId)
314
+ description: 页面版本 ID
516
315
  componentVersionId:
517
316
  type: string
518
- description: 组件版本 ID(UniqueId)
317
+ description: 组件版本 ID
519
318
  componentInstanceId:
520
319
  type: string
521
- description: 组件实例 ID(UniqueId)
320
+ description: 组件实例 ID
522
321
  triggerEvent:
523
322
  type: string
524
323
  description: 触发事件名
@@ -527,794 +326,820 @@ ActionClientContext:
527
326
  description: 设备 ID
528
327
  channel:
529
328
  type: string
530
- description: 渠道标识
329
+ description: 渠道
531
330
  clientTimestamp:
532
331
  type: string
533
- format: date-time
534
- description: 客户端时间戳(ISODateTime)
332
+ description: 客户端时间戳(ISO 8601)
535
333
  extra:
536
334
  type: object
335
+ description: 扩展数据
537
336
  additionalProperties: true
538
- description: 扩展数据(Record<string, JsonValue>)
539
337
 
540
- ExecuteActionResponse:
541
- allOf:
542
- - $ref: '#/SuccessResponse'
543
- - type: object
544
- properties:
545
- data:
546
- type: object
547
- properties:
548
- actionId:
549
- type: string
550
- description: 动作执行 ID(UniqueId,用于审计追溯)
551
- result:
552
- description: 执行结果(泛型 T)
553
- effects:
554
- type: array
555
- items:
556
- $ref: '#/ActionEffect'
557
- description: 副作用列表
558
- errorCode:
559
- type: string
560
- description: 错误码(失败时)
561
- errorMessage:
562
- type: string
563
- description: 错误消息(失败时,用户可见)
564
- errorDetails:
565
- type: object
566
- additionalProperties: true
567
- description: 错误详情(失败时,调试用)
568
- requestId:
569
- type: string
570
- description: 请求 ID
571
- traceId:
572
- type: string
573
- description: 链路追踪 ID
574
- duration:
575
- type: integer
576
- description: 执行耗时(毫秒)
577
- retryable:
578
- type: boolean
579
- description: 是否可重试
580
- retryAfter:
581
- type: integer
582
- description: 建议重试延迟(毫秒)
583
- riskDecision:
584
- type: object
585
- description: 风控决策(可选,风控拒绝时返回)
586
- properties:
587
- allowed:
588
- type: boolean
589
- description: 是否放行
590
- reason:
591
- type: string
592
- description: 拒绝原因(如 RISK_BLOCKED)
593
- code:
594
- type: string
595
- description: 风控错误码
596
-
597
- ActionEffect:
338
+ ExecuteActionRequest:
598
339
  type: object
599
- required: [type]
340
+ required: [actionType, params, context]
341
+ description: 动作执行请求(ActionExecuteDto)
600
342
  properties:
601
- type:
343
+ actionType:
344
+ type: string
345
+ description: 动作类型
346
+ example: claim
347
+ actionDefinitionVersionId:
602
348
  type: string
603
- enum: [setState, navigate, showToast, refreshData, openDialog, closeDialog, custom]
604
- description: 副作用类型
605
- payload:
349
+ description: 动作定义版本 ID(不提供则使用最新稳定版)
350
+ params:
606
351
  type: object
352
+ description: 动作参数
607
353
  additionalProperties: true
608
- description: 副作用参数
354
+ example:
355
+ couponId: '12345'
356
+ quantity: 1
357
+ default: {}
358
+ idempotencyKey:
359
+ type: string
360
+ description: 幂等键
361
+ context:
362
+ description: 客户端上下文
363
+ allOf:
364
+ - $ref: '#/ActionClientContext'
609
365
 
610
- IdempotencyConflictResponse:
366
+ ExecuteActionResponse:
611
367
  type: object
612
- required: [success, data]
368
+ required: [success, requestId, traceId, actionId, duration]
369
+ description: 动作执行响应(ActionExecuteVo)
613
370
  properties:
614
371
  success:
615
372
  type: boolean
616
- example: true
373
+ description: 是否成功
617
374
  data:
618
375
  type: object
619
- properties:
620
- idempotent:
621
- type: boolean
622
- example: true
623
- originalActionId:
624
- type: string
625
- description: 原始动作执行 ID
626
- originalResult:
627
- description: 原始执行结果
628
- originalExecutedAt:
629
- type: string
630
- format: date-time
631
- description: 原始执行时间
376
+ description: 业务数据
377
+ additionalProperties: true
378
+ example:
379
+ couponId: '12345'
380
+ claimedAt: '2024-01-01T00:00:00Z'
381
+ errorCode:
382
+ type: string
383
+ description: 错误码
384
+ errorMessage:
385
+ type: string
386
+ description: 错误信息(用户可见)
387
+ errorDetails:
388
+ type: object
389
+ description: 错误详情(调试用)
390
+ additionalProperties: true
391
+ requestId:
392
+ type: string
393
+ description: 请求 ID
394
+ traceId:
395
+ type: string
396
+ description: 链路追踪 ID
397
+ actionId:
398
+ type: string
399
+ description: 动作 ID(用于审计追溯)
400
+ duration:
401
+ type: number
402
+ description: 执行耗时(毫秒)
403
+ retryable:
404
+ type: boolean
405
+ description: 是否可重试
406
+ retryAfter:
407
+ type: number
408
+ description: 建议重试延迟(毫秒)
632
409
 
633
410
  ValidateActionRequest:
634
411
  type: object
635
- required: [actionType, params]
412
+ required: [actionDefinitionVersionId, params]
413
+ description: 动作参数验证请求(ActionValidateDto)
636
414
  properties:
637
- actionType:
638
- type: string
639
- description: 动作类型
640
415
  actionDefinitionVersionId:
641
416
  type: string
642
417
  description: 动作定义版本 ID
643
418
  params:
644
419
  type: object
420
+ description: 待验证参数
645
421
  additionalProperties: true
646
- description: 待验证的参数
422
+ example:
423
+ couponId: '12345'
424
+ quantity: 1
425
+ default: {}
647
426
 
648
427
  ValidateActionResponse:
649
428
  type: object
650
- required: [data]
429
+ required: [valid]
430
+ description: 动作参数验证响应(ActionValidateVo)
651
431
  properties:
652
- data:
653
- type: object
654
- required: [valid]
655
- properties:
656
- valid:
657
- type: boolean
658
- description: 是否有效
659
- errors:
660
- type: array
661
- items:
662
- type: object
663
- properties:
664
- path:
665
- type: string
666
- description: 参数路径
667
- message:
668
- type: string
669
- description: 错误消息
670
- code:
671
- type: string
672
- description: 错误码
673
- description: 验证错误
432
+ valid:
433
+ type: boolean
434
+ description: 是否通过校验
435
+ errors:
436
+ description: 校验错误列表
437
+ type: array
438
+ items:
439
+ type: string
674
440
 
675
- ActionDefinitionResponse:
441
+ ActionDefinitionVersionResponse:
676
442
  type: object
677
- required: [data]
443
+ required: [uid, definitionUid, versionNumber, spec, status, createdBy, createdByUsername, createdAt]
444
+ description: 动作定义版本响应(ActionDefinitionVersionVo)
678
445
  properties:
679
- data:
446
+ uid:
447
+ type: string
448
+ description: 版本 UID
449
+ example: 202401efgh87654321
450
+ definitionUid:
451
+ type: string
452
+ description: 所属定义 UID
453
+ example: 202401abcd12345678
454
+ versionNumber:
455
+ type: number
456
+ description: 版本号(递增)
457
+ example: 1
458
+ versionLabel:
459
+ type: string
460
+ nullable: true
461
+ description: 版本标签(可选,如 v1.0.0)
462
+ example: v1.0.0
463
+ description:
464
+ type: string
465
+ nullable: true
466
+ description: 版本描述
467
+ spec:
468
+ description: 规格快照(不可变的 ActionSpec)
680
469
  type: object
681
- properties:
682
- actionDefinitionVersionId:
683
- type: string
684
- actionType:
685
- type: string
686
- name:
687
- type: string
688
- paramsSchema:
689
- type: object
690
- description: 参数 JSON Schema
691
- resultSchema:
692
- type: object
693
- description: 结果 JSON Schema
470
+ additionalProperties: true
471
+ status:
472
+ type: string
473
+ description: 版本状态
474
+ enum: [draft, stable, deprecated, blocked]
475
+ example: stable
476
+ createdBy:
477
+ type: string
478
+ description: 创建者 UID
479
+ example: 202401user1234
480
+ createdByUsername:
481
+ type: string
482
+ description: 创建者用户名
483
+ example: admin
484
+ createdAt:
485
+ type: string
486
+ format: date-time
487
+ description: 创建时间
694
488
 
695
489
  # ============================================================================
696
490
  # Data Proxy 查询相关
697
491
  # ============================================================================
698
492
 
493
+ QueryContext:
494
+ type: object
495
+ description: 数据查询上下文(DataQueryContextDto)
496
+ properties:
497
+ uid:
498
+ type: string
499
+ description: 用户 UID
500
+ pageVersionId:
501
+ type: string
502
+ description: 页面版本 ID
503
+ componentVersionId:
504
+ type: string
505
+ description: 组件版本 ID
506
+
699
507
  QueryDataRequest:
700
508
  type: object
701
509
  required: [queryVersionId]
702
- description: 数据查询请求(DataQueryRequest
510
+ description: 数据查询请求(DataQueryDto
703
511
  properties:
704
512
  queryVersionId:
705
513
  type: string
706
- description: 查询定义版本 ID(UniqueId)
514
+ description: 查询版本 ID
707
515
  params:
708
516
  type: object
517
+ description: 查询参数
709
518
  additionalProperties: true
710
- description: 查询参数(Record<string, JsonValue>)
711
- cacheControl:
712
- type: object
713
- description: 缓存策略覆盖
714
- properties:
715
- noCache:
716
- type: boolean
717
- description: 是否跳过缓存
718
- forceRefresh:
719
- type: boolean
720
- description: 强制刷新缓存
721
519
  context:
722
- $ref: '#/QueryContext'
723
- description: 客户端上下文(可选)
520
+ description: 上下文
521
+ allOf:
522
+ - $ref: '#/QueryContext'
724
523
 
725
- QueryContext:
524
+ QueryMetadata:
726
525
  type: object
727
- description: 数据查询上下文(DataQueryRequest.context
526
+ description: 查询元数据(DataQueryMetadataVo
728
527
  properties:
729
- pageVersionId:
730
- type: string
731
- description: 页面版本 ID(UniqueId)
732
- componentVersionId:
733
- type: string
734
- description: 组件版本 ID(UniqueId,可选)
528
+ fromCache:
529
+ type: boolean
530
+ description: 是否来自缓存
531
+ duration:
532
+ type: number
533
+ description: 查询耗时(毫秒)
735
534
 
736
535
  QueryDataResponse:
737
- allOf:
738
- - $ref: '#/SuccessResponse'
739
- - type: object
740
- properties:
741
- data:
742
- description: 查询结果数据(泛型 T)
743
- # 错误信息(失败时)
744
- errorCode:
745
- type: string
746
- description: 错误码(失败时)
747
- errorMessage:
748
- type: string
749
- description: 错误消息(失败时)
750
- # 缓存信息
751
- fromCache:
752
- type: boolean
753
- description: 是否来自缓存
754
- cachedAt:
755
- type: string
756
- format: date-time
757
- description: 缓存时间戳(ISODateTime)
758
- age:
759
- type: integer
760
- description: 数据新鲜度(秒)
761
- # 追踪信息
762
- requestId:
763
- type: string
764
- description: 请求 ID
765
- traceId:
766
- type: string
767
- description: 链路追踪 ID
768
- duration:
769
- type: integer
770
- description: 查询耗时(毫秒)
771
- # 降级信息
772
- degraded:
773
- type: boolean
774
- description: 是否为降级数据
775
- degradedReason:
776
- type: string
777
- description: 降级原因
778
-
779
- QueryDefinitionResponse:
780
536
  type: object
781
- required: [data]
537
+ required: [success]
538
+ description: 数据查询响应(DataQueryVo)
782
539
  properties:
540
+ success:
541
+ type: boolean
542
+ description: 是否成功
783
543
  data:
784
544
  type: object
785
- properties:
786
- queryVersionId:
787
- type: string
788
- name:
789
- type: string
790
- paramsSchema:
791
- type: object
792
- description: 参数 JSON Schema
793
- resultSchema:
794
- type: object
795
- description: 结果 JSON Schema
796
- cacheTtl:
797
- type: integer
798
- description: 缓存 TTL(秒)
545
+ description: 数据
546
+ additionalProperties: true
547
+ errorCode:
548
+ type: string
549
+ description: 错误码
550
+ errorMessage:
551
+ type: string
552
+ description: 错误消息
553
+ metadata:
554
+ description: 元数据
555
+ allOf:
556
+ - $ref: '#/QueryMetadata'
557
+
558
+ BatchQueryItemRequest:
559
+ type: object
560
+ required: [queryVersionId]
561
+ description: 批量查询项(DataQueryBatchItemDto)
562
+ properties:
563
+ queryVersionId:
564
+ type: string
565
+ description: 查询版本 ID
566
+ params:
567
+ type: object
568
+ description: 查询参数
569
+ additionalProperties: true
799
570
 
800
571
  BatchQueryRequest:
801
572
  type: object
802
573
  required: [queries]
574
+ description: 批量查询请求(DataQueryBatchDto)
803
575
  properties:
804
576
  queries:
577
+ description: 查询列表
805
578
  type: array
806
579
  items:
807
- type: object
808
- required: [queryVersionId]
809
- properties:
810
- queryVersionId:
811
- type: string
812
- params:
813
- type: object
814
- alias:
815
- type: string
816
- description: 查询别名(用于结果映射)
817
- maxItems: 20
818
- description: 查询列表(最多 20 个)
819
- context:
820
- $ref: '#/QueryContext'
580
+ $ref: '#/BatchQueryItemRequest'
821
581
 
822
582
  BatchQueryResponse:
823
583
  type: object
824
- required: [success, data]
584
+ required: [results]
585
+ description: 批量查询响应(DataQueryBatchVo)
825
586
  properties:
826
- success:
827
- type: boolean
828
- data:
829
- type: object
830
- additionalProperties:
831
- type: object
832
- properties:
833
- success:
834
- type: boolean
835
- data:
836
- description: 查询结果
837
- error:
838
- type: object
839
- properties:
840
- code:
841
- type: string
842
- message:
843
- type: string
844
- description: 按 alias 或 queryVersionId 索引的结果
845
-
846
- # ============================================================================
847
- # 通用分页
848
- # ============================================================================
587
+ results:
588
+ description: 各查询结果列表
589
+ type: array
590
+ items:
591
+ $ref: '#/QueryDataResponse'
849
592
 
850
- # 与 types/src/common/api.ts PaginationMeta 严格一致
851
- PaginationMeta:
593
+ QueryDefinitionResponse:
852
594
  type: object
853
- required: [page, pageSize, total, totalPages, hasNext, hasPrev]
854
- description: 分页元数据(PaginationMeta
595
+ required: [uid, queryUid, versionNumber, spec, status]
596
+ description: 查询定义响应(DataQueryDefinitionVo
855
597
  properties:
856
- page:
857
- type: integer
858
- minimum: 1
859
- description: 当前页码
860
- pageSize:
861
- type: integer
862
- minimum: 1
863
- maximum: 100
864
- description: 每页数量
865
- total:
866
- type: integer
867
- minimum: 0
868
- description: 总记录数
869
- totalPages:
870
- type: integer
871
- minimum: 0
872
- description: 总页数
873
- hasNext:
874
- type: boolean
875
- description: 是否有下一页
876
- hasPrev:
877
- type: boolean
878
- description: 是否有上一页
879
-
880
- # ============================================================================
881
- # Tenant 租户相关
882
- # ============================================================================
883
-
884
- TenantInfo:
885
- type: object
886
- required: [appId, appName, status]
887
- properties:
888
- appId:
598
+ uid:
889
599
  type: string
890
- description: 应用 ID
891
- appName:
892
- type: string
893
- description: 应用名称
894
- status:
600
+ description: 版本 UID
601
+ example: 202401efgh87654321
602
+ queryUid:
895
603
  type: string
896
- enum: [active, suspended, disabled]
897
- description: 应用状态
898
- workspaceId:
899
- type: string
900
- description: 工作空间 ID
901
- cdnDomain:
902
- type: string
903
- format: uri
904
- description: CDN 域名
905
- apiDomain:
906
- type: string
907
- format: uri
908
- description: API 域名
909
-
910
- TenantConfig:
911
- type: object
912
- properties:
913
- features:
914
- type: object
915
- additionalProperties:
916
- type: boolean
917
- description: 功能开关
918
- theme:
604
+ description: 所属查询 UID
605
+ example: 202401abcd12345678
606
+ versionNumber:
607
+ type: number
608
+ description: 版本号(递增)
609
+ example: 1
610
+ versionLabel:
611
+ type: string
612
+ nullable: true
613
+ description: 版本标签(可选,如 v1.0.0)
614
+ example: v1.0.0
615
+ spec:
616
+ description: 规格快照(不可变的 DataQuerySpec)
919
617
  type: object
920
618
  additionalProperties: true
921
- description: 主题配置
922
- cdnDomain:
923
- type: string
924
- format: uri
925
- description: CDN 域名
926
- runtimeVersion:
619
+ status:
927
620
  type: string
928
- description: 推荐的 Runtime 版本
929
- blockedComponents:
930
- type: array
931
- items:
932
- type: object
933
- properties:
934
- componentType:
935
- type: string
936
- version:
937
- type: string
938
- reason:
939
- type: string
940
- description: 阻断的组件列表
941
- killSwitch:
942
- type: object
943
- properties:
944
- enabled:
945
- type: boolean
946
- pageIds:
947
- type: array
948
- items:
949
- type: string
950
- description: 被 Kill 的页面 ID 列表
951
- fallbackUrl:
952
- type: string
953
- format: uri
954
- description: Kill Switch 配置
621
+ description: 版本状态
622
+ enum: [draft, stable, deprecated, blocked]
623
+ example: stable
955
624
 
956
625
  # ============================================================================
957
- # Health 健康检查相关
626
+ # Activity 活动相关
958
627
  # ============================================================================
959
628
 
960
- HealthResponse:
629
+ ActivityInfoData:
961
630
  type: object
962
- required: [status, version]
631
+ required: [activityId, name, type, startAt, endAt]
632
+ description: 活动信息数据(ActivityInfoDataVo)
963
633
  properties:
964
- status:
634
+ activityId:
965
635
  type: string
966
- enum: [healthy, degraded, unhealthy]
967
- description: 服务状态
968
- version:
636
+ description: 活动 ID
637
+ name:
969
638
  type: string
970
- description: 服务版本
971
- uptime:
972
- type: integer
973
- description: 运行时间(秒)
974
- timestamp:
639
+ description: 活动名称
640
+ type:
641
+ type: string
642
+ description: 活动类型
643
+ startAt:
975
644
  type: string
645
+ description: 开始时间
646
+ format: date-time
647
+ endAt:
648
+ type: string
649
+ description: 结束时间
976
650
  format: date-time
977
- description: 检查时间
978
- dependencies:
979
- type: object
980
- additionalProperties:
981
- type: object
982
- properties:
983
- status:
984
- type: string
985
- enum: [healthy, degraded, unhealthy]
986
- latency:
987
- type: integer
988
- description: 延迟(毫秒)
989
- message:
990
- type: string
991
- description: 依赖服务状态
992
651
 
993
- # ============================================================================
994
- # Activity 用户活动相关
995
- # ============================================================================
652
+ ActivityInfoResponse:
653
+ type: object
654
+ required: [success, data]
655
+ description: 活动信息响应(ActivityInfoVo)
656
+ properties:
657
+ success:
658
+ type: boolean
659
+ description: 是否成功
660
+ data:
661
+ description: 活动数据
662
+ allOf:
663
+ - $ref: '#/ActivityInfoData'
996
664
 
997
- PublicActivityInfo:
665
+ ActivityStatus:
998
666
  type: object
999
- required: [id, name, type, status]
667
+ required: [activityUid, name, type, isInProgress, startAt, endAt]
668
+ description: 活动状态(ActivityStatusVo)
1000
669
  properties:
1001
- id:
670
+ activityUid:
1002
671
  type: string
1003
- description: 活动 ID
672
+ description: 活动 UID
1004
673
  name:
1005
674
  type: string
1006
675
  description: 活动名称
1007
676
  type:
1008
677
  type: string
1009
- enum: [claim, signin, lottery, reserve, task, vote, share, bind, custom]
1010
678
  description: 活动类型
1011
- status:
1012
- type: string
1013
- enum: [active, ended]
1014
- description: 活动状态
1015
- description:
1016
- type: string
1017
- description: 活动描述
1018
- startTime:
679
+ enum: [claim, signin]
680
+ isInProgress:
681
+ type: boolean
682
+ description: 是否进行中
683
+ startAt:
1019
684
  type: string
1020
- format: date-time
1021
685
  description: 开始时间
1022
- endTime:
686
+ endAt:
1023
687
  type: string
1024
- format: date-time
1025
688
  description: 结束时间
1026
- rules:
1027
- type: object
1028
- additionalProperties: true
1029
- description: 活动规则(公开部分)
1030
- rewards:
1031
- type: array
1032
- items:
1033
- type: object
1034
- properties:
1035
- name:
1036
- type: string
1037
- description:
1038
- type: string
1039
- icon:
1040
- type: string
1041
- description: 奖励列表
1042
689
 
1043
- UserActivityState:
690
+ ActivityStatusResponse:
1044
691
  type: object
1045
- required: [activityId, userId, activityType, canParticipate, typeState]
1046
- description: 用户活动状态(UserActivityState,根据 types/src/activity/index.ts)
692
+ description: 活动状态响应
1047
693
  properties:
1048
- activityId:
694
+ activityUid:
1049
695
  type: string
1050
- description: 活动 ID(UniqueId)
1051
- userId:
696
+ description: 活动 UID
697
+ name:
1052
698
  type: string
1053
- description: 用户 ID
1054
- activityType:
699
+ description: 活动名称
700
+ type:
1055
701
  type: string
1056
- enum: [claim, signin, lottery, reserve, task, vote, share, bind, custom]
1057
- description: 活动类型(ActivityType)
1058
- canParticipate:
702
+ description: 活动类型
703
+ enum: [claim, signin]
704
+ isInProgress:
1059
705
  type: boolean
1060
- description: 是否可参与
1061
- notParticipateReason:
706
+ description: 是否进行中
707
+ startAt:
1062
708
  type: string
1063
- description: 不可参与原因
1064
- remainingCount:
1065
- type: integer
1066
- description: 剩余参与次数
1067
- typeState:
1068
- type: object
1069
- description: 类型特定状态(ClaimState | SigninState | LotteryState)
1070
- oneOf:
1071
- - type: object
1072
- required: [type, claimed]
1073
- properties:
1074
- type:
1075
- type: string
1076
- enum: [claim]
1077
- claimed:
1078
- type: boolean
1079
- claimedAt:
1080
- type: string
1081
- format: date-time
1082
- claimedPrizeId:
1083
- type: string
1084
- availablePrizes:
1085
- type: array
1086
- items:
1087
- type: object
1088
- properties:
1089
- prizeId:
1090
- type: string
1091
- name:
1092
- type: string
1093
- stock:
1094
- type: integer
1095
- - type: object
1096
- required: [type, signedToday, consecutiveDays, totalDays, cycleRecords, makeupAvailable]
1097
- properties:
1098
- type:
1099
- type: string
1100
- enum: [signin]
1101
- signedToday:
1102
- type: boolean
1103
- todaySignedAt:
1104
- type: string
1105
- format: date-time
1106
- consecutiveDays:
1107
- type: integer
1108
- totalDays:
1109
- type: integer
1110
- cycleRecords:
1111
- type: array
1112
- items:
1113
- type: object
1114
- properties:
1115
- dayKey:
1116
- type: string
1117
- signed:
1118
- type: boolean
1119
- isMakeup:
1120
- type: boolean
1121
- makeupAvailable:
1122
- type: integer
1123
- nextReward:
1124
- type: object
1125
- properties:
1126
- type:
1127
- type: string
1128
- enum: [consecutive, cumulative]
1129
- daysNeeded:
1130
- type: integer
1131
- reward:
1132
- type: object
1133
- additionalProperties: true
1134
- - type: object
1135
- required: [type, freeDrawsRemaining, todayDrawCount, totalDrawCount]
1136
- properties:
1137
- type:
1138
- type: string
1139
- enum: [lottery]
1140
- freeDrawsRemaining:
1141
- type: integer
1142
- todayDrawCount:
1143
- type: integer
1144
- totalDrawCount:
1145
- type: integer
1146
- pityProgress:
1147
- type: object
1148
- properties:
1149
- current:
1150
- type: integer
1151
- target:
1152
- type: integer
1153
- resources:
1154
- type: array
1155
- items:
1156
- type: object
1157
- properties:
1158
- type:
1159
- type: string
1160
- amount:
1161
- type: integer
709
+ description: 开始时间
710
+ endAt:
711
+ type: string
712
+ description: 结束时间
1162
713
 
1163
- SigninCalendar:
714
+ SigninCalendarData:
1164
715
  type: object
1165
- required: [year, month, records]
716
+ required: [activityId, month, signedDates, consecutiveDays, totalDays]
717
+ description: 签到日历数据(SigninCalendarDataVo)
1166
718
  properties:
1167
- year:
1168
- type: integer
1169
- description: 年份
719
+ activityId:
720
+ type: string
721
+ description: 活动 ID
1170
722
  month:
1171
- type: integer
1172
- minimum: 1
1173
- maximum: 12
1174
- description: 月份
1175
- records:
723
+ type: string
724
+ description: 月份(YYYY-MM)
725
+ example: '2024-01'
726
+ signedDates:
727
+ description: 已签到日期列表
728
+ example: ['2024-01-01', '2024-01-02']
1176
729
  type: array
1177
730
  items:
1178
- type: object
1179
- properties:
1180
- day:
1181
- type: integer
1182
- minimum: 1
1183
- maximum: 31
1184
- signedIn:
1185
- type: boolean
1186
- reward:
1187
- type: object
1188
- properties:
1189
- name:
1190
- type: string
1191
- amount:
1192
- type: number
1193
- description: 签到记录
731
+ type: string
1194
732
  consecutiveDays:
1195
- type: integer
733
+ type: number
1196
734
  description: 连续签到天数
1197
735
  totalDays:
1198
- type: integer
1199
- description: 本月签到总天数
736
+ type: number
737
+ description: 累计签到天数
1200
738
 
1201
- ClaimRecordInfo:
739
+ SigninCalendarResponse:
1202
740
  type: object
1203
- required: [id, rewardType, status, createdAt]
741
+ required: [success, data]
742
+ description: 签到日历响应(SigninCalendarVo)
1204
743
  properties:
1205
- id:
1206
- type: string
1207
- description: 记录 ID
1208
- activityId:
1209
- type: string
1210
- description: 活动 ID
1211
- rewardType:
744
+ success:
745
+ type: boolean
746
+ description: 是否成功
747
+ data:
748
+ description: 日历数据
749
+ allOf:
750
+ - $ref: '#/SigninCalendarData'
751
+
752
+ PaginatedRecordsResponse:
753
+ type: object
754
+ required: [success, data]
755
+ description: 分页记录响应(PaginatedRecordsVo)
756
+ properties:
757
+ success:
758
+ type: boolean
759
+ description: 是否成功
760
+ data:
761
+ type: array
762
+ description: 记录列表
763
+ items:
764
+ type: object
765
+ meta:
766
+ description: 分页元数据
767
+ allOf:
768
+ - $ref: '#/CursorPaginationMeta'
769
+
770
+ RewardInfo:
771
+ type: object
772
+ required: [type, value, description]
773
+ description: 奖励信息(RewardInfoVo)
774
+ properties:
775
+ type:
1212
776
  type: string
1213
777
  description: 奖励类型
1214
- rewardName:
1215
- type: string
1216
- description: 奖励名称
1217
- rewardValue:
778
+ value:
1218
779
  type: number
1219
780
  description: 奖励值
1220
- status:
781
+ description:
1221
782
  type: string
1222
- enum: [pending, claimed, expired]
1223
- description: 领取状态
1224
- createdAt:
783
+ description: 奖励描述
784
+
785
+ MilestoneInfo:
786
+ type: object
787
+ required: [days, reward]
788
+ description: 里程碑信息(MilestoneInfoVo)
789
+ properties:
790
+ days:
791
+ type: number
792
+ description: 目标天数
793
+ reward:
794
+ description: 里程碑奖励
795
+ allOf:
796
+ - $ref: '#/RewardInfo'
797
+
798
+ ClaimStatusResponse:
799
+ type: object
800
+ required: [activityUid, hasClaimed, remainingCount, totalCount]
801
+ description: 领取状态响应(ClaimStatusVo)
802
+ properties:
803
+ activityUid:
1225
804
  type: string
1226
- format: date-time
1227
- description: 创建时间
805
+ description: 活动 UID
806
+ hasClaimed:
807
+ type: boolean
808
+ description: 是否已领取
1228
809
  claimedAt:
1229
810
  type: string
1230
- format: date-time
1231
811
  description: 领取时间
1232
- expiresAt:
1233
- type: string
1234
- format: date-time
1235
- description: 过期时间
812
+ remainingCount:
813
+ type: number
814
+ description: 剩余领取次数
815
+ totalCount:
816
+ type: number
817
+ description: 总领取次数
1236
818
 
1237
- LotteryRecordInfo:
819
+ SigninStatusResponse:
1238
820
  type: object
1239
- required: [id, prizeId, status, createdAt]
821
+ required: [activityUid, hasSignedToday, consecutiveDays, totalDays, signedDates]
822
+ description: 签到状态响应(SigninStatusVo)
1240
823
  properties:
1241
- id:
1242
- type: string
1243
- description: 记录 ID
1244
- activityId:
1245
- type: string
1246
- description: 活动 ID
1247
- prizeId:
1248
- type: string
1249
- description: 奖品 ID
1250
- prizeName:
1251
- type: string
1252
- description: 奖品名称
1253
- prizeType:
824
+ activityUid:
1254
825
  type: string
1255
- enum: [physical, virtual, coupon, points, none]
1256
- description: 奖品类型
1257
- status:
1258
- type: string
1259
- enum: [won, notWon, claimed, shipped]
1260
- description: 状态
1261
- createdAt:
1262
- type: string
1263
- format: date-time
1264
- description: 抽奖时间
1265
- claimedAt:
1266
- type: string
1267
- format: date-time
1268
- description: 领取时间
826
+ description: 活动 UID
827
+ hasSignedToday:
828
+ type: boolean
829
+ description: 今日是否已签到
830
+ consecutiveDays:
831
+ type: number
832
+ description: 连续签到天数
833
+ totalDays:
834
+ type: number
835
+ description: 累计签到天数
836
+ signedDates:
837
+ description: 签到日期列表
838
+ type: array
839
+ items:
840
+ type: string
841
+ todayReward:
842
+ description: 今日奖励
843
+ allOf:
844
+ - $ref: '#/RewardInfo'
845
+ nextMilestone:
846
+ description: 下一个里程碑
847
+ allOf:
848
+ - $ref: '#/MilestoneInfo'
1269
849
 
1270
850
  # ============================================================================
1271
851
  # Track 埋点相关
1272
852
  # ============================================================================
1273
853
 
1274
- TrackRequest:
854
+ TrackEvent:
1275
855
  type: object
1276
- required: [eventName]
856
+ required: [eventType, eventName]
857
+ description: 埋点事件(TrackEventDto)
1277
858
  properties:
1278
- eventName:
1279
- type: string
1280
- minLength: 1
1281
- maxLength: 255
1282
- description: 事件名称
1283
859
  eventType:
1284
860
  type: string
1285
- enum: [page_view, click, exposure, custom]
1286
- default: custom
1287
861
  description: 事件类型
862
+ eventName:
863
+ type: string
864
+ description: 事件名称
1288
865
  properties:
1289
866
  type: object
1290
- additionalProperties: true
1291
867
  description: 事件属性
1292
868
  timestamp:
869
+ type: number
870
+ description: 事件时间戳(毫秒)
871
+
872
+ TrackContext:
873
+ type: object
874
+ description: 埋点上下文(TrackContextDto)
875
+ properties:
876
+ uid:
1293
877
  type: string
1294
- format: date-time
1295
- description: 事件时间(默认为服务器接收时间)
878
+ description: 用户 UID
879
+ pageVersionId:
880
+ type: string
881
+ description: 页面版本 ID
882
+ componentVersionId:
883
+ type: string
884
+ description: 组件版本 ID
885
+ deviceId:
886
+ type: string
887
+ description: 设备 ID
888
+ sessionId:
889
+ type: string
890
+ description: 会话 ID
891
+ appId:
892
+ type: string
893
+ description: 应用 ID
894
+
895
+ TrackSingleRequest:
896
+ type: object
897
+ required: [event]
898
+ description: 单个埋点请求(TrackSingleDto)
899
+ properties:
900
+ event:
901
+ description: 事件
902
+ allOf:
903
+ - $ref: '#/TrackEvent'
1296
904
  context:
905
+ description: 上下文
906
+ allOf:
907
+ - $ref: '#/TrackContext'
908
+
909
+ TrackSingleResponse:
910
+ type: object
911
+ required: [success, data]
912
+ description: 单个埋点响应(TrackSingleResponseVo)
913
+ properties:
914
+ success:
915
+ type: boolean
916
+ description: 是否成功
917
+ data:
1297
918
  type: object
919
+ required: [eventId]
1298
920
  properties:
1299
- pageVersionId:
1300
- type: string
1301
- componentVersionId:
921
+ eventId:
1302
922
  type: string
1303
- sessionId:
1304
- type: string
1305
- deviceType:
1306
- type: string
1307
- traceId:
1308
- type: string
1309
- description: 上下文信息
923
+ description: 事件 ID
1310
924
 
1311
925
  TrackBatchRequest:
1312
926
  type: object
1313
927
  required: [events]
928
+ description: 批量埋点请求(TrackBatchDto)
1314
929
  properties:
1315
930
  events:
931
+ description: 事件列表
1316
932
  type: array
1317
933
  items:
1318
- $ref: '#/TrackRequest'
1319
- maxItems: 100
1320
- description: 事件列表(最多 100 个)
934
+ $ref: '#/TrackEvent'
935
+ context:
936
+ description: 上下文
937
+ allOf:
938
+ - $ref: '#/TrackContext'
939
+
940
+ TrackBatchError:
941
+ type: object
942
+ required: [index, reason]
943
+ description: 批量埋点错误(TrackBatchErrorVo)
944
+ properties:
945
+ index:
946
+ type: number
947
+ description: 错误索引
948
+ reason:
949
+ type: string
950
+ description: 错误原因
951
+
952
+ TrackBatchResponse:
953
+ type: object
954
+ required: [success, data]
955
+ description: 批量埋点响应(TrackBatchResponseVo)
956
+ properties:
957
+ success:
958
+ type: boolean
959
+ description: 是否成功
960
+ data:
961
+ type: object
962
+ required: [accepted, rejected, errors]
963
+ properties:
964
+ accepted:
965
+ type: number
966
+ description: 接受的事件数量
967
+ rejected:
968
+ type: number
969
+ description: 拒绝的事件数量
970
+ errors:
971
+ description: 错误列表
972
+ type: array
973
+ items:
974
+ $ref: '#/TrackBatchError'
975
+
976
+ # ============================================================================
977
+ # Tenant 租户相关
978
+ # ============================================================================
979
+
980
+ ResolveTenantRequest:
981
+ type: object
982
+ description: 租户解析请求(TenantResolveDto)
983
+ properties:
984
+ appKey:
985
+ type: string
986
+ description: 应用 Key
987
+ host:
988
+ type: string
989
+ description: 主机/域名
990
+ channel:
991
+ type: string
992
+ description: 渠道
993
+
994
+ ResolveTenantData:
995
+ type: object
996
+ required: [appId, name, status, type]
997
+ description: 租户解析数据(TenantResolveDataVo)
998
+ properties:
999
+ appId:
1000
+ type: string
1001
+ description: 应用 ID
1002
+ name:
1003
+ type: string
1004
+ description: 租户名称
1005
+ status:
1006
+ type: string
1007
+ description: 租户状态
1008
+ example: active
1009
+ type:
1010
+ type: string
1011
+ description: 租户类型
1012
+ example: standard
1013
+ logo:
1014
+ type: string
1015
+ description: 租户 Logo URL
1016
+ config:
1017
+ type: object
1018
+ description: 租户配置
1019
+ additionalProperties: true
1020
+ channel:
1021
+ type: string
1022
+ description: 渠道
1023
+ domain:
1024
+ type: string
1025
+ description: 自定义域名
1026
+
1027
+ ResolveTenantResponse:
1028
+ type: object
1029
+ required: [success, data]
1030
+ description: 租户解析响应(TenantResolveVo)
1031
+ properties:
1032
+ success:
1033
+ type: boolean
1034
+ description: 是否成功
1035
+ data:
1036
+ description: 租户数据
1037
+ allOf:
1038
+ - $ref: '#/ResolveTenantData'
1039
+
1040
+ TenantConfigData:
1041
+ type: object
1042
+ required: [appId, status]
1043
+ description: 租户配置数据(TenantConfigDataVo)
1044
+ properties:
1045
+ appId:
1046
+ type: string
1047
+ description: 应用 ID
1048
+ status:
1049
+ type: string
1050
+ description: 租户状态
1051
+ example: active
1052
+ featureFlags:
1053
+ type: object
1054
+ description: 功能开关
1055
+ additionalProperties:
1056
+ type: boolean
1057
+ theme:
1058
+ type: object
1059
+ description: 主题配置
1060
+ additionalProperties: true
1061
+ cdnBase:
1062
+ type: string
1063
+ description: CDN 基地址
1064
+ blockedComponents:
1065
+ description: 阻断组件列表
1066
+ type: array
1067
+ items:
1068
+ type: string
1069
+ killSwitch:
1070
+ type: boolean
1071
+ description: 全局 killSwitch
1072
+
1073
+ TenantConfigResponse:
1074
+ type: object
1075
+ required: [success, data]
1076
+ description: 租户配置响应(TenantConfigVo)
1077
+ properties:
1078
+ success:
1079
+ type: boolean
1080
+ description: 是否成功
1081
+ data:
1082
+ description: 配置数据
1083
+ allOf:
1084
+ - $ref: '#/TenantConfigData'
1085
+
1086
+ # ============================================================================
1087
+ # Health 健康检查相关
1088
+ # ============================================================================
1089
+
1090
+ HealthCheckResponse:
1091
+ type: object
1092
+ required: [status, timestamp]
1093
+ description: 健康检查响应(HealthCheckVo)
1094
+ properties:
1095
+ status:
1096
+ type: string
1097
+ description: 服务状态
1098
+ example: healthy
1099
+ timestamp:
1100
+ type: string
1101
+ description: 响应时间戳
1102
+ example: '2026-02-04T12:00:00.000Z'
1103
+
1104
+ LivenessResponse:
1105
+ type: object
1106
+ required: [status]
1107
+ description: 存活检查响应(LivenessVo)
1108
+ properties:
1109
+ status:
1110
+ type: string
1111
+ description: 服务状态
1112
+ example: alive
1113
+
1114
+ HealthCheckItem:
1115
+ type: object
1116
+ description: 健康检查项
1117
+ properties:
1118
+ status:
1119
+ type: string
1120
+ description: 检查状态
1121
+ message:
1122
+ type: string
1123
+ description: 检查消息
1124
+
1125
+ ReadinessResponse:
1126
+ type: object
1127
+ required: [status, checks]
1128
+ description: 就绪检查响应(ReadinessVo)
1129
+ properties:
1130
+ status:
1131
+ type: string
1132
+ description: 服务状态
1133
+ example: ready
1134
+ checks:
1135
+ type: object
1136
+ description: 各检查项状态
1137
+ additionalProperties:
1138
+ $ref: '#/HealthCheckItem'
1139
+ example:
1140
+ database:
1141
+ status: healthy
1142
+ message: Connection OK
1143
+ redis:
1144
+ status: healthy
1145
+ message: Connection OK