6
0

swagger.yml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  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. /LearningQuestion.Get:
  272. post:
  273. tags:
  274. - 考试培训-题库
  275. operationId: LearningQuestionGet
  276. summary: 题库详情
  277. requestBody:
  278. required: true
  279. content:
  280. application/json:
  281. schema:
  282. oneOf:
  283. - $ref: '#/components/schemas/IdReq'
  284. examples:
  285. LearningQuestionGet:
  286. $ref: '#/components/examples/LearningQuestionGet'
  287. responses:
  288. 200:
  289. description: 请求成功
  290. content:
  291. application/json:
  292. examples:
  293. success:
  294. $ref: "#/components/examples/success"
  295. /LearningQuestion.List:
  296. post:
  297. tags:
  298. - 考试培训-题库
  299. operationId: LearningQuestionList
  300. summary: 查询题库
  301. requestBody:
  302. required: true
  303. content:
  304. application/json:
  305. schema:
  306. oneOf:
  307. - $ref: '#/components/schemas/LearningQuestionList'
  308. examples:
  309. LearningQuestionList:
  310. $ref: '#/components/examples/LearningQuestionList'
  311. responses:
  312. 200:
  313. description: 请求成功
  314. content:
  315. application/json:
  316. examples:
  317. success:
  318. $ref: "#/components/examples/success"
  319. /LearningQuestion.Add:
  320. post:
  321. tags:
  322. - 考试培训-题库
  323. operationId: LearningQuestionAdd
  324. summary: 添加题库
  325. requestBody:
  326. required: true
  327. content:
  328. application/json:
  329. schema:
  330. oneOf:
  331. - $ref: '#/components/schemas/LearningQuestionAdd'
  332. examples:
  333. LearningQuestionAdd:
  334. $ref: '#/components/examples/LearningQuestionAdd'
  335. responses:
  336. 200:
  337. description: 请求成功
  338. content:
  339. application/json:
  340. examples:
  341. success:
  342. $ref: "#/components/examples/success"
  343. /LearningQuestion.Update:
  344. post:
  345. tags:
  346. - 考试培训-题库
  347. operationId: LearningQuestionUpdate
  348. summary: 更新题库
  349. requestBody:
  350. required: true
  351. content:
  352. application/json:
  353. schema:
  354. oneOf:
  355. - $ref: '#/components/schemas/LearningQuestionUpdate'
  356. examples:
  357. LearningQuestionUpdate:
  358. $ref: '#/components/examples/LearningQuestionUpdate'
  359. responses:
  360. 200:
  361. description: 请求成功
  362. content:
  363. application/json:
  364. examples:
  365. success:
  366. $ref: "#/components/examples/success"
  367. /LearningQuestion.Delete:
  368. post:
  369. tags:
  370. - 考试培训-题库
  371. operationId: LearningQuestionDelete
  372. summary: 删除题库
  373. requestBody:
  374. required: true
  375. content:
  376. application/json:
  377. schema:
  378. oneOf:
  379. - $ref: '#/components/schemas/IdReq'
  380. examples:
  381. LearningQuestionDelete:
  382. $ref: '#/components/examples/LearningQuestionDelete'
  383. responses:
  384. 200:
  385. description: 请求成功
  386. content:
  387. application/json:
  388. examples:
  389. success:
  390. $ref: "#/components/examples/success"
  391. # 添加这个 swagger ui 会显示授权按钮
  392. security:
  393. - bearerAuth: []
  394. components:
  395. securitySchemes:
  396. basicAuth:
  397. type: http
  398. scheme: basic
  399. bearerAuth:
  400. type: http
  401. scheme: bearer
  402. schemas:
  403. Nullable:
  404. type: object
  405. required:
  406. - Str
  407. - Int
  408. - Bool
  409. - Slice
  410. properties:
  411. Str:
  412. type: string
  413. description: 字符串参数
  414. Int:
  415. type: integer
  416. description: Int 参数
  417. Bool:
  418. type: boolean
  419. description: Bool 参数
  420. Slice:
  421. type: array
  422. description: Slice 参数
  423. items:
  424. type: integer
  425. NoArgs:
  426. type: object
  427. properties:
  428. noargs:
  429. type: string
  430. description: 无参数,但是 body 中必须传输一个 json 空对象 "{}"
  431. LearningSkillGet:
  432. properties:
  433. id:
  434. type: string
  435. description: 技能 id
  436. name:
  437. type: string
  438. description: 技能名称
  439. LearningSkillAdd:
  440. properties:
  441. instrumentId:
  442. type: string
  443. description: 技能关联的设备 id
  444. name:
  445. type: string
  446. description: 技能名称
  447. LearningSkillUpdate:
  448. required:
  449. - id
  450. properties:
  451. id:
  452. type: string
  453. description: 技能 id
  454. instrumentId:
  455. type: string
  456. description: 技能关联的设备 id
  457. name:
  458. type: string
  459. description: 技能名称
  460. IdReq:
  461. type: object
  462. required:
  463. - id
  464. properties:
  465. id:
  466. type: integer
  467. description: ID
  468. LearningMaterialList:
  469. type: object
  470. properties:
  471. page:
  472. type: object
  473. description: 分页信息,不传默认不分页,返回所有数据
  474. properties:
  475. current:
  476. type: integer
  477. description: 当前页面
  478. size:
  479. type: integer
  480. description: 每页条数
  481. orderBy:
  482. type: object
  483. description: 排序
  484. properties:
  485. type:
  486. type: string
  487. description: 排序方式
  488. enum:
  489. - asc
  490. - desc
  491. value:
  492. type: string
  493. description: 字段名
  494. skillId:
  495. type: integer
  496. description: 按技能 Id 查询
  497. name:
  498. type: string
  499. description: 按资料名称模糊查询
  500. LearningMaterialGet:
  501. type: object
  502. properties:
  503. id:
  504. type: string
  505. description: 资料 id
  506. name:
  507. type: string
  508. description: 资料名称
  509. LearningMaterialAdd:
  510. type: object
  511. required:
  512. - skillId
  513. - name
  514. - type
  515. - enable
  516. properties:
  517. skillId:
  518. type: integer
  519. description: 技能 Id
  520. name:
  521. type: string
  522. description: 资料名称
  523. type:
  524. type: integer
  525. description: 资料类型 1 资料 2 视频
  526. sortNo:
  527. type: integer
  528. description: 排序
  529. enable:
  530. type: integer
  531. description: 是否启用 0 未启用 1 启用
  532. content:
  533. type: string
  534. description: 资料内容
  535. file:
  536. type: array
  537. description: 附件
  538. items:
  539. type: object
  540. properties:
  541. name:
  542. type: string
  543. description: 文件名
  544. url:
  545. type: string
  546. description: 文件地址
  547. size:
  548. type: string
  549. description: 文件大小
  550. extend:
  551. type: string
  552. description: 文件扩展名
  553. LearningMaterialUpdate:
  554. type: object
  555. required:
  556. - id
  557. properties:
  558. id:
  559. type: integer
  560. description: 资料 id
  561. skillId:
  562. type: integer
  563. description: 技能 Id
  564. name:
  565. type: string
  566. description: 资料名称
  567. type:
  568. type: integer
  569. description: 资料类型 1 资料 2 视频
  570. sortNo:
  571. type: integer
  572. description: 排序
  573. enable:
  574. type: integer
  575. description: 是否启用 0 未启用 1 启用
  576. content:
  577. type: string
  578. description: 资料内容
  579. file:
  580. type: array
  581. description: 附件
  582. items:
  583. type: object
  584. properties:
  585. name:
  586. type: string
  587. description: 文件名
  588. url:
  589. type: string
  590. description: 文件地址
  591. size:
  592. type: string
  593. description: 文件大小
  594. extend:
  595. type: string
  596. description: 文件扩展名
  597. LearningQuestionList:
  598. type: object
  599. properties:
  600. page:
  601. type: object
  602. description: 分页信息,不传默认不分页,返回所有数据
  603. properties:
  604. current:
  605. type: integer
  606. description: 当前页面
  607. size:
  608. type: integer
  609. description: 每页条数
  610. orderBy:
  611. type: object
  612. description: 排序
  613. properties:
  614. type:
  615. type: string
  616. description: 排序方式
  617. enum:
  618. - asc
  619. - desc
  620. value:
  621. type: string
  622. description: 字段名
  623. skillId:
  624. type: integer
  625. description: 按技能 Id 查询
  626. name:
  627. type: string
  628. description: 按题目名称模糊查询
  629. LearningQuestionAdd:
  630. type: object
  631. required:
  632. - skillId
  633. - name
  634. - type
  635. - content
  636. properties:
  637. skillId:
  638. type: integer
  639. description: 技能 Id
  640. name:
  641. type: string
  642. description: 题目名称
  643. type:
  644. type: integer
  645. description: 题型 1 单选 2 多选 3 判断
  646. enable:
  647. type: integer
  648. description: 是否启用 0 未启用 1 启用
  649. content:
  650. type: array
  651. description: 选项
  652. items:
  653. type: object
  654. properties:
  655. name:
  656. type: string
  657. description: 选项
  658. content:
  659. type: string
  660. description: 内容
  661. isCorrect:
  662. type: boolean
  663. description: 是否是答案
  664. explanation:
  665. type: string
  666. description: 题目解析
  667. LearningQuestionUpdate:
  668. type: object
  669. required:
  670. - id
  671. properties:
  672. id:
  673. type: integer
  674. description: 题目 id
  675. skillId:
  676. type: integer
  677. description: 技能 Id
  678. name:
  679. type: string
  680. description: 题目名称
  681. type:
  682. type: integer
  683. description: 题型 1 单选 2 多选 3 判断
  684. enable:
  685. type: integer
  686. description: 是否启用 0 未启用 1 启用
  687. content:
  688. type: array
  689. description: 选项
  690. items:
  691. type: object
  692. properties:
  693. name:
  694. type: string
  695. description: 选项
  696. content:
  697. type: string
  698. description: 内容
  699. isCorrect:
  700. type: boolean
  701. description: 是否是答案
  702. explanation:
  703. type: string
  704. description: 题目解析
  705. examples:
  706. success:
  707. summary: 请求成功
  708. value:
  709. code: 200,
  710. msg: "success"
  711. NullableReqAllPass:
  712. value:
  713. Str: ""
  714. Int: 0
  715. Bool: false
  716. Slice: []
  717. NoArgs:
  718. value:
  719. noargs: ""
  720. LearningSkillGet:
  721. value:
  722. Id: 1
  723. LearningSkillAdd:
  724. value:
  725. name: 测试
  726. instrumentId: [1,2]
  727. LearningSkillUpdate:
  728. value:
  729. name: 测试更新
  730. instrumentId: [3,4]
  731. id: 1
  732. LearningSkillDelete:
  733. value:
  734. id: 1
  735. LearningMaterialList:
  736. value:
  737. page:
  738. current: 2
  739. size: 2
  740. orderBy:
  741. type: desc
  742. value: id
  743. skillId: 2
  744. name: "测试"
  745. LearningMaterialGet:
  746. value:
  747. id: 1
  748. LearningMaterialAdd:
  749. value:
  750. skillId: 2
  751. name: 测试 1
  752. type: 2
  753. sortNo:
  754. enable: 1
  755. content: 测试
  756. file:
  757. -
  758. name: "1"
  759. url: 1.txt
  760. size: "1"
  761. extend: .txt
  762. -
  763. name: "2"
  764. url: 2.txt
  765. size: "2"
  766. extend: .txt
  767. LearningMaterialUpdate:
  768. value:
  769. id: 1
  770. skillId: 4
  771. name: 测试修改
  772. type: 1
  773. sortNo: 5
  774. enable: 0
  775. content: 测试修改
  776. file:
  777. -
  778. name: "3"
  779. url: 3.txt
  780. size: "3"
  781. extend: .txt
  782. -
  783. name: "4"
  784. url: 4.txt
  785. size: "4"
  786. extend: .txt
  787. LearningMaterialDelete:
  788. value:
  789. id: 1
  790. LearningQuestionGet:
  791. value:
  792. id: 1
  793. LearningQuestionList:
  794. value:
  795. page:
  796. current: 2
  797. size: 2
  798. orderBy:
  799. type: desc
  800. value: id
  801. skillId: 2
  802. name: "测试"
  803. LearningQuestionAdd:
  804. value:
  805. skillId: 2
  806. name: 测试
  807. type: 1
  808. enable: 1
  809. content:
  810. -
  811. name: A
  812. content: 测试A
  813. isCorrect: true
  814. -
  815. name: B
  816. content: 测试B
  817. isCorrect: false
  818. explanation: 测试
  819. LearningQuestionUpdate:
  820. value:
  821. id: 1
  822. skillId: 5
  823. name: 测试修改
  824. type: 2
  825. enable: 1
  826. content:
  827. -
  828. name: A
  829. content: 测试测试修改A
  830. isCorrect: true
  831. -
  832. name: B
  833. content: 测试测试修改B
  834. isCorrect: true
  835. explanation: 测试测试修改
  836. LearningQuestionDelete:
  837. value:
  838. id: 1