swagger.json 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  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": "string",
  295. "description": "车次",
  296. "name": "trainNumber",
  297. "in": "query"
  298. }
  299. ],
  300. "responses": {
  301. "200": {
  302. "description": "成功",
  303. "schema": {
  304. "allOf": [
  305. {
  306. "$ref": "#/definitions/util.ResponseList"
  307. },
  308. {
  309. "type": "object",
  310. "properties": {
  311. "data": {
  312. "type": "array",
  313. "items": {
  314. "$ref": "#/definitions/models.Audio"
  315. }
  316. }
  317. }
  318. }
  319. ]
  320. }
  321. }
  322. }
  323. }
  324. },
  325. "/api-sa/v1/audio/process": {
  326. "post": {
  327. "produces": [
  328. "application/json"
  329. ],
  330. "tags": [
  331. "音频"
  332. ],
  333. "summary": "处理音频",
  334. "parameters": [
  335. {
  336. "description": "参数",
  337. "name": "object",
  338. "in": "body",
  339. "required": true,
  340. "schema": {
  341. "$ref": "#/definitions/request.ProcessAudio"
  342. }
  343. }
  344. ],
  345. "responses": {
  346. "200": {
  347. "description": "成功",
  348. "schema": {
  349. "$ref": "#/definitions/util.Response"
  350. }
  351. }
  352. }
  353. }
  354. },
  355. "/api-sa/v1/audio/trainInfoList": {
  356. "get": {
  357. "produces": [
  358. "application/json"
  359. ],
  360. "tags": [
  361. "音频"
  362. ],
  363. "summary": "获取火车信息",
  364. "parameters": [
  365. {
  366. "enum": [
  367. 1,
  368. 2,
  369. 3
  370. ],
  371. "type": "integer",
  372. "x-enum-comments": {
  373. "ClassLocomotive": "机车",
  374. "ClassStation": "车站",
  375. "ClassTrain": "车次"
  376. },
  377. "x-enum-varnames": [
  378. "ClassLocomotive",
  379. "ClassTrain",
  380. "ClassStation"
  381. ],
  382. "description": "信息分类 1机车2车次3车站",
  383. "name": "class",
  384. "in": "query"
  385. },
  386. {
  387. "type": "integer",
  388. "description": "页码",
  389. "name": "page",
  390. "in": "query"
  391. },
  392. {
  393. "type": "integer",
  394. "description": "每页大小",
  395. "name": "pageSize",
  396. "in": "query"
  397. },
  398. {
  399. "type": "integer",
  400. "description": "上级id",
  401. "name": "parentID",
  402. "in": "query"
  403. }
  404. ],
  405. "responses": {
  406. "200": {
  407. "description": "成功",
  408. "schema": {
  409. "allOf": [
  410. {
  411. "$ref": "#/definitions/util.ResponseList"
  412. },
  413. {
  414. "type": "object",
  415. "properties": {
  416. "data": {
  417. "type": "array",
  418. "items": {
  419. "$ref": "#/definitions/models.TrainInfo"
  420. }
  421. }
  422. }
  423. }
  424. ]
  425. }
  426. }
  427. }
  428. }
  429. },
  430. "/api-sa/v1/audio/upload": {
  431. "post": {
  432. "produces": [
  433. "application/json"
  434. ],
  435. "tags": [
  436. "音频"
  437. ],
  438. "summary": "上传音频",
  439. "parameters": [
  440. {
  441. "type": "file",
  442. "description": "音频文件",
  443. "name": "file",
  444. "in": "formData",
  445. "required": true
  446. }
  447. ],
  448. "responses": {
  449. "200": {
  450. "description": "成功",
  451. "schema": {
  452. "$ref": "#/definitions/util.Response"
  453. }
  454. }
  455. }
  456. }
  457. },
  458. "/api-sa/v1/text/add": {
  459. "post": {
  460. "produces": [
  461. "application/json"
  462. ],
  463. "tags": [
  464. "文字库"
  465. ],
  466. "summary": "新增文字",
  467. "parameters": [
  468. {
  469. "description": "参数",
  470. "name": "object",
  471. "in": "body",
  472. "required": true,
  473. "schema": {
  474. "$ref": "#/definitions/request.AddTextReq"
  475. }
  476. }
  477. ],
  478. "responses": {
  479. "200": {
  480. "description": "成功",
  481. "schema": {
  482. "$ref": "#/definitions/util.Response"
  483. }
  484. }
  485. }
  486. }
  487. },
  488. "/api-sa/v1/text/list": {
  489. "get": {
  490. "produces": [
  491. "application/json"
  492. ],
  493. "tags": [
  494. "文字库"
  495. ],
  496. "summary": "文字库列表",
  497. "parameters": [
  498. {
  499. "type": "string",
  500. "description": "关键字",
  501. "name": "keyword",
  502. "in": "query"
  503. },
  504. {
  505. "type": "integer",
  506. "description": "页码",
  507. "name": "page",
  508. "in": "query"
  509. },
  510. {
  511. "type": "integer",
  512. "description": "每页大小",
  513. "name": "pageSize",
  514. "in": "query"
  515. }
  516. ],
  517. "responses": {
  518. "200": {
  519. "description": "成功",
  520. "schema": {
  521. "allOf": [
  522. {
  523. "$ref": "#/definitions/util.ResponseList"
  524. },
  525. {
  526. "type": "object",
  527. "properties": {
  528. "data": {
  529. "type": "array",
  530. "items": {
  531. "$ref": "#/definitions/models.Word"
  532. }
  533. }
  534. }
  535. }
  536. ]
  537. }
  538. }
  539. }
  540. }
  541. }
  542. },
  543. "definitions": {
  544. "constvar.AudioStatus": {
  545. "type": "integer",
  546. "enum": [
  547. 0,
  548. 1,
  549. 2,
  550. 3,
  551. 4
  552. ],
  553. "x-enum-comments": {
  554. "AudioStatusFailed": "处理失败",
  555. "AudioStatusFinish": "处理完成",
  556. "AudioStatusProcessing": "处理中",
  557. "AudioStatusUploadOk": "上传成功 待处理",
  558. "AudioStatusUploading": "上传中"
  559. },
  560. "x-enum-varnames": [
  561. "AudioStatusUploading",
  562. "AudioStatusUploadOk",
  563. "AudioStatusProcessing",
  564. "AudioStatusFinish",
  565. "AudioStatusFailed"
  566. ]
  567. },
  568. "constvar.BoolType": {
  569. "type": "integer",
  570. "enum": [
  571. 1,
  572. 2
  573. ],
  574. "x-enum-comments": {
  575. "BoolTypeFalse": "false",
  576. "BoolTypeTrue": "true"
  577. },
  578. "x-enum-varnames": [
  579. "BoolTypeTrue",
  580. "BoolTypeFalse"
  581. ]
  582. },
  583. "constvar.Class": {
  584. "type": "integer",
  585. "enum": [
  586. 1,
  587. 2,
  588. 3
  589. ],
  590. "x-enum-comments": {
  591. "ClassLocomotive": "机车",
  592. "ClassStation": "车站",
  593. "ClassTrain": "车次"
  594. },
  595. "x-enum-varnames": [
  596. "ClassLocomotive",
  597. "ClassTrain",
  598. "ClassStation"
  599. ]
  600. },
  601. "gorm.DeletedAt": {
  602. "type": "object",
  603. "properties": {
  604. "time": {
  605. "type": "string"
  606. },
  607. "valid": {
  608. "description": "Valid is true if Time is not NULL",
  609. "type": "boolean"
  610. }
  611. }
  612. },
  613. "models.Audio": {
  614. "type": "object",
  615. "properties": {
  616. "audioStatus": {
  617. "description": "音频状态",
  618. "allOf": [
  619. {
  620. "$ref": "#/definitions/constvar.AudioStatus"
  621. }
  622. ]
  623. },
  624. "audioText": {
  625. "description": "解析出的文本",
  626. "type": "string"
  627. },
  628. "createdAt": {
  629. "type": "string"
  630. },
  631. "deletedAt": {
  632. "$ref": "#/definitions/gorm.DeletedAt"
  633. },
  634. "driverNumber": {
  635. "description": "司机号",
  636. "type": "string"
  637. },
  638. "id": {
  639. "type": "integer"
  640. },
  641. "isFollowed": {
  642. "description": "是否关注 1关注 2未关注",
  643. "allOf": [
  644. {
  645. "$ref": "#/definitions/constvar.BoolType"
  646. }
  647. ]
  648. },
  649. "locomotiveNumber": {
  650. "description": "机车号",
  651. "type": "string"
  652. },
  653. "name": {
  654. "description": "音频名称",
  655. "type": "string"
  656. },
  657. "occurrenceTime": {
  658. "type": "string"
  659. },
  660. "score": {
  661. "description": "置信度",
  662. "type": "number"
  663. },
  664. "size": {
  665. "description": "音频大小",
  666. "type": "integer"
  667. },
  668. "station": {
  669. "description": "车站",
  670. "type": "string"
  671. },
  672. "trainNumber": {
  673. "description": "车次",
  674. "type": "string"
  675. },
  676. "updatedAt": {
  677. "type": "string"
  678. },
  679. "words": {
  680. "description": "匹配到的文字数组",
  681. "type": "array",
  682. "items": {
  683. "type": "string"
  684. }
  685. }
  686. }
  687. },
  688. "models.TrainInfo": {
  689. "type": "object",
  690. "properties": {
  691. "class": {
  692. "description": "分类 1 机车 2车次 3 车站",
  693. "allOf": [
  694. {
  695. "$ref": "#/definitions/constvar.Class"
  696. }
  697. ]
  698. },
  699. "createdAt": {
  700. "type": "string"
  701. },
  702. "deletedAt": {
  703. "$ref": "#/definitions/gorm.DeletedAt"
  704. },
  705. "id": {
  706. "type": "integer"
  707. },
  708. "name": {
  709. "description": "名称",
  710. "type": "string"
  711. },
  712. "parentID": {
  713. "description": "上级id",
  714. "type": "integer"
  715. },
  716. "updatedAt": {
  717. "type": "string"
  718. }
  719. }
  720. },
  721. "models.Word": {
  722. "type": "object",
  723. "properties": {
  724. "content": {
  725. "description": "文字",
  726. "type": "string"
  727. },
  728. "createdAt": {
  729. "type": "string"
  730. },
  731. "deletedAt": {
  732. "$ref": "#/definitions/gorm.DeletedAt"
  733. },
  734. "id": {
  735. "type": "integer"
  736. },
  737. "locomotiveNumber": {
  738. "description": "机车号",
  739. "type": "string"
  740. },
  741. "updatedAt": {
  742. "type": "string"
  743. }
  744. }
  745. },
  746. "request.AddTextReq": {
  747. "type": "object",
  748. "required": [
  749. "content",
  750. "locomotiveNumber"
  751. ],
  752. "properties": {
  753. "content": {
  754. "description": "音频名称",
  755. "type": "string"
  756. },
  757. "locomotiveNumber": {
  758. "description": "机车号",
  759. "type": "string"
  760. }
  761. }
  762. },
  763. "request.BatchProcessAudio": {
  764. "type": "object",
  765. "required": [
  766. "ids"
  767. ],
  768. "properties": {
  769. "ids": {
  770. "type": "array",
  771. "items": {
  772. "type": "integer"
  773. }
  774. }
  775. }
  776. },
  777. "request.FollowReq": {
  778. "type": "object",
  779. "required": [
  780. "id"
  781. ],
  782. "properties": {
  783. "id": {
  784. "type": "integer"
  785. }
  786. }
  787. },
  788. "request.ProcessAudio": {
  789. "type": "object",
  790. "required": [
  791. "id"
  792. ],
  793. "properties": {
  794. "id": {
  795. "type": "integer"
  796. }
  797. }
  798. },
  799. "response.FollowResp": {
  800. "type": "object",
  801. "properties": {
  802. "followStatus": {
  803. "description": "1 已关注 2未关注",
  804. "allOf": [
  805. {
  806. "$ref": "#/definitions/constvar.BoolType"
  807. }
  808. ]
  809. }
  810. }
  811. },
  812. "util.Response": {
  813. "type": "object",
  814. "properties": {
  815. "code": {
  816. "type": "integer"
  817. },
  818. "data": {},
  819. "msg": {
  820. "type": "string"
  821. }
  822. }
  823. },
  824. "util.ResponseList": {
  825. "type": "object",
  826. "properties": {
  827. "code": {
  828. "type": "integer"
  829. },
  830. "data": {},
  831. "msg": {
  832. "type": "string"
  833. },
  834. "page": {
  835. "type": "integer"
  836. },
  837. "pageSize": {
  838. "type": "integer"
  839. },
  840. "total": {
  841. "type": "integer"
  842. }
  843. }
  844. }
  845. }
  846. }