swagger.yml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. openapi: 3.0.0
  2. info:
  3. title: learning
  4. description: 培训考试
  5. version: 0.0.1
  6. paths:
  7. /Test.Nullable:
  8. post:
  9. tags:
  10. - 测试
  11. operationId: Test.Nullable
  12. summary: 测试空值参数
  13. requestBody:
  14. required: true
  15. content:
  16. application/json:
  17. schema:
  18. oneOf:
  19. - $ref: '#/components/schemas/Nullable'
  20. examples:
  21. AllPass:
  22. $ref: '#/components/examples/NullableReqAllPass'
  23. responses:
  24. 200:
  25. description: 请求成功
  26. content:
  27. application/json:
  28. examples:
  29. success:
  30. $ref: "#/components/examples/success"
  31. /LearningSkill.List:
  32. post:
  33. tags:
  34. - 考试培训-技能
  35. operationId: LearningSkill.List
  36. summary: 技能列表
  37. requestBody:
  38. required: true
  39. content:
  40. application/json:
  41. schema:
  42. oneOf:
  43. - $ref: '#/components/schemas/NoArgs'
  44. examples:
  45. NoArgs:
  46. $ref: '#/components/examples/NoArgs'
  47. responses:
  48. 200:
  49. description: 请求成功
  50. content:
  51. application/json:
  52. examples:
  53. success:
  54. $ref: "#/components/examples/success"
  55. /LearningSkill.Get:
  56. post:
  57. tags:
  58. - 考试培训-技能
  59. operationId: LearningSkill.Get
  60. summary: 技能详情
  61. requestBody:
  62. required: true
  63. content:
  64. application/json:
  65. schema:
  66. oneOf:
  67. - $ref: '#/components/schemas/LearningSkillGet'
  68. examples:
  69. LearningSkillGet:
  70. $ref: '#/components/examples/LearningSkillGet'
  71. responses:
  72. 200:
  73. description: 请求成功
  74. content:
  75. application/json:
  76. examples:
  77. success:
  78. $ref: "#/components/examples/success"
  79. /LearningSkill.Add:
  80. post:
  81. tags:
  82. - 考试培训-技能
  83. operationId: LearningSkill.Add
  84. summary: 添加技能
  85. requestBody:
  86. required: true
  87. content:
  88. application/json:
  89. schema:
  90. oneOf:
  91. - $ref: '#/components/schemas/LearningSkillAdd'
  92. examples:
  93. LearningSkillAdd:
  94. $ref: '#/components/examples/LearningSkillAdd'
  95. responses:
  96. 200:
  97. description: 请求成功
  98. content:
  99. application/json:
  100. examples:
  101. success:
  102. $ref: "#/components/examples/success"
  103. /LearningSkill.Update:
  104. post:
  105. tags:
  106. - 考试培训-技能
  107. operationId: LearningSkill.Update
  108. summary: 更新技能
  109. requestBody:
  110. required: true
  111. content:
  112. application/json:
  113. schema:
  114. oneOf:
  115. - $ref: '#/components/schemas/LearningSkillUpdate'
  116. examples:
  117. LearningSkillUpdate:
  118. $ref: '#/components/examples/LearningSkillUpdate'
  119. responses:
  120. 200:
  121. description: 请求成功
  122. content:
  123. application/json:
  124. examples:
  125. success:
  126. $ref: "#/components/examples/success"
  127. /LearningSkill.Delete:
  128. post:
  129. tags:
  130. - 考试培训-技能
  131. operationId: LearningSkill.Delete
  132. summary: 删除技能
  133. requestBody:
  134. required: true
  135. content:
  136. application/json:
  137. schema:
  138. oneOf:
  139. - $ref: '#/components/schemas/IdReq'
  140. examples:
  141. LearningSkillDelete:
  142. $ref: '#/components/examples/LearningSkillDelete'
  143. responses:
  144. 200:
  145. description: 请求成功
  146. content:
  147. application/json:
  148. examples:
  149. success:
  150. $ref: "#/components/examples/success"
  151. /LearningMaterial.List:
  152. post:
  153. tags:
  154. - 考试培训-资料
  155. operationId: LearningMaterial.List
  156. summary: 查询资料
  157. requestBody:
  158. required: true
  159. content:
  160. application/json:
  161. schema:
  162. oneOf:
  163. - $ref: '#/components/schemas/LearningMaterialList'
  164. examples:
  165. LearningMaterialList:
  166. $ref: '#/components/examples/LearningMaterialList'
  167. responses:
  168. 200:
  169. description: 请求成功
  170. content:
  171. application/json:
  172. examples:
  173. success:
  174. $ref: "#/components/examples/success"
  175. /LearningMaterial.Get:
  176. post:
  177. tags:
  178. - 考试培训-资料
  179. operationId: LearningMaterialGet
  180. summary: 资料详情
  181. requestBody:
  182. required: true
  183. content:
  184. application/json:
  185. schema:
  186. oneOf:
  187. - $ref: '#/components/schemas/LearningMaterialGet'
  188. examples:
  189. LearningMaterialGet:
  190. $ref: '#/components/examples/LearningMaterialGet'
  191. responses:
  192. 200:
  193. description: 请求成功
  194. content:
  195. application/json:
  196. examples:
  197. success:
  198. $ref: "#/components/examples/success"
  199. /LearningMaterial.Add:
  200. post:
  201. tags:
  202. - 考试培训-资料
  203. operationId: LearningMaterialAdd
  204. summary: 添加资料
  205. requestBody:
  206. required: true
  207. content:
  208. application/json:
  209. schema:
  210. oneOf:
  211. - $ref: '#/components/schemas/LearningMaterialAdd'
  212. examples:
  213. LearningMaterialAdd:
  214. $ref: '#/components/examples/LearningMaterialAdd'
  215. responses:
  216. 200:
  217. description: 请求成功
  218. content:
  219. application/json:
  220. examples:
  221. success:
  222. $ref: "#/components/examples/success"
  223. /LearningMaterial.Update:
  224. post:
  225. tags:
  226. - 考试培训-资料
  227. operationId: LearningMaterialUpdate
  228. summary: 修改资料
  229. requestBody:
  230. required: true
  231. content:
  232. application/json:
  233. schema:
  234. oneOf:
  235. - $ref: '#/components/schemas/LearningMaterialUpdate'
  236. examples:
  237. LearningMaterialUpdate:
  238. $ref: '#/components/examples/LearningMaterialUpdate'
  239. responses:
  240. 200:
  241. description: 请求成功
  242. content:
  243. application/json:
  244. examples:
  245. success:
  246. $ref: "#/components/examples/success"
  247. /LearningMaterial.Delete:
  248. post:
  249. tags:
  250. - 考试培训-资料
  251. operationId: LearningMaterialDelete
  252. summary: 删除资料
  253. requestBody:
  254. required: true
  255. content:
  256. application/json:
  257. schema:
  258. oneOf:
  259. - $ref: '#/components/schemas/IdReq'
  260. examples:
  261. LearningMaterialDelete:
  262. $ref: '#/components/examples/LearningMaterialDelete'
  263. responses:
  264. 200:
  265. description: 请求成功
  266. content:
  267. application/json:
  268. examples:
  269. success:
  270. $ref: "#/components/examples/success"
  271. # 添加这个 swagger ui 会显示授权按钮
  272. security:
  273. - bearerAuth: []
  274. components:
  275. securitySchemes:
  276. basicAuth:
  277. type: http
  278. scheme: basic
  279. bearerAuth:
  280. type: http
  281. scheme: bearer
  282. schemas:
  283. Nullable:
  284. type: object
  285. required:
  286. - Str
  287. - Int
  288. - Bool
  289. - Slice
  290. properties:
  291. Str:
  292. type: string
  293. description: 字符串参数
  294. Int:
  295. type: integer
  296. description: Int 参数
  297. Bool:
  298. type: boolean
  299. description: Bool 参数
  300. Slice:
  301. type: array
  302. description: Slice 参数
  303. items:
  304. type: integer
  305. NoArgs:
  306. type: object
  307. properties:
  308. noargs:
  309. type: string
  310. description: 无参数,但是 body 中必须传输一个 json 空对象 "{}"
  311. LearningSkillGet:
  312. properties:
  313. id:
  314. type: string
  315. description: 技能 id
  316. name:
  317. type: string
  318. description: 技能名称
  319. LearningSkillAdd:
  320. properties:
  321. instrumentId:
  322. type: string
  323. description: 技能关联的设备 id
  324. name:
  325. type: string
  326. description: 技能名称
  327. LearningSkillUpdate:
  328. required:
  329. - id
  330. properties:
  331. id:
  332. type: string
  333. description: 技能 id
  334. instrumentId:
  335. type: string
  336. description: 技能关联的设备 id
  337. name:
  338. type: string
  339. description: 技能名称
  340. IdReq:
  341. type: object
  342. required:
  343. - id
  344. properties:
  345. id:
  346. type: integer
  347. description: ID
  348. LearningMaterialList:
  349. type: object
  350. required:
  351. - id
  352. properties:
  353. page:
  354. type: object
  355. description: 分页信息,不传默认不分页,返回所有数据
  356. properties:
  357. current:
  358. type: integer
  359. description: 当前页面
  360. size:
  361. type: integer
  362. description: 每页条数
  363. orderBy:
  364. type: object
  365. description: 排序
  366. properties:
  367. type:
  368. type: string
  369. description: 排序方式
  370. enum:
  371. - asc
  372. - desc
  373. value:
  374. type: string
  375. description: 字段名
  376. skillId:
  377. type: integer
  378. description: 按技能 Id 查询
  379. name:
  380. type: string
  381. description: 按资料名称模糊查询
  382. LearningMaterialGet:
  383. type: object
  384. properties:
  385. id:
  386. type: string
  387. description: 资料 id
  388. name:
  389. type: string
  390. description: 资料名称
  391. LearningMaterialAdd:
  392. type: object
  393. required:
  394. - skillId
  395. - name
  396. - type
  397. properties:
  398. skillId:
  399. type: integer
  400. description: 技能 Id
  401. name:
  402. type: string
  403. description: 资料名称
  404. type:
  405. type: integer
  406. description: 资料类型 1 资料 2 视频
  407. sortNo:
  408. type: integer
  409. description: 排序
  410. enable:
  411. type: integer
  412. description: 是否启用 0 未启用 1 启用
  413. content:
  414. type: string
  415. description: 资料内容
  416. file:
  417. type: array
  418. description: 附件
  419. items:
  420. type: object
  421. properties:
  422. name:
  423. type: string
  424. description: 文件名
  425. url:
  426. type: string
  427. description: 文件地址
  428. size:
  429. type: string
  430. description: 文件大小
  431. extend:
  432. type: string
  433. description: 文件扩展名
  434. LearningMaterialUpdate:
  435. type: object
  436. required:
  437. - id
  438. properties:
  439. id:
  440. type: integer
  441. description: 资料 id
  442. skillId:
  443. type: integer
  444. description: 技能 Id
  445. name:
  446. type: string
  447. description: 资料名称
  448. type:
  449. type: integer
  450. description: 资料类型 1 资料 2 视频
  451. sortNo:
  452. type: integer
  453. description: 排序
  454. enable:
  455. type: integer
  456. description: 是否启用 0 未启用 1 启用
  457. content:
  458. type: string
  459. description: 资料内容
  460. file:
  461. type: array
  462. description: 附件
  463. items:
  464. type: object
  465. properties:
  466. name:
  467. type: string
  468. description: 文件名
  469. url:
  470. type: string
  471. description: 文件地址
  472. size:
  473. type: string
  474. description: 文件大小
  475. extend:
  476. type: string
  477. description: 文件扩展名
  478. examples:
  479. success:
  480. summary: 请求成功
  481. value:
  482. code: 200,
  483. msg: "success"
  484. NullableReqAllPass:
  485. value:
  486. Str: ""
  487. Int: 0
  488. Bool: false
  489. Slice: []
  490. NoArgs:
  491. value:
  492. noargs: ""
  493. LearningSkillGet:
  494. value:
  495. Id: 1
  496. LearningSkillAdd:
  497. value:
  498. name: 测试
  499. instrumentId: [1,2]
  500. LearningSkillUpdate:
  501. value:
  502. name: 测试更新
  503. instrumentId: [3,4]
  504. id: 1
  505. LearningSkillDelete:
  506. value:
  507. id: 1
  508. LearningMaterialList:
  509. value:
  510. page:
  511. current: 2
  512. size: 2
  513. orderBy:
  514. type: desc
  515. value: id
  516. skillId: 2
  517. name: "测试"
  518. LearningMaterialGet:
  519. value:
  520. id: 1
  521. LearningMaterialAdd:
  522. value:
  523. skillId: 2
  524. name: 测试 1
  525. type: 2
  526. sortNo:
  527. enable: 1
  528. content: 测试
  529. file:
  530. -
  531. name: "1"
  532. url: 1.txt
  533. size: "1"
  534. extend: .txt
  535. -
  536. name: "2"
  537. url: 2.txt
  538. size: "2"
  539. extend: .txt
  540. LearningMaterialUpdate:
  541. value:
  542. id: 1
  543. skillId: 4
  544. name: 测试修改
  545. type: 1
  546. sortNo: 5
  547. enable: 0
  548. content: 测试修改
  549. file:
  550. -
  551. name: "3"
  552. url: 3.txt
  553. size: "3"
  554. extend: .txt
  555. -
  556. name: "4"
  557. url: 4.txt
  558. size: "4"
  559. extend: .txt
  560. LearningMaterialDelete:
  561. value:
  562. id: 1