swagger.json 31 KB

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