@djvlc/openapi-user-client 1.5.0 → 1.6.0

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.
@@ -0,0 +1,1299 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: DJVLC User API
4
+ version: 1.0.0
5
+ description: |
6
+ DJVLC 低代码平台用户端 API
7
+
8
+ 提供以下功能:
9
+ - 页面获取(解析页面 Schema)
10
+ - 动作执行(调用业务逻辑)
11
+ - 数据查询(获取数据源)
12
+ contact:
13
+ name: DJVLC Team
14
+ email: dev@djvlc.com
15
+ license:
16
+ name: MIT
17
+ url: https://opensource.org/licenses/MIT
18
+ servers:
19
+ - url: /api/user
20
+ description: 用户端 API
21
+ security:
22
+ - BearerAuth: []
23
+ - ApiKey: []
24
+ tags:
25
+ - name: Pages
26
+ description: 页面获取
27
+ - name: Actions
28
+ description: 动作执行
29
+ - name: Queries
30
+ description: 数据查询
31
+ - name: Activities
32
+ description: 活动状态
33
+ - name: Track
34
+ description: 埋点上报
35
+ paths:
36
+ /pages/{pageId}:
37
+ get:
38
+ tags:
39
+ - Pages
40
+ operationId: getPage
41
+ summary: 获取页面
42
+ description: 获取指定页面的基本信息和元数据
43
+ parameters:
44
+ - name: pageId
45
+ in: path
46
+ required: true
47
+ schema:
48
+ type: string
49
+ description: 页面 ID
50
+ - name: version
51
+ in: query
52
+ schema:
53
+ type: string
54
+ description: 指定版本号(可选,默认最新版本)
55
+ responses:
56
+ '200':
57
+ description: 成功
58
+ content:
59
+ application/json:
60
+ schema:
61
+ type: object
62
+ required: &ref_12
63
+ - data
64
+ properties: &ref_13
65
+ data:
66
+ type: object
67
+ required:
68
+ - pageId
69
+ - version
70
+ - meta
71
+ properties:
72
+ pageId:
73
+ type: string
74
+ description: 页面 ID
75
+ version:
76
+ type: string
77
+ description: 页面版本
78
+ meta:
79
+ type: object
80
+ properties:
81
+ title:
82
+ type: string
83
+ description: 页面标题
84
+ description:
85
+ type: string
86
+ description: 页面描述
87
+ integrity:
88
+ type: string
89
+ description: 完整性哈希
90
+ '404':
91
+ description: 资源不存在
92
+ content: &ref_2
93
+ application/json:
94
+ schema:
95
+ type: object
96
+ required: &ref_0
97
+ - code
98
+ - message
99
+ properties: &ref_1
100
+ code:
101
+ type: string
102
+ description: 错误码
103
+ message:
104
+ type: string
105
+ description: 错误消息
106
+ details:
107
+ type: array
108
+ items:
109
+ type: object
110
+ properties:
111
+ field:
112
+ type: string
113
+ message:
114
+ type: string
115
+ description: 错误详情
116
+ example:
117
+ code: NOT_FOUND
118
+ message: 资源不存在
119
+ '503':
120
+ description: 服务不可用
121
+ content: &ref_3
122
+ application/json:
123
+ schema:
124
+ type: object
125
+ required: *ref_0
126
+ properties: *ref_1
127
+ example:
128
+ code: SERVICE_UNAVAILABLE
129
+ message: 页面暂时不可用
130
+ /pages/{pageId}/resolve:
131
+ post:
132
+ tags:
133
+ - Pages
134
+ operationId: resolvePage
135
+ summary: 解析页面
136
+ description: |
137
+ 解析页面 Schema,返回完整的渲染数据。
138
+
139
+ 包括:
140
+ - 解析后的页面 Schema
141
+ - 组件资源清单
142
+ - 预取的数据查询结果
143
+ - 动作资源清单
144
+ parameters:
145
+ - name: pageId
146
+ in: path
147
+ required: true
148
+ schema:
149
+ type: string
150
+ description: 页面 ID
151
+ requestBody:
152
+ required: true
153
+ content:
154
+ application/json:
155
+ schema:
156
+ type: object
157
+ properties: &ref_14
158
+ context:
159
+ type: object
160
+ description: 页面解析上下文
161
+ properties: &ref_5
162
+ userId:
163
+ type: string
164
+ description: 用户 ID
165
+ sessionId:
166
+ type: string
167
+ description: 会话 ID
168
+ deviceType:
169
+ type: string
170
+ enum:
171
+ - mobile
172
+ - tablet
173
+ - desktop
174
+ description: 设备类型
175
+ urlParams:
176
+ type: object
177
+ additionalProperties:
178
+ type: string
179
+ description: URL 参数
180
+ routeParams:
181
+ type: object
182
+ additionalProperties:
183
+ type: string
184
+ description: 路由参数
185
+ customData:
186
+ type: object
187
+ additionalProperties: true
188
+ description: 自定义上下文数据
189
+ options:
190
+ type: object
191
+ properties:
192
+ prefetchData:
193
+ type: boolean
194
+ default: true
195
+ description: 是否预取数据
196
+ includeManifests:
197
+ type: boolean
198
+ default: true
199
+ description: 是否包含资源清单
200
+ locale:
201
+ type: string
202
+ description: 语言环境
203
+ responses:
204
+ '200':
205
+ description: 成功
206
+ content:
207
+ application/json:
208
+ schema:
209
+ type: object
210
+ required: &ref_22
211
+ - data
212
+ properties: &ref_23
213
+ data:
214
+ type: object
215
+ required:
216
+ - pageId
217
+ - version
218
+ - schema
219
+ properties:
220
+ pageId:
221
+ type: string
222
+ description: 页面 ID
223
+ version:
224
+ type: string
225
+ description: 页面版本
226
+ schema:
227
+ type: object
228
+ description: 解析后的页面 Schema
229
+ manifests:
230
+ type: object
231
+ properties: &ref_21
232
+ components:
233
+ type: array
234
+ items:
235
+ type: object
236
+ required: &ref_15
237
+ - componentType
238
+ - version
239
+ - entryUrl
240
+ properties: &ref_16
241
+ componentType:
242
+ type: string
243
+ description: 组件类型
244
+ version:
245
+ type: string
246
+ description: 组件版本
247
+ entryUrl:
248
+ type: string
249
+ format: uri
250
+ description: 组件入口 URL
251
+ integrity:
252
+ type: string
253
+ description: 完整性哈希
254
+ description: 组件资源清单
255
+ actions:
256
+ type: array
257
+ items:
258
+ type: object
259
+ required: &ref_17
260
+ - actionId
261
+ - version
262
+ properties: &ref_18
263
+ actionId:
264
+ type: string
265
+ description: 动作 ID
266
+ version:
267
+ type: string
268
+ description: 动作版本
269
+ type:
270
+ type: string
271
+ enum:
272
+ - builtin
273
+ - custom
274
+ description: 动作类型
275
+ description: 动作资源清单
276
+ queries:
277
+ type: array
278
+ items:
279
+ type: object
280
+ required: &ref_19
281
+ - queryId
282
+ - version
283
+ properties: &ref_20
284
+ queryId:
285
+ type: string
286
+ description: 查询 ID
287
+ version:
288
+ type: string
289
+ description: 查询版本
290
+ cacheTtl:
291
+ type: integer
292
+ description: 缓存 TTL(秒)
293
+ description: 查询资源清单
294
+ prefetchedData:
295
+ type: object
296
+ additionalProperties: true
297
+ description: 预取的数据
298
+ '400':
299
+ description: 请求参数错误
300
+ content: &ref_4
301
+ application/json:
302
+ schema:
303
+ type: object
304
+ required: *ref_0
305
+ properties: *ref_1
306
+ example:
307
+ code: BAD_REQUEST
308
+ message: 请求参数无效
309
+ '404':
310
+ description: 资源不存在
311
+ content: *ref_2
312
+ '503':
313
+ description: 服务不可用
314
+ content: *ref_3
315
+ /actions/{actionId}/execute:
316
+ post:
317
+ tags:
318
+ - Actions
319
+ operationId: executeAction
320
+ summary: 执行动作
321
+ description: |
322
+ 执行指定的动作,返回执行结果。
323
+
324
+ 支持:
325
+ - 自定义动作(通过 actionDefinitionVersionId)
326
+ - 内置动作(setState, navigate, etc.)
327
+ parameters:
328
+ - name: actionId
329
+ in: path
330
+ required: true
331
+ schema:
332
+ type: string
333
+ description: 动作 ID 或动作定义版本 ID
334
+ requestBody:
335
+ required: true
336
+ content:
337
+ application/json:
338
+ schema:
339
+ type: object
340
+ required: &ref_25
341
+ - params
342
+ properties: &ref_26
343
+ params:
344
+ type: object
345
+ additionalProperties: true
346
+ description: 动作参数
347
+ context:
348
+ type: object
349
+ description: 动作执行上下文
350
+ properties: &ref_24
351
+ pageId:
352
+ type: string
353
+ description: 页面 ID
354
+ componentId:
355
+ type: string
356
+ description: 触发组件 ID
357
+ eventName:
358
+ type: string
359
+ description: 触发事件名
360
+ state:
361
+ type: object
362
+ additionalProperties: true
363
+ description: 当前页面状态
364
+ options:
365
+ type: object
366
+ properties:
367
+ timeout:
368
+ type: integer
369
+ minimum: 1000
370
+ maximum: 30000
371
+ default: 10000
372
+ description: 执行超时(毫秒)
373
+ idempotencyKey:
374
+ type: string
375
+ description: 幂等键
376
+ responses:
377
+ '200':
378
+ description: 执行成功
379
+ content:
380
+ application/json:
381
+ schema:
382
+ type: object
383
+ required: &ref_29
384
+ - data
385
+ properties: &ref_30
386
+ data:
387
+ type: object
388
+ properties:
389
+ success:
390
+ type: boolean
391
+ description: 是否成功
392
+ result:
393
+ description: 执行结果
394
+ effects:
395
+ type: array
396
+ items:
397
+ type: object
398
+ required: &ref_27
399
+ - type
400
+ properties: &ref_28
401
+ type:
402
+ type: string
403
+ enum:
404
+ - setState
405
+ - navigate
406
+ - showToast
407
+ - refreshData
408
+ - custom
409
+ description: 副作用类型
410
+ payload:
411
+ type: object
412
+ additionalProperties: true
413
+ description: 副作用参数
414
+ description: 副作用列表
415
+ '400':
416
+ description: 请求参数错误
417
+ content: *ref_4
418
+ '404':
419
+ description: 资源不存在
420
+ content: *ref_2
421
+ '422':
422
+ description: 请求无法处理
423
+ content: &ref_6
424
+ application/json:
425
+ schema:
426
+ type: object
427
+ required: *ref_0
428
+ properties: *ref_1
429
+ example:
430
+ code: UNPROCESSABLE_ENTITY
431
+ message: 参数验证失败
432
+ '500':
433
+ description: 服务器内部错误
434
+ content: &ref_7
435
+ application/json:
436
+ schema:
437
+ type: object
438
+ required: *ref_0
439
+ properties: *ref_1
440
+ example:
441
+ code: INTERNAL_ERROR
442
+ message: 服务器内部错误
443
+ /actions/{actionId}/validate:
444
+ post:
445
+ tags:
446
+ - Actions
447
+ operationId: validateActionParams
448
+ summary: 验证动作参数
449
+ description: 验证动作参数是否符合 Schema 定义(不执行动作)
450
+ parameters:
451
+ - name: actionId
452
+ in: path
453
+ required: true
454
+ schema:
455
+ type: string
456
+ description: 动作 ID 或动作定义版本 ID
457
+ requestBody:
458
+ required: true
459
+ content:
460
+ application/json:
461
+ schema:
462
+ type: object
463
+ required: &ref_31
464
+ - params
465
+ properties: &ref_32
466
+ params:
467
+ type: object
468
+ additionalProperties: true
469
+ description: 待验证的参数
470
+ responses:
471
+ '200':
472
+ description: 验证结果
473
+ content:
474
+ application/json:
475
+ schema:
476
+ type: object
477
+ required: &ref_33
478
+ - data
479
+ properties: &ref_34
480
+ data:
481
+ type: object
482
+ required:
483
+ - valid
484
+ properties:
485
+ valid:
486
+ type: boolean
487
+ description: 是否有效
488
+ errors:
489
+ type: array
490
+ items:
491
+ type: object
492
+ properties:
493
+ path:
494
+ type: string
495
+ description: 参数路径
496
+ message:
497
+ type: string
498
+ description: 错误消息
499
+ description: 验证错误
500
+ '404':
501
+ description: 资源不存在
502
+ content: *ref_2
503
+ /queries/{queryId}/execute:
504
+ post:
505
+ tags:
506
+ - Queries
507
+ operationId: executeQuery
508
+ summary: 执行数据查询
509
+ description: |
510
+ 执行指定的数据查询,返回查询结果。
511
+
512
+ 支持:
513
+ - 参数化查询
514
+ - 结果缓存
515
+ - 分页
516
+ parameters:
517
+ - name: queryId
518
+ in: path
519
+ required: true
520
+ schema:
521
+ type: string
522
+ description: 查询 ID 或查询定义版本 ID
523
+ requestBody:
524
+ required: true
525
+ content:
526
+ application/json:
527
+ schema:
528
+ type: object
529
+ properties: &ref_35
530
+ params:
531
+ type: object
532
+ additionalProperties: true
533
+ description: 查询参数
534
+ context:
535
+ type: object
536
+ description: 页面解析上下文
537
+ properties: *ref_5
538
+ options:
539
+ type: object
540
+ properties:
541
+ timeout:
542
+ type: integer
543
+ minimum: 1000
544
+ maximum: 60000
545
+ default: 30000
546
+ description: 查询超时(毫秒)
547
+ cache:
548
+ type: boolean
549
+ default: true
550
+ description: 是否使用缓存
551
+ cacheKey:
552
+ type: string
553
+ description: 自定义缓存键
554
+ responses:
555
+ '200':
556
+ description: 查询成功
557
+ content:
558
+ application/json:
559
+ schema:
560
+ type: object
561
+ required: &ref_36
562
+ - data
563
+ properties: &ref_37
564
+ data:
565
+ description: 查询结果数据
566
+ meta:
567
+ type: object
568
+ properties:
569
+ cached:
570
+ type: boolean
571
+ description: 是否来自缓存
572
+ cachedAt:
573
+ type: string
574
+ format: date-time
575
+ description: 缓存时间
576
+ executionTime:
577
+ type: integer
578
+ description: 执行时间(毫秒)
579
+ pagination:
580
+ type: object
581
+ properties:
582
+ page:
583
+ type: integer
584
+ limit:
585
+ type: integer
586
+ total:
587
+ type: integer
588
+ hasMore:
589
+ type: boolean
590
+ '400':
591
+ description: 请求参数错误
592
+ content: *ref_4
593
+ '404':
594
+ description: 资源不存在
595
+ content: *ref_2
596
+ '422':
597
+ description: 请求无法处理
598
+ content: *ref_6
599
+ '500':
600
+ description: 服务器内部错误
601
+ content: *ref_7
602
+ '504':
603
+ description: 网关超时
604
+ content: &ref_50
605
+ application/json:
606
+ schema:
607
+ type: object
608
+ required: *ref_0
609
+ properties: *ref_1
610
+ example:
611
+ code: GATEWAY_TIMEOUT
612
+ message: 查询超时
613
+ /activities/{activityId}:
614
+ get:
615
+ tags:
616
+ - Activities
617
+ summary: 获取活动信息(公开)
618
+ operationId: getActivityInfo
619
+ description: |
620
+ 获取活动的公开信息,不需要登录。
621
+
622
+ 返回内容包括:
623
+ - 活动基本信息
624
+ - 时间范围
625
+ - 奖品列表(脱敏)
626
+ parameters:
627
+ - name: activityId
628
+ in: path
629
+ required: true
630
+ schema:
631
+ type: string
632
+ responses:
633
+ '200':
634
+ description: 成功
635
+ content:
636
+ application/json:
637
+ schema:
638
+ type: object
639
+ properties:
640
+ success:
641
+ type: boolean
642
+ data:
643
+ type: object
644
+ required: &ref_38
645
+ - id
646
+ - name
647
+ - type
648
+ - status
649
+ properties: &ref_39
650
+ id:
651
+ type: string
652
+ description: 活动 ID
653
+ name:
654
+ type: string
655
+ description: 活动名称
656
+ type:
657
+ type: string
658
+ enum:
659
+ - signin
660
+ - lottery
661
+ - redpack
662
+ - coupon
663
+ - custom
664
+ description: 活动类型
665
+ status:
666
+ type: string
667
+ enum:
668
+ - active
669
+ - ended
670
+ description: 活动状态
671
+ description:
672
+ type: string
673
+ description: 活动描述
674
+ startTime:
675
+ type: string
676
+ format: date-time
677
+ description: 开始时间
678
+ endTime:
679
+ type: string
680
+ format: date-time
681
+ description: 结束时间
682
+ rules:
683
+ type: object
684
+ additionalProperties: true
685
+ description: 活动规则(公开部分)
686
+ rewards:
687
+ type: array
688
+ items:
689
+ type: object
690
+ properties:
691
+ name:
692
+ type: string
693
+ description:
694
+ type: string
695
+ icon:
696
+ type: string
697
+ description: 奖励列表
698
+ '404':
699
+ description: 资源不存在
700
+ content: *ref_2
701
+ security: []
702
+ /activities/{activityId}/state:
703
+ get:
704
+ tags:
705
+ - Activities
706
+ summary: 获取用户活动状态
707
+ operationId: getActivityState
708
+ description: |
709
+ 查询用户在指定活动中的参与状态。
710
+
711
+ 返回内容包括:
712
+ - 是否可参与
713
+ - 剩余次数
714
+ - 类型特定状态(领取/签到/抽奖等)
715
+ parameters:
716
+ - name: activityId
717
+ in: path
718
+ required: true
719
+ schema:
720
+ type: string
721
+ responses:
722
+ '200':
723
+ description: 成功
724
+ content:
725
+ application/json:
726
+ schema:
727
+ type: object
728
+ properties:
729
+ success:
730
+ type: boolean
731
+ data:
732
+ type: object
733
+ required: &ref_40
734
+ - activityId
735
+ - userId
736
+ properties: &ref_41
737
+ activityId:
738
+ type: string
739
+ description: 活动 ID
740
+ userId:
741
+ type: string
742
+ description: 用户 ID
743
+ participated:
744
+ type: boolean
745
+ description: 是否已参与
746
+ participatedAt:
747
+ type: string
748
+ format: date-time
749
+ description: 参与时间
750
+ remainingChances:
751
+ type: integer
752
+ description: 剩余抽奖次数
753
+ totalRewards:
754
+ type: integer
755
+ description: 已获得奖励数
756
+ progress:
757
+ type: object
758
+ additionalProperties: true
759
+ description: 活动进度
760
+ customData:
761
+ type: object
762
+ additionalProperties: true
763
+ description: 自定义数据
764
+ '404':
765
+ description: 资源不存在
766
+ content: *ref_2
767
+ security:
768
+ - BearerAuth: []
769
+ /activities/{activityId}/signin/calendar:
770
+ get:
771
+ tags:
772
+ - Activities
773
+ summary: 获取签到日历
774
+ operationId: getSigninCalendar
775
+ description: |
776
+ 获取用户的签到日历数据。
777
+
778
+ 返回内容包括:
779
+ - 当前周期的签到记录
780
+ - 连续签到天数
781
+ - 累计签到天数
782
+ - 奖励进度
783
+ parameters:
784
+ - name: activityId
785
+ in: path
786
+ required: true
787
+ schema:
788
+ type: string
789
+ - name: month
790
+ in: query
791
+ description: 月份(YYYY-MM),默认当前月
792
+ schema:
793
+ type: string
794
+ pattern: ^\d{4}-\d{2}$
795
+ responses:
796
+ '200':
797
+ description: 成功
798
+ content:
799
+ application/json:
800
+ schema:
801
+ type: object
802
+ properties:
803
+ success:
804
+ type: boolean
805
+ data:
806
+ type: object
807
+ required: &ref_42
808
+ - year
809
+ - month
810
+ - records
811
+ properties: &ref_43
812
+ year:
813
+ type: integer
814
+ description: 年份
815
+ month:
816
+ type: integer
817
+ minimum: 1
818
+ maximum: 12
819
+ description: 月份
820
+ records:
821
+ type: array
822
+ items:
823
+ type: object
824
+ properties:
825
+ day:
826
+ type: integer
827
+ minimum: 1
828
+ maximum: 31
829
+ signedIn:
830
+ type: boolean
831
+ reward:
832
+ type: object
833
+ properties:
834
+ name:
835
+ type: string
836
+ amount:
837
+ type: number
838
+ description: 签到记录
839
+ consecutiveDays:
840
+ type: integer
841
+ description: 连续签到天数
842
+ totalDays:
843
+ type: integer
844
+ description: 本月签到总天数
845
+ security:
846
+ - BearerAuth: []
847
+ /activities/{activityId}/claims:
848
+ get:
849
+ tags:
850
+ - Activities
851
+ summary: 获取领取记录
852
+ operationId: getClaimRecords
853
+ description: 获取用户在指定活动中的领取记录
854
+ parameters:
855
+ - name: activityId
856
+ in: path
857
+ required: true
858
+ schema:
859
+ type: string
860
+ - name: pageSize
861
+ in: query
862
+ schema:
863
+ type: integer
864
+ default: 20
865
+ - name: pageToken
866
+ in: query
867
+ schema:
868
+ type: string
869
+ responses:
870
+ '200':
871
+ description: 成功
872
+ content:
873
+ application/json:
874
+ schema:
875
+ type: object
876
+ properties:
877
+ success:
878
+ type: boolean
879
+ data:
880
+ type: array
881
+ items:
882
+ type: object
883
+ required: &ref_44
884
+ - id
885
+ - rewardType
886
+ - status
887
+ - createdAt
888
+ properties: &ref_45
889
+ id:
890
+ type: string
891
+ description: 记录 ID
892
+ activityId:
893
+ type: string
894
+ description: 活动 ID
895
+ rewardType:
896
+ type: string
897
+ description: 奖励类型
898
+ rewardName:
899
+ type: string
900
+ description: 奖励名称
901
+ rewardValue:
902
+ type: number
903
+ description: 奖励值
904
+ status:
905
+ type: string
906
+ enum:
907
+ - pending
908
+ - claimed
909
+ - expired
910
+ description: 领取状态
911
+ createdAt:
912
+ type: string
913
+ format: date-time
914
+ description: 创建时间
915
+ claimedAt:
916
+ type: string
917
+ format: date-time
918
+ description: 领取时间
919
+ expiresAt:
920
+ type: string
921
+ format: date-time
922
+ description: 过期时间
923
+ meta:
924
+ type: object
925
+ required: &ref_8
926
+ - page
927
+ - limit
928
+ - total
929
+ - totalPages
930
+ properties: &ref_9
931
+ page:
932
+ type: integer
933
+ minimum: 1
934
+ description: 当前页码
935
+ limit:
936
+ type: integer
937
+ minimum: 1
938
+ maximum: 100
939
+ description: 每页数量
940
+ total:
941
+ type: integer
942
+ minimum: 0
943
+ description: 总记录数
944
+ totalPages:
945
+ type: integer
946
+ minimum: 0
947
+ description: 总页数
948
+ security:
949
+ - BearerAuth: []
950
+ /activities/{activityId}/lottery:
951
+ get:
952
+ tags:
953
+ - Activities
954
+ summary: 获取抽奖记录
955
+ operationId: getLotteryRecords
956
+ description: 获取用户在指定活动中的抽奖记录
957
+ parameters:
958
+ - name: activityId
959
+ in: path
960
+ required: true
961
+ schema:
962
+ type: string
963
+ - name: pageSize
964
+ in: query
965
+ schema:
966
+ type: integer
967
+ default: 20
968
+ - name: pageToken
969
+ in: query
970
+ schema:
971
+ type: string
972
+ responses:
973
+ '200':
974
+ description: 成功
975
+ content:
976
+ application/json:
977
+ schema:
978
+ type: object
979
+ properties:
980
+ success:
981
+ type: boolean
982
+ data:
983
+ type: array
984
+ items:
985
+ type: object
986
+ required: &ref_46
987
+ - id
988
+ - prizeId
989
+ - status
990
+ - createdAt
991
+ properties: &ref_47
992
+ id:
993
+ type: string
994
+ description: 记录 ID
995
+ activityId:
996
+ type: string
997
+ description: 活动 ID
998
+ prizeId:
999
+ type: string
1000
+ description: 奖品 ID
1001
+ prizeName:
1002
+ type: string
1003
+ description: 奖品名称
1004
+ prizeType:
1005
+ type: string
1006
+ enum:
1007
+ - physical
1008
+ - virtual
1009
+ - coupon
1010
+ - points
1011
+ - none
1012
+ description: 奖品类型
1013
+ status:
1014
+ type: string
1015
+ enum:
1016
+ - won
1017
+ - notWon
1018
+ - claimed
1019
+ - shipped
1020
+ description: 状态
1021
+ createdAt:
1022
+ type: string
1023
+ format: date-time
1024
+ description: 抽奖时间
1025
+ claimedAt:
1026
+ type: string
1027
+ format: date-time
1028
+ description: 领取时间
1029
+ meta:
1030
+ type: object
1031
+ required: *ref_8
1032
+ properties: *ref_9
1033
+ security:
1034
+ - BearerAuth: []
1035
+ /track:
1036
+ post:
1037
+ tags:
1038
+ - Track
1039
+ summary: 埋点上报
1040
+ operationId: track
1041
+ description: |
1042
+ 接收客户端埋点数据,异步写入 Outbox。
1043
+
1044
+ 特点:
1045
+ - 高性能:不阻塞主链路
1046
+ - 可靠:通过 Outbox 异步持久化
1047
+ - 可追溯:自动关联 pageVersionId/componentVersionId/traceId
1048
+ requestBody:
1049
+ required: true
1050
+ content:
1051
+ application/json:
1052
+ schema:
1053
+ type: object
1054
+ required: &ref_10
1055
+ - eventName
1056
+ properties: &ref_11
1057
+ eventName:
1058
+ type: string
1059
+ minLength: 1
1060
+ maxLength: 255
1061
+ description: 事件名称
1062
+ eventType:
1063
+ type: string
1064
+ enum:
1065
+ - page_view
1066
+ - click
1067
+ - exposure
1068
+ - custom
1069
+ default: custom
1070
+ description: 事件类型
1071
+ properties:
1072
+ type: object
1073
+ additionalProperties: true
1074
+ description: 事件属性
1075
+ timestamp:
1076
+ type: string
1077
+ format: date-time
1078
+ description: 事件时间(默认为服务器接收时间)
1079
+ context:
1080
+ type: object
1081
+ properties:
1082
+ pageId:
1083
+ type: string
1084
+ componentId:
1085
+ type: string
1086
+ sessionId:
1087
+ type: string
1088
+ deviceType:
1089
+ type: string
1090
+ description: 上下文信息
1091
+ responses:
1092
+ '202':
1093
+ description: 接收成功(异步处理)
1094
+ content:
1095
+ application/json:
1096
+ schema:
1097
+ type: object
1098
+ properties:
1099
+ success:
1100
+ type: boolean
1101
+ example: true
1102
+ data:
1103
+ type: object
1104
+ properties:
1105
+ eventId:
1106
+ type: string
1107
+ description: 事件 ID
1108
+ '400':
1109
+ description: 请求参数错误
1110
+ content: *ref_4
1111
+ /track/batch:
1112
+ post:
1113
+ tags:
1114
+ - Track
1115
+ summary: 批量埋点上报
1116
+ operationId: trackBatch
1117
+ description: |
1118
+ 批量接收客户端埋点数据,提高上报效率。
1119
+
1120
+ 限制:
1121
+ - 单次最多 100 条
1122
+ - 单条事件不超过 10KB
1123
+ requestBody:
1124
+ required: true
1125
+ content:
1126
+ application/json:
1127
+ schema:
1128
+ type: object
1129
+ required: &ref_48
1130
+ - events
1131
+ properties: &ref_49
1132
+ events:
1133
+ type: array
1134
+ items:
1135
+ type: object
1136
+ required: *ref_10
1137
+ properties: *ref_11
1138
+ maxItems: 100
1139
+ description: 事件列表(最多 100 个)
1140
+ responses:
1141
+ '202':
1142
+ description: 接收成功
1143
+ content:
1144
+ application/json:
1145
+ schema:
1146
+ type: object
1147
+ properties:
1148
+ success:
1149
+ type: boolean
1150
+ data:
1151
+ type: object
1152
+ properties:
1153
+ accepted:
1154
+ type: integer
1155
+ description: 接收的事件数量
1156
+ rejected:
1157
+ type: integer
1158
+ description: 拒绝的事件数量
1159
+ errors:
1160
+ type: array
1161
+ items:
1162
+ type: object
1163
+ properties:
1164
+ index:
1165
+ type: integer
1166
+ reason:
1167
+ type: string
1168
+ '400':
1169
+ description: 请求参数错误
1170
+ content: *ref_4
1171
+ components:
1172
+ schemas:
1173
+ PageResponse:
1174
+ type: object
1175
+ required: *ref_12
1176
+ properties: *ref_13
1177
+ ErrorResponse:
1178
+ type: object
1179
+ required: *ref_0
1180
+ properties: *ref_1
1181
+ ResolveContext:
1182
+ type: object
1183
+ description: 页面解析上下文
1184
+ properties: *ref_5
1185
+ ResolvePageRequest:
1186
+ type: object
1187
+ properties: *ref_14
1188
+ ComponentManifest:
1189
+ type: object
1190
+ required: *ref_15
1191
+ properties: *ref_16
1192
+ ActionManifest:
1193
+ type: object
1194
+ required: *ref_17
1195
+ properties: *ref_18
1196
+ QueryManifest:
1197
+ type: object
1198
+ required: *ref_19
1199
+ properties: *ref_20
1200
+ ResourceManifests:
1201
+ type: object
1202
+ properties: *ref_21
1203
+ ResolvePageResponse:
1204
+ type: object
1205
+ required: *ref_22
1206
+ properties: *ref_23
1207
+ ActionContext:
1208
+ type: object
1209
+ description: 动作执行上下文
1210
+ properties: *ref_24
1211
+ ExecuteActionRequest:
1212
+ type: object
1213
+ required: *ref_25
1214
+ properties: *ref_26
1215
+ ActionEffect:
1216
+ type: object
1217
+ required: *ref_27
1218
+ properties: *ref_28
1219
+ ExecuteActionResponse:
1220
+ type: object
1221
+ required: *ref_29
1222
+ properties: *ref_30
1223
+ ValidateActionRequest:
1224
+ type: object
1225
+ required: *ref_31
1226
+ properties: *ref_32
1227
+ ValidateActionResponse:
1228
+ type: object
1229
+ required: *ref_33
1230
+ properties: *ref_34
1231
+ ExecuteQueryRequest:
1232
+ type: object
1233
+ properties: *ref_35
1234
+ ExecuteQueryResponse:
1235
+ type: object
1236
+ required: *ref_36
1237
+ properties: *ref_37
1238
+ PublicActivityInfo:
1239
+ type: object
1240
+ required: *ref_38
1241
+ properties: *ref_39
1242
+ UserActivityState:
1243
+ type: object
1244
+ required: *ref_40
1245
+ properties: *ref_41
1246
+ SigninCalendar:
1247
+ type: object
1248
+ required: *ref_42
1249
+ properties: *ref_43
1250
+ ClaimRecordInfo:
1251
+ type: object
1252
+ required: *ref_44
1253
+ properties: *ref_45
1254
+ PaginationMeta:
1255
+ type: object
1256
+ required: *ref_8
1257
+ properties: *ref_9
1258
+ LotteryRecordInfo:
1259
+ type: object
1260
+ required: *ref_46
1261
+ properties: *ref_47
1262
+ TrackRequest:
1263
+ type: object
1264
+ required: *ref_10
1265
+ properties: *ref_11
1266
+ TrackBatchRequest:
1267
+ type: object
1268
+ required: *ref_48
1269
+ properties: *ref_49
1270
+ responses:
1271
+ NotFound:
1272
+ description: 资源不存在
1273
+ content: *ref_2
1274
+ ServiceUnavailable:
1275
+ description: 服务不可用
1276
+ content: *ref_3
1277
+ BadRequest:
1278
+ description: 请求参数错误
1279
+ content: *ref_4
1280
+ UnprocessableEntity:
1281
+ description: 请求无法处理
1282
+ content: *ref_6
1283
+ InternalError:
1284
+ description: 服务器内部错误
1285
+ content: *ref_7
1286
+ GatewayTimeout:
1287
+ description: 网关超时
1288
+ content: *ref_50
1289
+ securitySchemes:
1290
+ BearerAuth:
1291
+ type: http
1292
+ scheme: bearer
1293
+ bearerFormat: JWT
1294
+ description: JWT 认证令牌(可选)
1295
+ ApiKey:
1296
+ type: apiKey
1297
+ in: header
1298
+ name: X-API-Key
1299
+ description: API 密钥