swagger.json 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  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/preLoadPath": {
  353. "get": {
  354. "produces": [
  355. "application/json"
  356. ],
  357. "tags": [
  358. "音频自动加载路径"
  359. ],
  360. "summary": "音频自动加载路径",
  361. "responses": {
  362. "200": {
  363. "description": "成功",
  364. "schema": {
  365. "allOf": [
  366. {
  367. "$ref": "#/definitions/util.Response"
  368. },
  369. {
  370. "type": "object",
  371. "properties": {
  372. "data": {
  373. "$ref": "#/definitions/response.PreLoadPathResp"
  374. }
  375. }
  376. }
  377. ]
  378. }
  379. }
  380. }
  381. }
  382. },
  383. "/api-sa/v1/audio/process": {
  384. "post": {
  385. "produces": [
  386. "application/json"
  387. ],
  388. "tags": [
  389. "音频"
  390. ],
  391. "summary": "处理音频",
  392. "parameters": [
  393. {
  394. "description": "参数",
  395. "name": "object",
  396. "in": "body",
  397. "required": true,
  398. "schema": {
  399. "$ref": "#/definitions/request.ProcessAudio"
  400. }
  401. }
  402. ],
  403. "responses": {
  404. "200": {
  405. "description": "成功",
  406. "schema": {
  407. "$ref": "#/definitions/util.Response"
  408. }
  409. }
  410. }
  411. }
  412. },
  413. "/api-sa/v1/audio/trainInfoList": {
  414. "get": {
  415. "produces": [
  416. "application/json"
  417. ],
  418. "tags": [
  419. "音频"
  420. ],
  421. "summary": "获取火车信息",
  422. "parameters": [
  423. {
  424. "enum": [
  425. 1,
  426. 2,
  427. 3
  428. ],
  429. "type": "integer",
  430. "x-enum-comments": {
  431. "ClassLocomotive": "机车",
  432. "ClassStation": "车站",
  433. "ClassTrain": "车次"
  434. },
  435. "x-enum-varnames": [
  436. "ClassLocomotive",
  437. "ClassTrain",
  438. "ClassStation"
  439. ],
  440. "description": "信息分类 1机车2车次3车站",
  441. "name": "class",
  442. "in": "query"
  443. },
  444. {
  445. "type": "integer",
  446. "description": "页码",
  447. "name": "page",
  448. "in": "query"
  449. },
  450. {
  451. "type": "integer",
  452. "description": "每页大小",
  453. "name": "pageSize",
  454. "in": "query"
  455. },
  456. {
  457. "type": "integer",
  458. "description": "上级id",
  459. "name": "parentID",
  460. "in": "query"
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "成功",
  466. "schema": {
  467. "allOf": [
  468. {
  469. "$ref": "#/definitions/util.ResponseList"
  470. },
  471. {
  472. "type": "object",
  473. "properties": {
  474. "data": {
  475. "type": "array",
  476. "items": {
  477. "$ref": "#/definitions/models.TrainInfo"
  478. }
  479. }
  480. }
  481. }
  482. ]
  483. }
  484. }
  485. }
  486. }
  487. },
  488. "/api-sa/v1/audio/upload": {
  489. "post": {
  490. "consumes": [
  491. "multipart/form-data"
  492. ],
  493. "produces": [
  494. "application/json"
  495. ],
  496. "tags": [
  497. "音频"
  498. ],
  499. "summary": "上传音频",
  500. "parameters": [
  501. {
  502. "type": "array",
  503. "items": {
  504. "type": "file"
  505. },
  506. "collectionFormat": "csv",
  507. "description": "多文件上传",
  508. "name": "file",
  509. "in": "formData"
  510. }
  511. ],
  512. "responses": {
  513. "200": {
  514. "description": "成功",
  515. "schema": {
  516. "$ref": "#/definitions/util.Response"
  517. }
  518. }
  519. }
  520. }
  521. },
  522. "/api-sa/v1/text/add": {
  523. "post": {
  524. "produces": [
  525. "application/json"
  526. ],
  527. "tags": [
  528. "文字库"
  529. ],
  530. "summary": "新增文字",
  531. "parameters": [
  532. {
  533. "description": "参数",
  534. "name": "object",
  535. "in": "body",
  536. "required": true,
  537. "schema": {
  538. "$ref": "#/definitions/request.AddTextReq"
  539. }
  540. }
  541. ],
  542. "responses": {
  543. "200": {
  544. "description": "成功",
  545. "schema": {
  546. "$ref": "#/definitions/util.Response"
  547. }
  548. }
  549. }
  550. }
  551. },
  552. "/api-sa/v1/text/delete": {
  553. "delete": {
  554. "produces": [
  555. "application/json"
  556. ],
  557. "tags": [
  558. "文字库"
  559. ],
  560. "summary": "修改文字",
  561. "parameters": [
  562. {
  563. "description": "参数",
  564. "name": "object",
  565. "in": "body",
  566. "required": true,
  567. "schema": {
  568. "$ref": "#/definitions/request.AddTextReq"
  569. }
  570. }
  571. ],
  572. "responses": {
  573. "200": {
  574. "description": "成功",
  575. "schema": {
  576. "$ref": "#/definitions/util.Response"
  577. }
  578. }
  579. }
  580. }
  581. },
  582. "/api-sa/v1/text/list": {
  583. "get": {
  584. "produces": [
  585. "application/json"
  586. ],
  587. "tags": [
  588. "文字库"
  589. ],
  590. "summary": "文字库列表",
  591. "parameters": [
  592. {
  593. "type": "string",
  594. "description": "关键字",
  595. "name": "keyword",
  596. "in": "query"
  597. },
  598. {
  599. "type": "integer",
  600. "description": "页码",
  601. "name": "page",
  602. "in": "query"
  603. },
  604. {
  605. "type": "integer",
  606. "description": "每页大小",
  607. "name": "pageSize",
  608. "in": "query"
  609. }
  610. ],
  611. "responses": {
  612. "200": {
  613. "description": "成功",
  614. "schema": {
  615. "allOf": [
  616. {
  617. "$ref": "#/definitions/util.ResponseList"
  618. },
  619. {
  620. "type": "object",
  621. "properties": {
  622. "data": {
  623. "type": "array",
  624. "items": {
  625. "$ref": "#/definitions/models.Word"
  626. }
  627. }
  628. }
  629. }
  630. ]
  631. }
  632. }
  633. }
  634. }
  635. },
  636. "/api-sa/v1/text/update": {
  637. "post": {
  638. "produces": [
  639. "application/json"
  640. ],
  641. "tags": [
  642. "文字库"
  643. ],
  644. "summary": "修改文字",
  645. "parameters": [
  646. {
  647. "description": "参数",
  648. "name": "object",
  649. "in": "body",
  650. "required": true,
  651. "schema": {
  652. "$ref": "#/definitions/request.AddTextReq"
  653. }
  654. }
  655. ],
  656. "responses": {
  657. "200": {
  658. "description": "成功",
  659. "schema": {
  660. "$ref": "#/definitions/util.Response"
  661. }
  662. }
  663. }
  664. }
  665. }
  666. },
  667. "definitions": {
  668. "constvar.AudioStatus": {
  669. "type": "integer",
  670. "enum": [
  671. 0,
  672. 1,
  673. 2,
  674. 3,
  675. 4
  676. ],
  677. "x-enum-comments": {
  678. "AudioStatusFailed": "处理失败",
  679. "AudioStatusFinish": "处理完成",
  680. "AudioStatusProcessing": "处理中",
  681. "AudioStatusUploadOk": "上传成功 待处理",
  682. "AudioStatusUploading": "上传中"
  683. },
  684. "x-enum-varnames": [
  685. "AudioStatusUploading",
  686. "AudioStatusUploadOk",
  687. "AudioStatusProcessing",
  688. "AudioStatusFinish",
  689. "AudioStatusFailed"
  690. ]
  691. },
  692. "constvar.BoolType": {
  693. "type": "integer",
  694. "enum": [
  695. 1,
  696. 2
  697. ],
  698. "x-enum-comments": {
  699. "BoolTypeFalse": "false",
  700. "BoolTypeTrue": "true"
  701. },
  702. "x-enum-varnames": [
  703. "BoolTypeTrue",
  704. "BoolTypeFalse"
  705. ]
  706. },
  707. "constvar.Class": {
  708. "type": "integer",
  709. "enum": [
  710. 1,
  711. 2,
  712. 3
  713. ],
  714. "x-enum-comments": {
  715. "ClassLocomotive": "机车",
  716. "ClassStation": "车站",
  717. "ClassTrain": "车次"
  718. },
  719. "x-enum-varnames": [
  720. "ClassLocomotive",
  721. "ClassTrain",
  722. "ClassStation"
  723. ]
  724. },
  725. "gorm.DeletedAt": {
  726. "type": "object",
  727. "properties": {
  728. "time": {
  729. "type": "string"
  730. },
  731. "valid": {
  732. "description": "Valid is true if Time is not NULL",
  733. "type": "boolean"
  734. }
  735. }
  736. },
  737. "models.Audio": {
  738. "type": "object",
  739. "properties": {
  740. "audioStatus": {
  741. "description": "音频状态",
  742. "allOf": [
  743. {
  744. "$ref": "#/definitions/constvar.AudioStatus"
  745. }
  746. ]
  747. },
  748. "audioText": {
  749. "description": "解析出的文本",
  750. "type": "string"
  751. },
  752. "createdAt": {
  753. "type": "string"
  754. },
  755. "deletedAt": {
  756. "$ref": "#/definitions/gorm.DeletedAt"
  757. },
  758. "driverNumber": {
  759. "description": "司机号",
  760. "type": "string"
  761. },
  762. "id": {
  763. "type": "integer"
  764. },
  765. "isFollowed": {
  766. "description": "是否关注 1关注 2未关注",
  767. "allOf": [
  768. {
  769. "$ref": "#/definitions/constvar.BoolType"
  770. }
  771. ]
  772. },
  773. "kilometerMarker": {
  774. "description": "公里标",
  775. "type": "string"
  776. },
  777. "locomotiveNumber": {
  778. "description": "机车号",
  779. "type": "string"
  780. },
  781. "name": {
  782. "description": "音频名称",
  783. "type": "string"
  784. },
  785. "occurrenceTime": {
  786. "type": "string"
  787. },
  788. "routeNumber": {
  789. "description": "交路号",
  790. "type": "string"
  791. },
  792. "score": {
  793. "description": "置信度",
  794. "type": "number"
  795. },
  796. "size": {
  797. "description": "音频大小",
  798. "type": "integer"
  799. },
  800. "station": {
  801. "description": "车站",
  802. "type": "string"
  803. },
  804. "trainNumber": {
  805. "description": "车次",
  806. "type": "string"
  807. },
  808. "updatedAt": {
  809. "type": "string"
  810. },
  811. "words": {
  812. "description": "匹配到的文字数组",
  813. "type": "array",
  814. "items": {
  815. "type": "string"
  816. }
  817. }
  818. }
  819. },
  820. "models.TrainInfo": {
  821. "type": "object",
  822. "properties": {
  823. "class": {
  824. "description": "分类 1 机车 2车次 3 车站",
  825. "allOf": [
  826. {
  827. "$ref": "#/definitions/constvar.Class"
  828. }
  829. ]
  830. },
  831. "createdAt": {
  832. "type": "string"
  833. },
  834. "deletedAt": {
  835. "$ref": "#/definitions/gorm.DeletedAt"
  836. },
  837. "id": {
  838. "type": "integer"
  839. },
  840. "name": {
  841. "description": "名称",
  842. "type": "string"
  843. },
  844. "parentID": {
  845. "description": "上级id",
  846. "type": "integer"
  847. },
  848. "updatedAt": {
  849. "type": "string"
  850. }
  851. }
  852. },
  853. "models.Word": {
  854. "type": "object",
  855. "properties": {
  856. "content": {
  857. "description": "文字",
  858. "type": "string"
  859. },
  860. "createdAt": {
  861. "type": "string"
  862. },
  863. "deletedAt": {
  864. "$ref": "#/definitions/gorm.DeletedAt"
  865. },
  866. "id": {
  867. "type": "integer"
  868. },
  869. "locomotiveNumber": {
  870. "description": "机车号",
  871. "type": "string"
  872. },
  873. "updatedAt": {
  874. "type": "string"
  875. }
  876. }
  877. },
  878. "request.AddTextReq": {
  879. "type": "object",
  880. "required": [
  881. "content",
  882. "locomotiveNumber"
  883. ],
  884. "properties": {
  885. "content": {
  886. "description": "音频名称",
  887. "type": "string"
  888. },
  889. "id": {
  890. "type": "integer"
  891. },
  892. "locomotiveNumber": {
  893. "description": "机车号",
  894. "type": "string"
  895. }
  896. }
  897. },
  898. "request.BatchProcessAudio": {
  899. "type": "object",
  900. "required": [
  901. "ids"
  902. ],
  903. "properties": {
  904. "ids": {
  905. "type": "array",
  906. "items": {
  907. "type": "integer"
  908. }
  909. }
  910. }
  911. },
  912. "request.FollowReq": {
  913. "type": "object",
  914. "required": [
  915. "id"
  916. ],
  917. "properties": {
  918. "id": {
  919. "type": "integer"
  920. }
  921. }
  922. },
  923. "request.ProcessAudio": {
  924. "type": "object",
  925. "required": [
  926. "id"
  927. ],
  928. "properties": {
  929. "fileType": {
  930. "type": "integer"
  931. },
  932. "id": {
  933. "type": "integer"
  934. }
  935. }
  936. },
  937. "response.FollowResp": {
  938. "type": "object",
  939. "properties": {
  940. "followStatus": {
  941. "description": "1 已关注 2未关注",
  942. "allOf": [
  943. {
  944. "$ref": "#/definitions/constvar.BoolType"
  945. }
  946. ]
  947. }
  948. }
  949. },
  950. "response.PreLoadPathResp": {
  951. "type": "object",
  952. "properties": {
  953. "preLoadPath": {
  954. "type": "string"
  955. }
  956. }
  957. },
  958. "util.Response": {
  959. "type": "object",
  960. "properties": {
  961. "code": {
  962. "type": "integer"
  963. },
  964. "data": {},
  965. "msg": {
  966. "type": "string"
  967. }
  968. }
  969. },
  970. "util.ResponseList": {
  971. "type": "object",
  972. "properties": {
  973. "code": {
  974. "type": "integer"
  975. },
  976. "data": {},
  977. "msg": {
  978. "type": "string"
  979. },
  980. "page": {
  981. "type": "integer"
  982. },
  983. "pageSize": {
  984. "type": "integer"
  985. },
  986. "total": {
  987. "type": "integer"
  988. }
  989. }
  990. }
  991. }
  992. }