blob: 24b88897fcb8b2d2fcb75d5d88ce4c2e14c46bb2 [file] [log] [blame]
刘洪青6aa11c92020-11-16 15:59:46 +08001# user-data-service-thirdparty-poa.v1.yaml
2#
3# 1. 创建服务
4# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services' -H 'Content-Type: application/json' -d '{"id": "userThirdparty", "origin": "http://user-data-service-poa-svc.user-data-service.svc.cluster.local:8080", "name": "用户服务(第三方应用)", "description": "用户服务(第三方应用)"}'
5# https://user-api.supwisdom.com
6#
7# 2. 创建版本
8# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/userThirdparty/apiVersions/v1'
9#
10# 3. 上传OAS Yaml
11# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/userThirdparty/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @user-data-service-thirdparty-poa.v1.yaml
12#
13# 4. 发布版本
14# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/userThirdparty/apiVersions/v1/publish'
15#
16openapi: 3.0.2
17info:
18 title: User Data Service (Third Party) Platform Open APIs
19 version: v1
20 description: '用户服务(第三方应用) - 平台开放接口'
21servers:
刘洪青6b495a42020-11-16 16:28:40 +080022 - url: '${POA_SERVER_URL}/apis/userThirdparty/v1'
23 description: '生产环境'
刘洪青6aa11c92020-11-16 15:59:46 +080024tags:
25 - name: AdminAppGroup
26 description: '应用的用户组(普通)管理'
27
28paths:
29
刘洪青d20fbbf2020-11-23 15:04:44 +080030 '/admin/application/{applicationId}/groups':
刘洪青6aa11c92020-11-16 15:59:46 +080031 post:
32 summary: 创建应用的用户组(普通)
33 operationId: createAppGroup
34 tags:
35 - AdminAppGroup
36 security:
37 - oauth2:
38 - "userThirdparty:v1:adminAppGroupWrite"
39 parameters:
40 - name: applicationId
41 in: path
42 required: true
43 description: 应用标识
44 schema:
45 type: string
46 requestBody:
47 description: 用户组(普通)创建请求
48 required: true
49 content:
50 application/json:
51 schema:
52 $ref: '#/components/schemas/AdminAppGroupCreateRequest'
53 responses:
54 '200':
55 description: 用户组(普通)创建响应
56 content:
57 application/json:
58 schema:
59 $ref: '#/components/schemas/AdminAppGroupCreateResponse'
60 default:
61 $ref: '#/components/responses/DefaultErrorResponse'
62
刘洪青d20fbbf2020-11-23 15:04:44 +080063 '/admin/application/{applicationId}/groups/{groupId}':
刘洪青6aa11c92020-11-16 15:59:46 +080064 get:
65 summary: 获取应用的用户组(普通)
66 operationId: getAppGroup
67 tags:
68 - AdminAppGroup
69 security:
70 - oauth2:
71 - "userThirdparty:v1:adminAppGroupWrite"
72 parameters:
73 - name: applicationId
74 in: path
75 required: true
76 description: 应用标识
77 schema:
78 type: string
79 - name: groupId
80 in: path
81 required: true
82 description: 用户组ID
83 schema:
84 type: string
85 responses:
86 '200':
87 description: 用户组(普通)获取响应
88 content:
89 application/json:
90 schema:
91 $ref: '#/components/schemas/AdminAppGroupGetResponse'
92 default:
93 $ref: '#/components/responses/DefaultErrorResponse'
94
95 put:
96 summary: 获取应用的用户组(普通)
97 operationId: updateAppGroup
98 tags:
99 - AdminAppGroup
100 security:
101 - oauth2:
102 - "userThirdparty:v1:adminAppGroupWrite"
103 parameters:
104 - name: applicationId
105 in: path
106 required: true
107 description: 应用标识
108 schema:
109 type: string
110 - name: groupId
111 in: path
112 required: true
113 description: 用户组ID
114 schema:
115 type: string
116 requestBody:
117 description: 用户组(普通)更新请求
118 required: true
119 content:
120 application/json:
121 schema:
122 $ref: '#/components/schemas/AdminAppGroupUpdateRequest'
123 responses:
124 '200':
125 description: 用户组(普通)获取响应
126 content:
127 application/json:
128 schema:
129 $ref: '#/components/schemas/AdminAppGroupUpdateResponse'
130 default:
131 $ref: '#/components/responses/DefaultErrorResponse'
132
133 delete:
134 summary: 删除应用的用户组(普通)
135 operationId: deleteAppGroup
136 tags:
137 - AdminAppGroup
138 security:
139 - oauth2:
140 - "userThirdparty:v1:adminAppGroupWrite"
141 parameters:
142 - name: applicationId
143 in: path
144 required: true
145 description: 应用标识
146 schema:
147 type: string
148 - name: groupId
149 in: path
150 required: true
151 description: 用户组ID
152 schema:
153 type: string
154 responses:
155 '200':
156 description: 用户组(普通)删除响应
157 content:
158 application/json:
159 schema:
160 $ref: '#/components/schemas/AdminAppGroupDeleteResponse'
161 default:
162 $ref: '#/components/responses/DefaultErrorResponse'
163
164
刘洪青d20fbbf2020-11-23 15:04:44 +0800165 '/admin/application/{applicationId}/groups/{groupId}/accounts':
刘洪青6aa11c92020-11-16 15:59:46 +0800166 post:
167 summary: 关联应用的用户组(普通)帐号
168 operationId: relateAppGroupAccounts
169 tags:
170 - AdminAppGroup
171 security:
172 - oauth2:
173 - "userThirdparty:v1:adminAppGroupWrite"
174 parameters:
175 - name: applicationId
176 in: path
177 required: true
178 description: 应用标识
179 schema:
180 type: string
181 - name: groupId
182 in: path
183 required: true
184 description: 用户组ID
185 schema:
186 type: string
187 requestBody:
188 description: 用户组(普通)关联帐号请求
189 required: true
190 content:
191 application/json:
192 schema:
193 $ref: '#/components/schemas/AdminAppGroupRelateAccountsRequest'
194 responses:
195 '200':
196 description: 用户组(普通)关联帐号响应
197 content:
198 application/json:
199 schema:
200 $ref: '#/components/schemas/AdminAppGroupRelateAccountsResponse'
201 default:
202 $ref: '#/components/responses/DefaultErrorResponse'
203
204
205components:
206
207 # Security Schemes
208
209 securitySchemes:
210 oauth2:
211 type: oauth2
212 flows:
213 clientCredentials:
刘洪青6b495a42020-11-16 16:28:40 +0800214 tokenUrl: ${POA_SERVER_URL}/oauth2/token
刘洪青6aa11c92020-11-16 15:59:46 +0800215 scopes:
216 "userThirdparty:v1:adminAppGroupWrite": "写入应用的用户组(普通)"
217
218
219 responses:
220 'ErrorResponse400':
221 description: unexpected error
222 content:
223 application/json:
224 schema:
225 $ref: '#/components/schemas/ErrorResponse'
226
227 DefaultErrorResponse:
228 description: unexpected error
229 content:
230 application/json:
231 schema:
232 $ref: '#/components/schemas/ErrorResponse'
233
234
235 schemas:
236
237 # Error
238
239 ErrorResponse:
240 title: '异常响应'
刘洪青f3b5fc82021-01-11 23:54:40 +0800241 type: object
刘洪青6aa11c92020-11-16 15:59:46 +0800242 required:
243 - code
244 - message
245 properties:
246 code:
247 title: 异常代码
248 type: integer
249 format: int32
250 default: -1
251 message:
252 title: 异常信息
253 type: string
254 default: "未知错误"
255
256
257 # Entity
258
259 BaseEntity:
260 title: 实体 - 基类
261 type: object
262 properties:
263 id:
264 title: ID
265 type: string
266
267 # DictionaryType:
268 # title: 实体 - 字典
269 # allOf:
270 # - $ref: '#/components/schemas/BaseEntity'
271 # - type: object
272 # title: 实体属性
273 # properties:
274 # code:
275 # title: 代码
276 # type: string
277 # name:
278 # title: 名称
279 # type: string
280 # enable:
281 # title: 是否启用
282 # type: boolean
283 # default: true
284 # sort:
285 # title: 排序
286 # type: integer
287 # format: int64
288 # multiLevel:
289 # title: 是否多层级
290 # type: boolean
291
292 Dictionary:
293 title: 实体 - 字典
294 allOf:
295 - $ref: '#/components/schemas/BaseEntity'
296 - type: object
297 title: 实体属性
298 properties:
299 code:
300 title: 代码
301 type: string
302 name:
303 title: 名称
304 type: string
305 enable:
306 title: 是否启用
307 type: boolean
308 default: true
309 sort:
310 title: 排序
311 type: integer
312 format: int64
313 # dictionaryType:
314 # title: 字典类型
315 # allOf:
316 # - $ref: '#/components/schemas/DictionaryType'
317 # parentDictionary:
318 # title: 父字典
319 # allOf:
320 # - $ref: '#/components/schemas/Dictionary'
321
322
323 Group:
324 title: 实体 - 用户组
325 allOf:
326 - $ref: '#/components/schemas/BaseEntity'
327 - type: object
328 title: 实体属性
329 properties:
330 code:
331 title: 代码
332 type: string
333 name:
334 title: 名称
335 type: string
336 description:
337 title: 描述
338 type: string
339 type:
340 title: 类型
341 type: string
342 state:
刘洪青d1970c22020-11-24 17:26:11 +0800343 title: 状态(1:启用,0:禁用)
刘洪青6aa11c92020-11-16 15:59:46 +0800344 type: integer
345 format: int32
346 sort:
347 title: 排序
348 type: integer
349 format: int32
350 isDataCenter:
351 title: 是否来源数据中心
352 type: boolean
353 common:
354 title: 是否公共
355 type: boolean
356 category:
357 title: 类别
358 allOf:
359 - $ref: '#/components/schemas/Dictionary'
360 applicationId:
361 title: 所属应用标识
362 type: string
363 businessDomainId:
364 title: 所属业务域ID
365 type: string
366 systemId:
367 title: 所属系统ID
368 type: string
369
370
371 # Request VO
372 AdminAppGroupCreateRequest:
373 title: 用户组(普通)创建请求
刘洪青f3b5fc82021-01-11 23:54:40 +0800374 type: object
刘洪青6aa11c92020-11-16 15:59:46 +0800375 properties:
376 code:
377 title: 代码
378 type: string
379 name:
380 title: 名称
381 type: string
382 description:
383 title: 描述
384 type: string
385 state:
刘洪青d1970c22020-11-24 17:26:11 +0800386 title: 状态(1:启用,0:禁用)
刘洪青6aa11c92020-11-16 15:59:46 +0800387 type: integer
388 format: int32
389 categoryCode:
390 title: 类别(字典代码)
391 type: string
392
393
394 AdminAppGroupUpdateRequest:
395 title: 用户组(普通)更新请求
刘洪青f3b5fc82021-01-11 23:54:40 +0800396 type: object
刘洪青6aa11c92020-11-16 15:59:46 +0800397 properties:
398 code:
399 title: 代码
400 type: string
401 name:
402 title: 名称
403 type: string
404 description:
405 title: 描述
406 type: string
407 state:
刘洪青d1970c22020-11-24 17:26:11 +0800408 title: 状态(1:启用,0:禁用)
刘洪青6aa11c92020-11-16 15:59:46 +0800409 type: integer
410 format: int32
411 categoryCode:
412 title: 类别(字典代码)
413 type: string
414
415
416 AdminAppGroupRelateAccountsRequest:
417 title: 用户组(普通)关联帐号请求
刘洪青f3b5fc82021-01-11 23:54:40 +0800418 type: object
刘洪青6aa11c92020-11-16 15:59:46 +0800419 properties:
420 addAccountIds:
421 title: 添加的帐号IDs
422 type: array
423 items:
424 title: 账号Id
425 type: string
426 delAccountIds:
427 title: 移除的帐号IDs
428 type: array
429 items:
430 title: 账号Id
431 type: string
432
433
434 # Response VO
435
436 AbstractApiResponse:
437 title: 响应
刘洪青f3b5fc82021-01-11 23:54:40 +0800438 type: object
刘洪青6aa11c92020-11-16 15:59:46 +0800439 properties:
440 code:
441 title: 响应代码
442 type: integer
443 format: int32
444 default: 0
445 message:
446 title: 响应信息
447 type: string
448 DefaultApiResponse:
449 allOf:
450 - $ref: '#/components/schemas/AbstractApiResponse'
451 - type: object
452 title: 响应数据
453 properties:
454 data:
455 title: 响应数据
456 type: object
457
458
459
460 AdminAppGroupGetResponse:
461 allOf:
462 - $ref: '#/components/schemas/DefaultApiResponse'
463 - type: object
464 title: 响应数据
465 properties:
466 data:
467 allOf:
468 - type: object
469 title: 结果
470 properties:
471 message:
472 title: 结果说明
473 type: string
474 group:
475 title: 用户组(普通)
476 allOf:
477 - $ref: '#/components/schemas/Group'
478
479 AdminAppGroupCreateResponse:
480 allOf:
481 - $ref: '#/components/schemas/DefaultApiResponse'
482 - type: object
483 title: 响应数据
484 properties:
485 data:
486 allOf:
487 - type: object
488 title: 结果
489 properties:
490 message:
491 title: 结果说明
492 type: string
493 group:
494 title: 用户组(普通)
495 allOf:
496 - $ref: '#/components/schemas/Group'
497
498 AdminAppGroupUpdateResponse:
499 allOf:
500 - $ref: '#/components/schemas/DefaultApiResponse'
501 - type: object
502 title: 响应数据
503 properties:
504 data:
505 allOf:
506 - type: object
507 title: 结果
508 properties:
509 message:
510 title: 结果说明
511 type: string
512 group:
513 title: 用户组(普通)
514 allOf:
515 - $ref: '#/components/schemas/Group'
516
517
518 AdminAppGroupDeleteResponse:
519 allOf:
520 - $ref: '#/components/schemas/DefaultApiResponse'
521 - type: object
522 title: 响应数据
523 properties:
524 data:
525 allOf:
526 - type: object
527 title: 结果
528 properties:
529 message:
530 title: 结果说明
531 type: string
532
533
534 AdminAppGroupRelateAccountsResponse:
535 allOf:
536 - $ref: '#/components/schemas/DefaultApiResponse'
537 - type: object
538 title: 响应数据
539 properties:
540 data:
541 allOf:
542 - type: object
543 title: 结果
544 properties:
545 message:
546 title: 结果说明
547 type: string
548