@djvlc/openapi-user-client 1.8.0 → 1.8.2

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,18 +1,18 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
- title: DJVLC User API
3
+ title: 平台用户端 API
4
4
  version: 1.0.0
5
5
  description: |
6
- DJVLC 低代码平台用户端 API(数据面)
6
+ 平台用户端 API 文档 (User API)
7
7
 
8
8
  提供以下功能:
9
- - 页面解析(Page Resolve)
10
- - 动作执行(Action Gateway - 统一入口)
11
- - 数据查询(Data Proxy - 统一入口)
12
- - 活动状态查询
13
- - 埋点上报(Track
14
- - 租户解析(Tenant Resolver)
15
- - 健康检查(Health
9
+ - 页面运行时(Pages)- 页面解析与渲染
10
+ - 动作网关(Actions)- 统一动作执行入口
11
+ - 数据查询(Queries)- 数据代理查询
12
+ - 活动运行时(Activities)- 活动状态查询
13
+ - 埋点追踪(Track)- 用户行为追踪
14
+ - 租户解析(Tenant)- 多租户解析
15
+ - 健康检查(Health)- 服务健康状态
16
16
 
17
17
  核心原则:
18
18
  - 所有业务动作只走 Action Gateway(鉴权/风控/幂等/审计/签名)
@@ -31,22 +31,22 @@ servers:
31
31
 
32
32
  tags:
33
33
  - name: Pages
34
- description: 页面解析(Page Resolve)
34
+ description: 页面运行时 - 页面解析与渲染
35
35
  - name: Actions
36
- description: 动作执行(Action Gateway)
36
+ description: 动作网关 - 统一动作执行入口
37
37
  - name: Queries
38
- description: 数据查询(Data Proxy)
38
+ description: 数据查询 - 数据代理查询
39
39
  - name: Activities
40
- description: 活动状态查询
40
+ description: 活动运行时 - 活动状态查询
41
41
  - name: Track
42
- description: 埋点上报
42
+ description: 埋点追踪 - 用户行为追踪
43
43
  - name: Tenant
44
- description: 租户解析
44
+ description: 租户解析 - 多租户解析
45
45
  - name: Health
46
- description: 健康检查
46
+ description: 健康检查 - 服务健康状态
47
47
 
48
48
  paths:
49
- # 页面解析(根据设计总纲 V2)
49
+ # 页面解析
50
50
  /page/resolve:
51
51
  $ref: './paths/pages.yaml#/resolve'
52
52
  /page/manifest:
@@ -103,10 +103,10 @@ paths:
103
103
  # 健康检查
104
104
  /health:
105
105
  $ref: './paths/health.yaml#/health'
106
- /health/ready:
107
- $ref: './paths/health.yaml#/ready'
108
106
  /health/live:
109
107
  $ref: './paths/health.yaml#/live'
108
+ /health/ready:
109
+ $ref: './paths/health.yaml#/ready'
110
110
 
111
111
  components:
112
112
  schemas:
@@ -118,7 +118,7 @@ components:
118
118
  type: http
119
119
  scheme: bearer
120
120
  bearerFormat: JWT
121
- description: JWT 认证令牌(可选)
121
+ description: 请输入 JWT 访问令牌
122
122
  ApiKey:
123
123
  type: apiKey
124
124
  in: header
@@ -4,9 +4,9 @@ execute:
4
4
  post:
5
5
  tags: [Actions]
6
6
  operationId: executeAction
7
- summary: 执行动作(统一入口)
7
+ summary: 执行动作
8
8
  description: |
9
- Action Gateway 唯一入口,所有业务动作都通过此接口执行。
9
+ 统一的动作执行入口,支持领取、签到等业务动作。
10
10
 
11
11
  执行流程(Pipeline):
12
12
  1. Auth(登录态/票据/签名)
@@ -15,36 +15,6 @@ execute:
15
15
  4. Execute(执行器:Claim/Signin/Lottery...)
16
16
  5. Audit(审计落库 + outbox)
17
17
  6. Normalize(统一错误码/返回)
18
-
19
- 支持的动作类型:
20
- - claim: 领取
21
- - signin: 签到
22
- - lottery: 抽奖
23
- - reserve: 预约
24
- - bind: 绑定
25
- - task_complete: 任务完成
26
- - vote: 投票
27
- - share: 分享
28
- - form_submit: 表单提交
29
- - navigate: 页面跳转(内置)
30
- - setState: 状态更新(内置)
31
- - showToast: 提示消息(内置)
32
- - custom: 自定义动作
33
- parameters:
34
- - name: Idempotency-Key
35
- in: header
36
- required: false
37
- schema:
38
- type: string
39
- minLength: 16
40
- maxLength: 128
41
- description: 幂等键(与 body.idempotencyKey 二选一,推荐 header 传递)
42
- - name: X-Trace-Id
43
- in: header
44
- required: false
45
- schema:
46
- type: string
47
- description: 链路追踪 ID(OTel,全链路透传)
48
18
  requestBody:
49
19
  required: true
50
20
  content:
@@ -53,38 +23,33 @@ execute:
53
23
  $ref: '../components/schemas/_index.yaml#/ExecuteActionRequest'
54
24
  responses:
55
25
  '200':
56
- description: 执行成功
26
+ description: 执行结果
57
27
  content:
58
28
  application/json:
59
29
  schema:
60
- $ref: '../components/schemas/_index.yaml#/ExecuteActionResponse'
30
+ allOf:
31
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
32
+ - type: object
33
+ properties:
34
+ data:
35
+ $ref: '../components/schemas/_index.yaml#/ExecuteActionResponse'
61
36
  '400':
62
37
  $ref: '../components/responses/_index.yaml#/BadRequest'
63
38
  '401':
64
39
  $ref: '../components/responses/_index.yaml#/Unauthorized'
65
- '403':
66
- $ref: '../components/responses/_index.yaml#/Forbidden'
67
- '409':
68
- description: 幂等冲突(重复请求)
69
- content:
70
- application/json:
71
- schema:
72
- $ref: '../components/schemas/_index.yaml#/IdempotencyConflictResponse'
73
- '422':
74
- $ref: '../components/responses/_index.yaml#/UnprocessableEntity'
75
40
  '429':
76
41
  $ref: '../components/responses/_index.yaml#/TooManyRequests'
77
42
  '500':
78
43
  $ref: '../components/responses/_index.yaml#/InternalError'
44
+ security:
45
+ - BearerAuth: []
79
46
 
80
47
  validate:
81
48
  post:
82
49
  tags: [Actions]
83
50
  operationId: validateActionParams
84
51
  summary: 验证动作参数
85
- description: |
86
- 验证动作参数是否符合 Schema 定义(不执行动作)。
87
- 用于前端表单提交前的预校验。
52
+ description: 验证参数是否符合 Schema 定义,不执行动作
88
53
  requestBody:
89
54
  required: true
90
55
  content:
@@ -97,29 +62,44 @@ validate:
97
62
  content:
98
63
  application/json:
99
64
  schema:
100
- $ref: '../components/schemas/_index.yaml#/ValidateActionResponse'
65
+ allOf:
66
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
67
+ - type: object
68
+ properties:
69
+ data:
70
+ $ref: '../components/schemas/_index.yaml#/ValidateActionResponse'
101
71
  '400':
102
72
  $ref: '../components/responses/_index.yaml#/BadRequest'
73
+ security:
74
+ - BearerAuth: []
103
75
 
104
76
  definitions:
105
77
  get:
106
78
  tags: [Actions]
107
79
  operationId: getActionDefinition
108
80
  summary: 获取动作定义
109
- description: 获取指定动作定义版本的详细信息(用于 Runtime 渲染动作配置)
81
+ description: 按版本 ID 获取动作定义详情
110
82
  parameters:
111
83
  - name: actionDefinitionVersionId
112
84
  in: query
113
85
  required: true
86
+ description: 动作定义版本 ID
114
87
  schema:
115
88
  type: string
116
- description: 动作定义版本 ID
89
+ example: 202401efgh87654321
117
90
  responses:
118
91
  '200':
119
- description: 成功
92
+ description: 动作定义版本信息
120
93
  content:
121
94
  application/json:
122
95
  schema:
123
- $ref: '../components/schemas/_index.yaml#/ActionDefinitionResponse'
96
+ allOf:
97
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
98
+ - type: object
99
+ properties:
100
+ data:
101
+ $ref: '../components/schemas/_index.yaml#/ActionDefinitionVersionResponse'
124
102
  '404':
125
103
  $ref: '../components/responses/_index.yaml#/NotFound'
104
+ security:
105
+ - BearerAuth: []
@@ -1,18 +1,11 @@
1
1
  # Activities 活动状态 API(User 端)
2
2
 
3
- activityState:
3
+ activityInfo:
4
4
  get:
5
- tags:
6
- - Activities
7
- summary: 获取用户活动状态
8
- operationId: getActivityState
9
- description: |
10
- 查询用户在指定活动中的参与状态。
11
-
12
- 返回内容包括:
13
- - 是否可参与
14
- - 剩余次数
15
- - 类型特定状态(领取/签到/抽奖等)
5
+ tags: [Activities]
6
+ operationId: getActivityInfo
7
+ summary: 获取活动信息(公开)
8
+ description: 获取活动的公开信息,不需要登录
16
9
  parameters:
17
10
  - name: activityId
18
11
  in: path
@@ -21,104 +14,141 @@ activityState:
21
14
  type: string
22
15
  responses:
23
16
  '200':
24
- description: 成功
17
+ description: 获取活动信息成功
25
18
  content:
26
19
  application/json:
27
20
  schema:
28
- type: object
29
- properties:
30
- success:
31
- type: boolean
32
- data:
33
- $ref: '../components/schemas/_index.yaml#/UserActivityState'
21
+ allOf:
22
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
23
+ - type: object
24
+ properties:
25
+ data:
26
+ $ref: '../components/schemas/_index.yaml#/ActivityInfoResponse'
34
27
  '404':
35
28
  $ref: '../components/responses/_index.yaml#/NotFound'
36
- security:
37
- - BearerAuth: []
29
+ security: []
38
30
 
39
- activityInfo:
31
+ activityState:
40
32
  get:
41
- tags:
42
- - Activities
43
- summary: 获取活动信息(公开)
44
- operationId: getActivityInfo
45
- description: |
46
- 获取活动的公开信息,不需要登录。
47
-
48
- 返回内容包括:
49
- - 活动基本信息
50
- - 时间范围
51
- - 奖品列表(脱敏)
33
+ tags: [Activities]
34
+ operationId: getActivityState
35
+ summary: 获取用户活动状态
36
+ description: 查询用户在指定活动中的参与状态
52
37
  parameters:
53
38
  - name: activityId
54
39
  in: path
55
40
  required: true
56
41
  schema:
57
42
  type: string
43
+ - name: uid
44
+ in: query
45
+ required: false
46
+ description: 用户 UID
47
+ schema:
48
+ type: string
58
49
  responses:
59
50
  '200':
60
- description: 成功
51
+ description: 获取活动状态成功
61
52
  content:
62
53
  application/json:
63
54
  schema:
64
- type: object
65
- properties:
66
- success:
67
- type: boolean
68
- data:
69
- $ref: '../components/schemas/_index.yaml#/PublicActivityInfo'
55
+ allOf:
56
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
57
+ - type: object
58
+ properties:
59
+ data:
60
+ $ref: '../components/schemas/_index.yaml#/ActivityStatusResponse'
70
61
  '404':
71
62
  $ref: '../components/responses/_index.yaml#/NotFound'
72
- security: []
73
63
 
74
64
  signinCalendar:
75
65
  get:
76
- tags:
77
- - Activities
78
- summary: 获取签到日历
66
+ tags: [Activities]
79
67
  operationId: getSigninCalendar
80
- description: |
81
- 获取用户的签到日历数据。
82
-
83
- 返回内容包括:
84
- - 当前周期的签到记录
85
- - 连续签到天数
86
- - 累计签到天数
87
- - 奖励进度
68
+ summary: 获取签到日历
69
+ description: 获取用户的签到日历数据
88
70
  parameters:
89
71
  - name: activityId
90
72
  in: path
91
73
  required: true
92
74
  schema:
93
75
  type: string
76
+ - name: uid
77
+ in: query
78
+ required: true
79
+ description: 用户 UID
80
+ schema:
81
+ type: string
94
82
  - name: month
95
83
  in: query
96
- description: 月份(YYYY-MM),默认当前月
84
+ required: false
85
+ description: 月份(YYYY-MM)
97
86
  schema:
98
87
  type: string
99
- pattern: '^\d{4}-\d{2}$'
88
+ example: '2024-01'
100
89
  responses:
101
90
  '200':
102
- description: 成功
91
+ description: 获取签到日历成功
103
92
  content:
104
93
  application/json:
105
94
  schema:
106
- type: object
107
- properties:
108
- success:
109
- type: boolean
110
- data:
111
- $ref: '../components/schemas/_index.yaml#/SigninCalendar'
112
- security:
113
- - BearerAuth: []
95
+ allOf:
96
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
97
+ - type: object
98
+ properties:
99
+ data:
100
+ $ref: '../components/schemas/_index.yaml#/SigninCalendarResponse'
114
101
 
115
102
  claimRecords:
116
103
  get:
117
- tags:
118
- - Activities
119
- summary: 获取领取记录
104
+ tags: [Activities]
120
105
  operationId: getClaimRecords
106
+ summary: 获取领取记录
121
107
  description: 获取用户在指定活动中的领取记录
108
+ parameters:
109
+ - name: activityId
110
+ in: path
111
+ required: true
112
+ schema:
113
+ type: string
114
+ - name: pageToken
115
+ in: query
116
+ required: false
117
+ description: 分页游标
118
+ schema:
119
+ type: string
120
+ - name: pageSize
121
+ in: query
122
+ required: false
123
+ description: 每页条数
124
+ schema:
125
+ type: number
126
+ example: 20
127
+ - name: uid
128
+ in: query
129
+ required: false
130
+ description: 用户 UID,不传则返回空
131
+ schema:
132
+ type: string
133
+ responses:
134
+ '200':
135
+ description: 获取领取记录成功
136
+ content:
137
+ application/json:
138
+ schema:
139
+ allOf:
140
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
141
+ - type: object
142
+ properties:
143
+ data:
144
+ $ref: '../components/schemas/_index.yaml#/PaginatedRecordsResponse'
145
+
146
+ lotteryRecords:
147
+ get:
148
+ tags: [Activities]
149
+ operationId: getLotteryRecords
150
+ summary: 获取抽奖记录
151
+ description: 获取用户在指定活动中的抽奖记录
122
152
  parameters:
123
153
  - name: activityId
124
154
  in: path
@@ -127,41 +157,37 @@ claimRecords:
127
157
  type: string
128
158
  - name: pageSize
129
159
  in: query
160
+ required: false
161
+ description: 每页条数
130
162
  schema:
131
- type: integer
163
+ type: number
132
164
  default: 20
165
+ example: 20
133
166
  - name: pageToken
134
167
  in: query
168
+ required: false
169
+ description: 分页游标
135
170
  schema:
136
171
  type: string
137
172
  responses:
138
173
  '200':
139
- description: 成功
174
+ description: 获取抽奖记录成功
140
175
  content:
141
176
  application/json:
142
177
  schema:
143
- type: object
144
- properties:
145
- success:
146
- type: boolean
147
- data:
148
- type: array
149
- items:
150
- $ref: '../components/schemas/_index.yaml#/ClaimRecordInfo'
151
- meta:
152
- $ref: '../components/schemas/_index.yaml#/PaginationMeta'
153
- security:
154
- - BearerAuth: []
178
+ allOf:
179
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
180
+ - type: object
181
+ properties:
182
+ data:
183
+ $ref: '../components/schemas/_index.yaml#/PaginatedRecordsResponse'
155
184
 
156
185
  activityStatus:
157
186
  get:
158
- tags:
159
- - Activities
160
- summary: 获取活动状态(兼容)
187
+ tags: [Activities]
161
188
  operationId: getActivityStatus
162
- description: |
163
- 获取活动的当前状态信息,包括是否进行中、时间范围等。
164
- 不需要登录,可用于前端判断活动是否在有效期内。
189
+ summary: 获取活动状态(兼容)
190
+ description: 获取活动的当前状态信息
165
191
  parameters:
166
192
  - name: activityId
167
193
  in: path
@@ -170,26 +196,25 @@ activityStatus:
170
196
  type: string
171
197
  responses:
172
198
  '200':
173
- description: 成功
199
+ description: 获取活动状态成功
174
200
  content:
175
201
  application/json:
176
202
  schema:
177
- type: object
178
- properties:
179
- success:
180
- type: boolean
181
- data:
182
- $ref: '../components/schemas/_index.yaml#/ActivityStatus'
203
+ allOf:
204
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
205
+ - type: object
206
+ properties:
207
+ data:
208
+ $ref: '../components/schemas/_index.yaml#/ActivityStatusResponse'
183
209
  '404':
184
210
  $ref: '../components/responses/_index.yaml#/NotFound'
185
211
  security: []
186
212
 
187
213
  claimStatus:
188
214
  get:
189
- tags:
190
- - Activities
191
- summary: 获取领取状态
215
+ tags: [Activities]
192
216
  operationId: getClaimStatus
217
+ summary: 获取领取状态
193
218
  description: 获取用户在指定活动中的领取状态
194
219
  parameters:
195
220
  - name: activityId
@@ -200,31 +225,27 @@ claimStatus:
200
225
  - name: uid
201
226
  in: query
202
227
  required: true
228
+ description: 用户 UID
203
229
  schema:
204
230
  type: string
205
- description: 用户 UID
206
231
  responses:
207
232
  '200':
208
- description: 成功
233
+ description: 获取领取状态成功
209
234
  content:
210
235
  application/json:
211
236
  schema:
212
- type: object
213
- properties:
214
- success:
215
- type: boolean
216
- data:
217
- type: object
218
- description: 领取状态数据
219
- security:
220
- - BearerAuth: []
237
+ allOf:
238
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
239
+ - type: object
240
+ properties:
241
+ data:
242
+ $ref: '../components/schemas/_index.yaml#/ClaimStatusResponse'
221
243
 
222
244
  signinStatus:
223
245
  get:
224
- tags:
225
- - Activities
226
- summary: 获取签到状态
246
+ tags: [Activities]
227
247
  operationId: getSigninStatus
248
+ summary: 获取签到状态
228
249
  description: 获取用户在指定活动中的签到状态
229
250
  parameters:
230
251
  - name: activityId
@@ -235,62 +256,18 @@ signinStatus:
235
256
  - name: uid
236
257
  in: query
237
258
  required: true
238
- schema:
239
- type: string
240
259
  description: 用户 UID
241
- responses:
242
- '200':
243
- description: 成功
244
- content:
245
- application/json:
246
- schema:
247
- type: object
248
- properties:
249
- success:
250
- type: boolean
251
- data:
252
- type: object
253
- description: 签到状态数据
254
- security:
255
- - BearerAuth: []
256
-
257
- lotteryRecords:
258
- get:
259
- tags:
260
- - Activities
261
- summary: 获取抽奖记录
262
- operationId: getLotteryRecords
263
- description: 获取用户在指定活动中的抽奖记录
264
- parameters:
265
- - name: activityId
266
- in: path
267
- required: true
268
- schema:
269
- type: string
270
- - name: pageSize
271
- in: query
272
- schema:
273
- type: integer
274
- default: 20
275
- - name: pageToken
276
- in: query
277
260
  schema:
278
261
  type: string
279
262
  responses:
280
263
  '200':
281
- description: 成功
264
+ description: 获取签到状态成功
282
265
  content:
283
266
  application/json:
284
267
  schema:
285
- type: object
286
- properties:
287
- success:
288
- type: boolean
289
- data:
290
- type: array
291
- items:
292
- $ref: '../components/schemas/_index.yaml#/LotteryRecordInfo'
293
- meta:
294
- $ref: '../components/schemas/_index.yaml#/PaginationMeta'
295
- security:
296
- - BearerAuth: []
268
+ allOf:
269
+ - $ref: '../components/schemas/_index.yaml#/SuccessResponse'
270
+ - type: object
271
+ properties:
272
+ data:
273
+ $ref: '../components/schemas/_index.yaml#/SigninStatusResponse'