swagger.json 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "contact": {}
  5. },
  6. "paths": {
  7. "/api-sa/v1/audio/batchDelete": {
  8. "delete": {
  9. "produces": [
  10. "application/json"
  11. ],
  12. "tags": [
  13. "音频"
  14. ],
  15. "summary": "批量删除音频",
  16. "parameters": [
  17. {
  18. "description": "参数",
  19. "name": "object",
  20. "in": "body",
  21. "required": true,
  22. "schema": {
  23. "$ref": "#/definitions/request.BatchProcessAudio"
  24. }
  25. }
  26. ],
  27. "responses": {
  28. "200": {
  29. "description": "成功",
  30. "schema": {
  31. "$ref": "#/definitions/util.Response"
  32. }
  33. }
  34. }
  35. }
  36. },
  37. "/api-sa/v1/audio/batchProcess": {
  38. "post": {
  39. "produces": [
  40. "application/json"
  41. ],
  42. "tags": [
  43. "音频"
  44. ],
  45. "summary": "批量处理音频",
  46. "parameters": [
  47. {
  48. "description": "参数",
  49. "name": "object",
  50. "in": "body",
  51. "required": true,
  52. "schema": {
  53. "$ref": "#/definitions/request.BatchProcessAudio"
  54. }
  55. }
  56. ],
  57. "responses": {
  58. "200": {
  59. "description": "成功",
  60. "schema": {
  61. "$ref": "#/definitions/util.Response"
  62. }
  63. }
  64. }
  65. }
  66. },
  67. "/api-sa/v1/audio/delete": {
  68. "delete": {
  69. "produces": [
  70. "application/json"
  71. ],
  72. "tags": [
  73. "音频"
  74. ],
  75. "summary": "删除音频",
  76. "parameters": [
  77. {
  78. "description": "参数",
  79. "name": "object",
  80. "in": "body",
  81. "required": true,
  82. "schema": {
  83. "$ref": "#/definitions/request.ProcessAudio"
  84. }
  85. }
  86. ],
  87. "responses": {
  88. "200": {
  89. "description": "成功",
  90. "schema": {
  91. "$ref": "#/definitions/util.Response"
  92. }
  93. }
  94. }
  95. }
  96. },
  97. "/api-sa/v1/audio/download": {
  98. "get": {
  99. "produces": [
  100. "application/json"
  101. ],
  102. "tags": [
  103. "音频"
  104. ],
  105. "summary": "音频下载",
  106. "parameters": [
  107. {
  108. "type": "integer",
  109. "name": "id",
  110. "in": "query",
  111. "required": true
  112. }
  113. ],
  114. "responses": {
  115. "200": {
  116. "description": "成功",
  117. "schema": {
  118. "allOf": [
  119. {
  120. "$ref": "#/definitions/util.Response"
  121. },
  122. {
  123. "type": "object",
  124. "properties": {
  125. "data": {
  126. "$ref": "#/definitions/models.Audio"
  127. }
  128. }
  129. }
  130. ]
  131. }
  132. }
  133. }
  134. }
  135. },
  136. "/api-sa/v1/audio/follow": {
  137. "post": {
  138. "produces": [
  139. "application/json"
  140. ],
  141. "tags": [
  142. "音频"
  143. ],
  144. "summary": "关注/取消关注",
  145. "parameters": [
  146. {
  147. "description": "参数",
  148. "name": "object",
  149. "in": "body",
  150. "required": true,
  151. "schema": {
  152. "$ref": "#/definitions/request.FollowReq"
  153. }
  154. }
  155. ],
  156. "responses": {
  157. "200": {
  158. "description": "成功",
  159. "schema": {
  160. "allOf": [
  161. {
  162. "$ref": "#/definitions/util.Response"
  163. },
  164. {
  165. "type": "object",
  166. "properties": {
  167. "data": {
  168. "$ref": "#/definitions/response.FollowResp"
  169. }
  170. }
  171. }
  172. ]
  173. }
  174. }
  175. }
  176. }
  177. },
  178. "/api-sa/v1/audio/info": {
  179. "get": {
  180. "produces": [
  181. "application/json"
  182. ],
  183. "tags": [
  184. "音频"
  185. ],
  186. "summary": "音频详情,含解析结果",
  187. "parameters": [
  188. {
  189. "type": "integer",
  190. "name": "id",
  191. "in": "query",
  192. "required": true
  193. }
  194. ],
  195. "responses": {
  196. "200": {
  197. "description": "成功",
  198. "schema": {
  199. "allOf": [
  200. {
  201. "$ref": "#/definitions/util.Response"
  202. },
  203. {
  204. "type": "object",
  205. "properties": {
  206. "data": {
  207. "$ref": "#/definitions/models.Audio"
  208. }
  209. }
  210. }
  211. ]
  212. }
  213. }
  214. }
  215. }
  216. },
  217. "/api-sa/v1/audio/list": {
  218. "get": {
  219. "produces": [
  220. "application/json"
  221. ],
  222. "tags": [
  223. "音频"
  224. ],
  225. "summary": "音频分析检索",
  226. "parameters": [
  227. {
  228. "type": "string",
  229. "description": "开始时间",
  230. "name": "beginTime",
  231. "in": "query"
  232. },
  233. {
  234. "type": "string",
  235. "description": "司机号",
  236. "name": "driverNumber",
  237. "in": "query"
  238. },
  239. {
  240. "type": "string",
  241. "description": "结束时间",
  242. "name": "endTime",
  243. "in": "query"
  244. },
  245. {
  246. "enum": [
  247. 1,
  248. 2
  249. ],
  250. "type": "integer",
  251. "x-enum-comments": {
  252. "BoolTypeFalse": "false",
  253. "BoolTypeTrue": "true"
  254. },
  255. "x-enum-varnames": [
  256. "BoolTypeTrue",
  257. "BoolTypeFalse"
  258. ],
  259. "description": "是否关注 1关注 2未关注",
  260. "name": "isFollowed",
  261. "in": "query"
  262. },
  263. {
  264. "type": "string",
  265. "description": "关键字",
  266. "name": "keyword",
  267. "in": "query"
  268. },
  269. {
  270. "type": "string",
  271. "description": "机车号",
  272. "name": "locomotiveNumber",
  273. "in": "query"
  274. },
  275. {
  276. "type": "integer",
  277. "description": "页码",
  278. "name": "page",
  279. "in": "query"
  280. },
  281. {
  282. "type": "integer",
  283. "description": "每页大小",
  284. "name": "pageSize",
  285. "in": "query"
  286. },
  287. {
  288. "type": "string",
  289. "description": "车站号",
  290. "name": "stationNumber",
  291. "in": "query"
  292. },
  293. {
  294. "type": "array",
  295. "items": {
  296. "enum": [
  297. 0,
  298. 1,
  299. 2,
  300. 3,
  301. 4
  302. ],
  303. "type": "integer"
  304. },
  305. "collectionFormat": "csv",
  306. "description": "音频状态数组",
  307. "name": "statusList",
  308. "in": "query"
  309. },
  310. {
  311. "type": "string",
  312. "description": "车次",
  313. "name": "trainNumber",
  314. "in": "query"
  315. }
  316. ],
  317. "responses": {
  318. "200": {
  319. "description": "成功",
  320. "schema": {
  321. "allOf": [
  322. {
  323. "$ref": "#/definitions/util.ResponseList"
  324. },
  325. {
  326. "type": "object",
  327. "properties": {
  328. "data": {
  329. "type": "array",
  330. "items": {
  331. "$ref": "#/definitions/models.Audio"
  332. }
  333. }
  334. }
  335. }
  336. ]
  337. }
  338. }
  339. }
  340. }
  341. },
  342. "/api-sa/v1/audio/process": {
  343. "post": {
  344. "produces": [
  345. "application/json"
  346. ],
  347. "tags": [
  348. "音频"
  349. ],
  350. "summary": "处理音频",
  351. "parameters": [
  352. {
  353. "description": "参数",
  354. "name": "object",
  355. "in": "body",
  356. "required": true,
  357. "schema": {
  358. "$ref": "#/definitions/request.ProcessAudio"
  359. }
  360. }
  361. ],
  362. "responses": {
  363. "200": {
  364. "description": "成功",
  365. "schema": {
  366. "$ref": "#/definitions/util.Response"
  367. }
  368. }
  369. }
  370. }
  371. },
  372. "/api-sa/v1/audio/trainInfoList": {
  373. "get": {
  374. "produces": [
  375. "application/json"
  376. ],
  377. "tags": [
  378. "音频"
  379. ],
  380. "summary": "获取火车信息",
  381. "parameters": [
  382. {
  383. "enum": [
  384. 1,
  385. 2,
  386. 3
  387. ],
  388. "type": "integer",
  389. "x-enum-comments": {
  390. "ClassLocomotive": "机车",
  391. "ClassStation": "车站",
  392. "ClassTrain": "车次"
  393. },
  394. "x-enum-varnames": [
  395. "ClassLocomotive",
  396. "ClassTrain",
  397. "ClassStation"
  398. ],
  399. "description": "信息分类 1机车2车次3车站",
  400. "name": "class",
  401. "in": "query"
  402. },
  403. {
  404. "type": "integer",
  405. "description": "页码",
  406. "name": "page",
  407. "in": "query"
  408. },
  409. {
  410. "type": "integer",
  411. "description": "每页大小",
  412. "name": "pageSize",
  413. "in": "query"
  414. },
  415. {
  416. "type": "integer",
  417. "description": "上级id",
  418. "name": "parentID",
  419. "in": "query"
  420. }
  421. ],
  422. "responses": {
  423. "200": {
  424. "description": "成功",
  425. "schema": {
  426. "allOf": [
  427. {
  428. "$ref": "#/definitions/util.ResponseList"
  429. },
  430. {
  431. "type": "object",
  432. "properties": {
  433. "data": {
  434. "type": "array",
  435. "items": {
  436. "$ref": "#/definitions/models.TrainInfo"
  437. }
  438. }
  439. }
  440. }
  441. ]
  442. }
  443. }
  444. }
  445. }
  446. },
  447. "/api-sa/v1/audio/upload": {
  448. "post": {
  449. "produces": [
  450. "application/json"
  451. ],
  452. "tags": [
  453. "音频"
  454. ],
  455. "summary": "上传音频",
  456. "parameters": [
  457. {
  458. "type": "file",
  459. "description": "音频文件",
  460. "name": "file",
  461. "in": "formData"
  462. },
  463. {
  464. "type": "array",
  465. "items": {
  466. "type": "file"
  467. },
  468. "collectionFormat": "csv",
  469. "description": "多个音频文件",
  470. "name": "files",
  471. "in": "formData"
  472. }
  473. ],
  474. "responses": {
  475. "200": {
  476. "description": "成功",
  477. "schema": {
  478. "$ref": "#/definitions/util.Response"
  479. }
  480. }
  481. }
  482. }
  483. },
  484. "/api-sa/v1/text/add": {
  485. "post": {
  486. "produces": [
  487. "application/json"
  488. ],
  489. "tags": [
  490. "文字库"
  491. ],
  492. "summary": "新增文字",
  493. "parameters": [
  494. {
  495. "description": "参数",
  496. "name": "object",
  497. "in": "body",
  498. "required": true,
  499. "schema": {
  500. "$ref": "#/definitions/request.AddTextReq"
  501. }
  502. }
  503. ],
  504. "responses": {
  505. "200": {
  506. "description": "成功",
  507. "schema": {
  508. "$ref": "#/definitions/util.Response"
  509. }
  510. }
  511. }
  512. }
  513. },
  514. "/api-sa/v1/text/list": {
  515. "get": {
  516. "produces": [
  517. "application/json"
  518. ],
  519. "tags": [
  520. "文字库"
  521. ],
  522. "summary": "文字库列表",
  523. "parameters": [
  524. {
  525. "type": "string",
  526. "description": "关键字",
  527. "name": "keyword",
  528. "in": "query"
  529. },
  530. {
  531. "type": "integer",
  532. "description": "页码",
  533. "name": "page",
  534. "in": "query"
  535. },
  536. {
  537. "type": "integer",
  538. "description": "每页大小",
  539. "name": "pageSize",
  540. "in": "query"
  541. }
  542. ],
  543. "responses": {
  544. "200": {
  545. "description": "成功",
  546. "schema": {
  547. "allOf": [
  548. {
  549. "$ref": "#/definitions/util.ResponseList"
  550. },
  551. {
  552. "type": "object",
  553. "properties": {
  554. "data": {
  555. "type": "array",
  556. "items": {
  557. "$ref": "#/definitions/models.Word"
  558. }
  559. }
  560. }
  561. }
  562. ]
  563. }
  564. }
  565. }
  566. }
  567. }
  568. },
  569. "definitions": {
  570. "constvar.AudioStatus": {
  571. "type": "integer",
  572. "enum": [
  573. 0,
  574. 1,
  575. 2,
  576. 3,
  577. 4
  578. ],
  579. "x-enum-comments": {
  580. "AudioStatusFailed": "处理失败",
  581. "AudioStatusFinish": "处理完成",
  582. "AudioStatusProcessing": "处理中",
  583. "AudioStatusUploadOk": "上传成功 待处理",
  584. "AudioStatusUploading": "上传中"
  585. },
  586. "x-enum-varnames": [
  587. "AudioStatusUploading",
  588. "AudioStatusUploadOk",
  589. "AudioStatusProcessing",
  590. "AudioStatusFinish",
  591. "AudioStatusFailed"
  592. ]
  593. },
  594. "constvar.BoolType": {
  595. "type": "integer",
  596. "enum": [
  597. 1,
  598. 2
  599. ],
  600. "x-enum-comments": {
  601. "BoolTypeFalse": "false",
  602. "BoolTypeTrue": "true"
  603. },
  604. "x-enum-varnames": [
  605. "BoolTypeTrue",
  606. "BoolTypeFalse"
  607. ]
  608. },
  609. "constvar.Class": {
  610. "type": "integer",
  611. "enum": [
  612. 1,
  613. 2,
  614. 3
  615. ],
  616. "x-enum-comments": {
  617. "ClassLocomotive": "机车",
  618. "ClassStation": "车站",
  619. "ClassTrain": "车次"
  620. },
  621. "x-enum-varnames": [
  622. "ClassLocomotive",
  623. "ClassTrain",
  624. "ClassStation"
  625. ]
  626. },
  627. "gorm.DeletedAt": {
  628. "type": "object",
  629. "properties": {
  630. "time": {
  631. "type": "string"
  632. },
  633. "valid": {
  634. "description": "Valid is true if Time is not NULL",
  635. "type": "boolean"
  636. }
  637. }
  638. },
  639. "models.Audio": {
  640. "type": "object",
  641. "properties": {
  642. "audioStatus": {
  643. "description": "音频状态",
  644. "allOf": [
  645. {
  646. "$ref": "#/definitions/constvar.AudioStatus"
  647. }
  648. ]
  649. },
  650. "audioText": {
  651. "description": "解析出的文本",
  652. "type": "string"
  653. },
  654. "createdAt": {
  655. "type": "string"
  656. },
  657. "deletedAt": {
  658. "$ref": "#/definitions/gorm.DeletedAt"
  659. },
  660. "driverNumber": {
  661. "description": "司机号",
  662. "type": "string"
  663. },
  664. "id": {
  665. "type": "integer"
  666. },
  667. "isFollowed": {
  668. "description": "是否关注 1关注 2未关注",
  669. "allOf": [
  670. {
  671. "$ref": "#/definitions/constvar.BoolType"
  672. }
  673. ]
  674. },
  675. "locomotiveNumber": {
  676. "description": "机车号",
  677. "type": "string"
  678. },
  679. "name": {
  680. "description": "音频名称",
  681. "type": "string"
  682. },
  683. "occurrenceTime": {
  684. "type": "string"
  685. },
  686. "score": {
  687. "description": "置信度",
  688. "type": "number"
  689. },
  690. "size": {
  691. "description": "音频大小",
  692. "type": "integer"
  693. },
  694. "station": {
  695. "description": "车站",
  696. "type": "string"
  697. },
  698. "trainNumber": {
  699. "description": "车次",
  700. "type": "string"
  701. },
  702. "updatedAt": {
  703. "type": "string"
  704. },
  705. "words": {
  706. "description": "匹配到的文字数组",
  707. "type": "array",
  708. "items": {
  709. "type": "string"
  710. }
  711. }
  712. }
  713. },
  714. "models.TrainInfo": {
  715. "type": "object",
  716. "properties": {
  717. "class": {
  718. "description": "分类 1 机车 2车次 3 车站",
  719. "allOf": [
  720. {
  721. "$ref": "#/definitions/constvar.Class"
  722. }
  723. ]
  724. },
  725. "createdAt": {
  726. "type": "string"
  727. },
  728. "deletedAt": {
  729. "$ref": "#/definitions/gorm.DeletedAt"
  730. },
  731. "id": {
  732. "type": "integer"
  733. },
  734. "name": {
  735. "description": "名称",
  736. "type": "string"
  737. },
  738. "parentID": {
  739. "description": "上级id",
  740. "type": "integer"
  741. },
  742. "updatedAt": {
  743. "type": "string"
  744. }
  745. }
  746. },
  747. "models.Word": {
  748. "type": "object",
  749. "properties": {
  750. "content": {
  751. "description": "文字",
  752. "type": "string"
  753. },
  754. "createdAt": {
  755. "type": "string"
  756. },
  757. "deletedAt": {
  758. "$ref": "#/definitions/gorm.DeletedAt"
  759. },
  760. "id": {
  761. "type": "integer"
  762. },
  763. "locomotiveNumber": {
  764. "description": "机车号",
  765. "type": "string"
  766. },
  767. "updatedAt": {
  768. "type": "string"
  769. }
  770. }
  771. },
  772. "request.AddTextReq": {
  773. "type": "object",
  774. "required": [
  775. "content",
  776. "locomotiveNumber"
  777. ],
  778. "properties": {
  779. "content": {
  780. "description": "音频名称",
  781. "type": "string"
  782. },
  783. "locomotiveNumber": {
  784. "description": "机车号",
  785. "type": "string"
  786. }
  787. }
  788. },
  789. "request.BatchProcessAudio": {
  790. "type": "object",
  791. "required": [
  792. "ids"
  793. ],
  794. "properties": {
  795. "ids": {
  796. "type": "array",
  797. "items": {
  798. "type": "integer"
  799. }
  800. }
  801. }
  802. },
  803. "request.FollowReq": {
  804. "type": "object",
  805. "required": [
  806. "id"
  807. ],
  808. "properties": {
  809. "id": {
  810. "type": "integer"
  811. }
  812. }
  813. },
  814. "request.ProcessAudio": {
  815. "type": "object",
  816. "required": [
  817. "id"
  818. ],
  819. "properties": {
  820. "id": {
  821. "type": "integer"
  822. }
  823. }
  824. },
  825. "response.FollowResp": {
  826. "type": "object",
  827. "properties": {
  828. "followStatus": {
  829. "description": "1 已关注 2未关注",
  830. "allOf": [
  831. {
  832. "$ref": "#/definitions/constvar.BoolType"
  833. }
  834. ]
  835. }
  836. }
  837. },
  838. "util.Response": {
  839. "type": "object",
  840. "properties": {
  841. "code": {
  842. "type": "integer"
  843. },
  844. "data": {},
  845. "msg": {
  846. "type": "string"
  847. }
  848. }
  849. },
  850. "util.ResponseList": {
  851. "type": "object",
  852. "properties": {
  853. "code": {
  854. "type": "integer"
  855. },
  856. "data": {},
  857. "msg": {
  858. "type": "string"
  859. },
  860. "page": {
  861. "type": "integer"
  862. },
  863. "pageSize": {
  864. "type": "integer"
  865. },
  866. "total": {
  867. "type": "integer"
  868. }
  869. }
  870. }
  871. }
  872. }