@djvlc/openapi-user-client 1.8.0 → 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,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,7 +23,7 @@ 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:
@@ -62,29 +32,19 @@ execute:
62
32
  $ref: '../components/responses/_index.yaml#/BadRequest'
63
33
  '401':
64
34
  $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
35
  '429':
76
36
  $ref: '../components/responses/_index.yaml#/TooManyRequests'
77
37
  '500':
78
38
  $ref: '../components/responses/_index.yaml#/InternalError'
39
+ security:
40
+ - BearerAuth: []
79
41
 
80
42
  validate:
81
43
  post:
82
44
  tags: [Actions]
83
45
  operationId: validateActionParams
84
46
  summary: 验证动作参数
85
- description: |
86
- 验证动作参数是否符合 Schema 定义(不执行动作)。
87
- 用于前端表单提交前的预校验。
47
+ description: 验证参数是否符合 Schema 定义,不执行动作
88
48
  requestBody:
89
49
  required: true
90
50
  content:
@@ -100,26 +60,31 @@ validate:
100
60
  $ref: '../components/schemas/_index.yaml#/ValidateActionResponse'
101
61
  '400':
102
62
  $ref: '../components/responses/_index.yaml#/BadRequest'
63
+ security:
64
+ - BearerAuth: []
103
65
 
104
66
  definitions:
105
67
  get:
106
68
  tags: [Actions]
107
69
  operationId: getActionDefinition
108
70
  summary: 获取动作定义
109
- description: 获取指定动作定义版本的详细信息(用于 Runtime 渲染动作配置)
71
+ description: 按版本 ID 获取动作定义详情
110
72
  parameters:
111
73
  - name: actionDefinitionVersionId
112
74
  in: query
113
75
  required: true
76
+ description: 动作定义版本 ID
114
77
  schema:
115
78
  type: string
116
- description: 动作定义版本 ID
79
+ example: 202401efgh87654321
117
80
  responses:
118
81
  '200':
119
- description: 成功
82
+ description: 动作定义版本信息
120
83
  content:
121
84
  application/json:
122
85
  schema:
123
- $ref: '../components/schemas/_index.yaml#/ActionDefinitionResponse'
86
+ $ref: '../components/schemas/_index.yaml#/ActionDefinitionVersionResponse'
124
87
  '404':
125
88
  $ref: '../components/responses/_index.yaml#/NotFound'
89
+ security:
90
+ - 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
@@ -25,100 +18,117 @@ activityState:
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
+ $ref: '../components/schemas/_index.yaml#/ActivityInfoResponse'
34
22
  '404':
35
23
  $ref: '../components/responses/_index.yaml#/NotFound'
36
- security:
37
- - BearerAuth: []
24
+ security: []
38
25
 
39
- activityInfo:
26
+ activityState:
40
27
  get:
41
- tags:
42
- - Activities
43
- summary: 获取活动信息(公开)
44
- operationId: getActivityInfo
45
- description: |
46
- 获取活动的公开信息,不需要登录。
47
-
48
- 返回内容包括:
49
- - 活动基本信息
50
- - 时间范围
51
- - 奖品列表(脱敏)
28
+ tags: [Activities]
29
+ operationId: getActivityState
30
+ summary: 获取用户活动状态
31
+ description: 查询用户在指定活动中的参与状态
52
32
  parameters:
53
33
  - name: activityId
54
34
  in: path
55
35
  required: true
56
36
  schema:
57
37
  type: string
38
+ - name: uid
39
+ in: query
40
+ required: false
41
+ description: 用户 UID
42
+ schema:
43
+ type: string
58
44
  responses:
59
45
  '200':
60
46
  description: 成功
61
47
  content:
62
48
  application/json:
63
49
  schema:
64
- type: object
65
- properties:
66
- success:
67
- type: boolean
68
- data:
69
- $ref: '../components/schemas/_index.yaml#/PublicActivityInfo'
50
+ $ref: '../components/schemas/_index.yaml#/ActivityStatusResponse'
70
51
  '404':
71
52
  $ref: '../components/responses/_index.yaml#/NotFound'
72
- security: []
73
53
 
74
54
  signinCalendar:
75
55
  get:
76
- tags:
77
- - Activities
78
- summary: 获取签到日历
56
+ tags: [Activities]
79
57
  operationId: getSigninCalendar
80
- description: |
81
- 获取用户的签到日历数据。
82
-
83
- 返回内容包括:
84
- - 当前周期的签到记录
85
- - 连续签到天数
86
- - 累计签到天数
87
- - 奖励进度
58
+ summary: 获取签到日历
59
+ description: 获取用户的签到日历数据
88
60
  parameters:
89
61
  - name: activityId
90
62
  in: path
91
63
  required: true
92
64
  schema:
93
65
  type: string
66
+ - name: uid
67
+ in: query
68
+ required: true
69
+ description: 用户 UID
70
+ schema:
71
+ type: string
94
72
  - name: month
95
73
  in: query
96
- description: 月份(YYYY-MM),默认当前月
74
+ required: false
75
+ description: 月份(YYYY-MM)
97
76
  schema:
98
77
  type: string
99
- pattern: '^\d{4}-\d{2}$'
78
+ example: '2024-01'
100
79
  responses:
101
80
  '200':
102
81
  description: 成功
103
82
  content:
104
83
  application/json:
105
84
  schema:
106
- type: object
107
- properties:
108
- success:
109
- type: boolean
110
- data:
111
- $ref: '../components/schemas/_index.yaml#/SigninCalendar'
112
- security:
113
- - BearerAuth: []
85
+ $ref: '../components/schemas/_index.yaml#/SigninCalendarResponse'
114
86
 
115
87
  claimRecords:
116
88
  get:
117
- tags:
118
- - Activities
119
- summary: 获取领取记录
89
+ tags: [Activities]
120
90
  operationId: getClaimRecords
91
+ summary: 获取领取记录
121
92
  description: 获取用户在指定活动中的领取记录
93
+ parameters:
94
+ - name: activityId
95
+ in: path
96
+ required: true
97
+ schema:
98
+ type: string
99
+ - name: pageToken
100
+ in: query
101
+ required: false
102
+ description: 分页游标
103
+ schema:
104
+ type: string
105
+ - name: pageSize
106
+ in: query
107
+ required: false
108
+ description: 每页条数
109
+ schema:
110
+ type: number
111
+ example: 20
112
+ - name: uid
113
+ in: query
114
+ required: false
115
+ description: 用户 UID,不传则返回空
116
+ schema:
117
+ type: string
118
+ responses:
119
+ '200':
120
+ description: 成功
121
+ content:
122
+ application/json:
123
+ schema:
124
+ $ref: '../components/schemas/_index.yaml#/PaginatedRecordsResponse'
125
+
126
+ lotteryRecords:
127
+ get:
128
+ tags: [Activities]
129
+ operationId: getLotteryRecords
130
+ summary: 获取抽奖记录
131
+ description: 获取用户在指定活动中的抽奖记录
122
132
  parameters:
123
133
  - name: activityId
124
134
  in: path
@@ -127,11 +137,16 @@ claimRecords:
127
137
  type: string
128
138
  - name: pageSize
129
139
  in: query
140
+ required: false
141
+ description: 每页条数
130
142
  schema:
131
- type: integer
143
+ type: number
132
144
  default: 20
145
+ example: 20
133
146
  - name: pageToken
134
147
  in: query
148
+ required: false
149
+ description: 分页游标
135
150
  schema:
136
151
  type: string
137
152
  responses:
@@ -140,28 +155,14 @@ claimRecords:
140
155
  content:
141
156
  application/json:
142
157
  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: []
158
+ $ref: '../components/schemas/_index.yaml#/PaginatedRecordsResponse'
155
159
 
156
160
  activityStatus:
157
161
  get:
158
- tags:
159
- - Activities
160
- summary: 获取活动状态(兼容)
162
+ tags: [Activities]
161
163
  operationId: getActivityStatus
162
- description: |
163
- 获取活动的当前状态信息,包括是否进行中、时间范围等。
164
- 不需要登录,可用于前端判断活动是否在有效期内。
164
+ summary: 获取活动状态(兼容)
165
+ description: 获取活动的当前状态信息
165
166
  parameters:
166
167
  - name: activityId
167
168
  in: path
@@ -174,22 +175,16 @@ activityStatus:
174
175
  content:
175
176
  application/json:
176
177
  schema:
177
- type: object
178
- properties:
179
- success:
180
- type: boolean
181
- data:
182
- $ref: '../components/schemas/_index.yaml#/ActivityStatus'
178
+ $ref: '../components/schemas/_index.yaml#/ActivityStatusResponse'
183
179
  '404':
184
180
  $ref: '../components/responses/_index.yaml#/NotFound'
185
181
  security: []
186
182
 
187
183
  claimStatus:
188
184
  get:
189
- tags:
190
- - Activities
191
- summary: 获取领取状态
185
+ tags: [Activities]
192
186
  operationId: getClaimStatus
187
+ summary: 获取领取状态
193
188
  description: 获取用户在指定活动中的领取状态
194
189
  parameters:
195
190
  - name: activityId
@@ -200,31 +195,22 @@ claimStatus:
200
195
  - name: uid
201
196
  in: query
202
197
  required: true
198
+ description: 用户 UID
203
199
  schema:
204
200
  type: string
205
- description: 用户 UID
206
201
  responses:
207
202
  '200':
208
203
  description: 成功
209
204
  content:
210
205
  application/json:
211
206
  schema:
212
- type: object
213
- properties:
214
- success:
215
- type: boolean
216
- data:
217
- type: object
218
- description: 领取状态数据
219
- security:
220
- - BearerAuth: []
207
+ $ref: '../components/schemas/_index.yaml#/ClaimStatusResponse'
221
208
 
222
209
  signinStatus:
223
210
  get:
224
- tags:
225
- - Activities
226
- summary: 获取签到状态
211
+ tags: [Activities]
227
212
  operationId: getSigninStatus
213
+ summary: 获取签到状态
228
214
  description: 获取用户在指定活动中的签到状态
229
215
  parameters:
230
216
  - name: activityId
@@ -235,45 +221,7 @@ signinStatus:
235
221
  - name: uid
236
222
  in: query
237
223
  required: true
238
- schema:
239
- type: string
240
224
  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
225
  schema:
278
226
  type: string
279
227
  responses:
@@ -282,15 +230,4 @@ lotteryRecords:
282
230
  content:
283
231
  application/json:
284
232
  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: []
233
+ $ref: '../components/schemas/_index.yaml#/SigninStatusResponse'
@@ -2,87 +2,45 @@
2
2
 
3
3
  health:
4
4
  get:
5
- tags:
6
- - Health
7
- summary: 健康检查
5
+ tags: [Health]
8
6
  operationId: healthCheck
9
- description: |
10
- 综合健康检查,包含所有依赖服务状态。
11
-
12
- 返回:
13
- - 服务状态(healthy/degraded/unhealthy)
14
- - 版本信息
15
- - 运行时间
16
- - 依赖服务状态
7
+ summary: 健康检查
8
+ description: 综合健康检查,返回服务状态和时间戳
17
9
  responses:
18
10
  '200':
19
- description: 服务健康
20
- content:
21
- application/json:
22
- schema:
23
- $ref: '../components/schemas/_index.yaml#/HealthResponse'
24
- '503':
25
- description: 服务不健康
11
+ description: 健康
26
12
  content:
27
13
  application/json:
28
14
  schema:
29
- $ref: '../components/schemas/_index.yaml#/HealthResponse'
15
+ $ref: '../components/schemas/_index.yaml#/HealthCheckResponse'
30
16
  security: []
31
17
 
32
- ready:
18
+ live:
33
19
  get:
34
- tags:
35
- - Health
36
- summary: 就绪检查
37
- operationId: readinessCheck
38
- description: |
39
- Kubernetes readiness probe。
40
- 检查服务是否准备好接收流量。
20
+ tags: [Health]
21
+ operationId: livenessCheck
22
+ summary: 存活检查
23
+ description: Kubernetes liveness probe
41
24
  responses:
42
25
  '200':
43
- description: 服务就绪
26
+ description: 存活
44
27
  content:
45
28
  application/json:
46
29
  schema:
47
- type: object
48
- properties:
49
- ready:
50
- type: boolean
51
- example: true
52
- '503':
53
- description: 服务未就绪
54
- content:
55
- application/json:
56
- schema:
57
- type: object
58
- properties:
59
- ready:
60
- type: boolean
61
- example: false
62
- reason:
63
- type: string
30
+ $ref: '../components/schemas/_index.yaml#/LivenessResponse'
64
31
  security: []
65
32
 
66
- live:
33
+ ready:
67
34
  get:
68
- tags:
69
- - Health
70
- summary: 存活检查
71
- operationId: livenessCheck
72
- description: |
73
- Kubernetes liveness probe。
74
- 检查服务是否存活。
35
+ tags: [Health]
36
+ operationId: readinessCheck
37
+ summary: 就绪检查
38
+ description: Kubernetes readiness probe
75
39
  responses:
76
40
  '200':
77
- description: 服务存活
41
+ description: 就绪
78
42
  content:
79
43
  application/json:
80
44
  schema:
81
- type: object
82
- properties:
83
- alive:
84
- type: boolean
85
- example: true
86
- '503':
87
- description: 服务不存活
45
+ $ref: '../components/schemas/_index.yaml#/ReadinessResponse'
88
46
  security: []