swagger.json 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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/follow": {
  98. "post": {
  99. "produces": [
  100. "application/json"
  101. ],
  102. "tags": [
  103. "音频"
  104. ],
  105. "summary": "关注/取消关注",
  106. "parameters": [
  107. {
  108. "description": "参数",
  109. "name": "object",
  110. "in": "body",
  111. "required": true,
  112. "schema": {
  113. "$ref": "#/definitions/request.FollowReq"
  114. }
  115. }
  116. ],
  117. "responses": {
  118. "200": {
  119. "description": "成功",
  120. "schema": {
  121. "allOf": [
  122. {
  123. "$ref": "#/definitions/util.Response"
  124. },
  125. {
  126. "type": "object",
  127. "properties": {
  128. "data": {
  129. "$ref": "#/definitions/response.FollowResp"
  130. }
  131. }
  132. }
  133. ]
  134. }
  135. }
  136. }
  137. }
  138. },
  139. "/api-sa/v1/audio/info": {
  140. "get": {
  141. "produces": [
  142. "application/json"
  143. ],
  144. "tags": [
  145. "音频"
  146. ],
  147. "summary": "音频详情,含解析结果",
  148. "parameters": [
  149. {
  150. "type": "integer",
  151. "name": "id",
  152. "in": "query",
  153. "required": true
  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/models.Audio"
  169. }
  170. }
  171. }
  172. ]
  173. }
  174. }
  175. }
  176. }
  177. },
  178. "/api-sa/v1/audio/list": {
  179. "get": {
  180. "produces": [
  181. "application/json"
  182. ],
  183. "tags": [
  184. "音频"
  185. ],
  186. "summary": "音频分析检索",
  187. "parameters": [
  188. {
  189. "type": "string",
  190. "description": "司机号",
  191. "name": "driverNumber",
  192. "in": "query"
  193. },
  194. {
  195. "type": "string",
  196. "description": "关键字",
  197. "name": "keyword",
  198. "in": "query"
  199. },
  200. {
  201. "type": "string",
  202. "description": "机车号",
  203. "name": "locomotiveNumber",
  204. "in": "query"
  205. },
  206. {
  207. "type": "integer",
  208. "description": "页码",
  209. "name": "page",
  210. "in": "query"
  211. },
  212. {
  213. "type": "integer",
  214. "description": "每页大小",
  215. "name": "pageSize",
  216. "in": "query"
  217. },
  218. {
  219. "type": "string",
  220. "description": "车站号",
  221. "name": "stationNumber",
  222. "in": "query"
  223. },
  224. {
  225. "type": "string",
  226. "description": "车次",
  227. "name": "trainNumber",
  228. "in": "query"
  229. }
  230. ],
  231. "responses": {
  232. "200": {
  233. "description": "成功",
  234. "schema": {
  235. "allOf": [
  236. {
  237. "$ref": "#/definitions/util.ResponseList"
  238. },
  239. {
  240. "type": "object",
  241. "properties": {
  242. "data": {
  243. "type": "array",
  244. "items": {
  245. "$ref": "#/definitions/models.Audio"
  246. }
  247. }
  248. }
  249. }
  250. ]
  251. }
  252. }
  253. }
  254. }
  255. },
  256. "/api-sa/v1/audio/process": {
  257. "post": {
  258. "produces": [
  259. "application/json"
  260. ],
  261. "tags": [
  262. "音频"
  263. ],
  264. "summary": "处理音频",
  265. "parameters": [
  266. {
  267. "description": "参数",
  268. "name": "object",
  269. "in": "body",
  270. "required": true,
  271. "schema": {
  272. "$ref": "#/definitions/request.ProcessAudio"
  273. }
  274. }
  275. ],
  276. "responses": {
  277. "200": {
  278. "description": "成功",
  279. "schema": {
  280. "$ref": "#/definitions/util.Response"
  281. }
  282. }
  283. }
  284. }
  285. },
  286. "/api-sa/v1/audio/trainInfoList": {
  287. "get": {
  288. "produces": [
  289. "application/json"
  290. ],
  291. "tags": [
  292. "音频"
  293. ],
  294. "summary": "获取火车信息",
  295. "parameters": [
  296. {
  297. "enum": [
  298. 1,
  299. 2,
  300. 3
  301. ],
  302. "type": "integer",
  303. "x-enum-comments": {
  304. "ClassLocomotive": "机车",
  305. "ClassStation": "车站",
  306. "ClassTrain": "车次"
  307. },
  308. "x-enum-varnames": [
  309. "ClassLocomotive",
  310. "ClassTrain",
  311. "ClassStation"
  312. ],
  313. "description": "信息分类 1机车2车次3车站",
  314. "name": "class",
  315. "in": "query"
  316. },
  317. {
  318. "type": "integer",
  319. "description": "页码",
  320. "name": "page",
  321. "in": "query"
  322. },
  323. {
  324. "type": "integer",
  325. "description": "每页大小",
  326. "name": "pageSize",
  327. "in": "query"
  328. },
  329. {
  330. "type": "integer",
  331. "description": "上级id",
  332. "name": "parentID",
  333. "in": "query"
  334. }
  335. ],
  336. "responses": {
  337. "200": {
  338. "description": "成功",
  339. "schema": {
  340. "allOf": [
  341. {
  342. "$ref": "#/definitions/util.ResponseList"
  343. },
  344. {
  345. "type": "object",
  346. "properties": {
  347. "data": {
  348. "type": "array",
  349. "items": {
  350. "$ref": "#/definitions/models.TrainInfo"
  351. }
  352. }
  353. }
  354. }
  355. ]
  356. }
  357. }
  358. }
  359. }
  360. },
  361. "/api-sa/v1/audio/upload": {
  362. "post": {
  363. "produces": [
  364. "application/json"
  365. ],
  366. "tags": [
  367. "音频"
  368. ],
  369. "summary": "上传音频",
  370. "parameters": [
  371. {
  372. "type": "file",
  373. "description": "音频文件",
  374. "name": "file",
  375. "in": "formData",
  376. "required": true
  377. }
  378. ],
  379. "responses": {
  380. "200": {
  381. "description": "成功",
  382. "schema": {
  383. "$ref": "#/definitions/util.Response"
  384. }
  385. }
  386. }
  387. }
  388. },
  389. "/api-sa/v1/text/add": {
  390. "post": {
  391. "produces": [
  392. "application/json"
  393. ],
  394. "tags": [
  395. "文字库"
  396. ],
  397. "summary": "新增文字",
  398. "parameters": [
  399. {
  400. "description": "参数",
  401. "name": "object",
  402. "in": "body",
  403. "required": true,
  404. "schema": {
  405. "$ref": "#/definitions/request.AddTextReq"
  406. }
  407. }
  408. ],
  409. "responses": {
  410. "200": {
  411. "description": "成功",
  412. "schema": {
  413. "$ref": "#/definitions/util.Response"
  414. }
  415. }
  416. }
  417. }
  418. },
  419. "/api-sa/v1/text/list": {
  420. "get": {
  421. "produces": [
  422. "application/json"
  423. ],
  424. "tags": [
  425. "文字库"
  426. ],
  427. "summary": "文字库列表",
  428. "parameters": [
  429. {
  430. "type": "string",
  431. "description": "关键字",
  432. "name": "keyword",
  433. "in": "query"
  434. },
  435. {
  436. "type": "integer",
  437. "description": "页码",
  438. "name": "page",
  439. "in": "query"
  440. },
  441. {
  442. "type": "integer",
  443. "description": "每页大小",
  444. "name": "pageSize",
  445. "in": "query"
  446. }
  447. ],
  448. "responses": {
  449. "200": {
  450. "description": "成功",
  451. "schema": {
  452. "allOf": [
  453. {
  454. "$ref": "#/definitions/util.ResponseList"
  455. },
  456. {
  457. "type": "object",
  458. "properties": {
  459. "data": {
  460. "type": "array",
  461. "items": {
  462. "$ref": "#/definitions/models.Word"
  463. }
  464. }
  465. }
  466. }
  467. ]
  468. }
  469. }
  470. }
  471. }
  472. }
  473. },
  474. "definitions": {
  475. "constvar.AudioStatus": {
  476. "type": "integer",
  477. "enum": [
  478. 0,
  479. 1,
  480. 2,
  481. 3,
  482. 4
  483. ],
  484. "x-enum-comments": {
  485. "AudioStatusFailed": "处理失败",
  486. "AudioStatusFinish": "处理完成",
  487. "AudioStatusProcessing": "处理中",
  488. "AudioStatusUploadOk": "上传成功 待处理",
  489. "AudioStatusUploading": "上传中"
  490. },
  491. "x-enum-varnames": [
  492. "AudioStatusUploading",
  493. "AudioStatusUploadOk",
  494. "AudioStatusProcessing",
  495. "AudioStatusFinish",
  496. "AudioStatusFailed"
  497. ]
  498. },
  499. "constvar.BoolType": {
  500. "type": "integer",
  501. "enum": [
  502. 1,
  503. 2
  504. ],
  505. "x-enum-comments": {
  506. "BoolTypeFalse": "false",
  507. "BoolTypeTrue": "true"
  508. },
  509. "x-enum-varnames": [
  510. "BoolTypeTrue",
  511. "BoolTypeFalse"
  512. ]
  513. },
  514. "constvar.Class": {
  515. "type": "integer",
  516. "enum": [
  517. 1,
  518. 2,
  519. 3
  520. ],
  521. "x-enum-comments": {
  522. "ClassLocomotive": "机车",
  523. "ClassStation": "车站",
  524. "ClassTrain": "车次"
  525. },
  526. "x-enum-varnames": [
  527. "ClassLocomotive",
  528. "ClassTrain",
  529. "ClassStation"
  530. ]
  531. },
  532. "gorm.DeletedAt": {
  533. "type": "object",
  534. "properties": {
  535. "time": {
  536. "type": "string"
  537. },
  538. "valid": {
  539. "description": "Valid is true if Time is not NULL",
  540. "type": "boolean"
  541. }
  542. }
  543. },
  544. "models.Audio": {
  545. "type": "object",
  546. "properties": {
  547. "audioStatus": {
  548. "description": "音频状态",
  549. "allOf": [
  550. {
  551. "$ref": "#/definitions/constvar.AudioStatus"
  552. }
  553. ]
  554. },
  555. "audioText": {
  556. "description": "解析出的文本",
  557. "type": "string"
  558. },
  559. "createdAt": {
  560. "type": "string"
  561. },
  562. "deletedAt": {
  563. "$ref": "#/definitions/gorm.DeletedAt"
  564. },
  565. "driverNumber": {
  566. "description": "司机号",
  567. "type": "string"
  568. },
  569. "id": {
  570. "type": "integer"
  571. },
  572. "isFollowed": {
  573. "description": "是否关注 1关注 2未关注",
  574. "allOf": [
  575. {
  576. "$ref": "#/definitions/constvar.BoolType"
  577. }
  578. ]
  579. },
  580. "locomotiveNumber": {
  581. "description": "机车号",
  582. "type": "string"
  583. },
  584. "name": {
  585. "description": "音频名称",
  586. "type": "string"
  587. },
  588. "occurrenceTime": {
  589. "type": "string"
  590. },
  591. "score": {
  592. "description": "置信度",
  593. "type": "number"
  594. },
  595. "size": {
  596. "description": "音频大小",
  597. "type": "integer"
  598. },
  599. "station": {
  600. "description": "车站",
  601. "type": "string"
  602. },
  603. "trainNumber": {
  604. "description": "车次",
  605. "type": "string"
  606. },
  607. "updatedAt": {
  608. "type": "string"
  609. },
  610. "words": {
  611. "description": "匹配到的文字数组",
  612. "type": "array",
  613. "items": {
  614. "type": "string"
  615. }
  616. }
  617. }
  618. },
  619. "models.TrainInfo": {
  620. "type": "object",
  621. "properties": {
  622. "class": {
  623. "description": "分类 1 机车 2车次 3 车站",
  624. "allOf": [
  625. {
  626. "$ref": "#/definitions/constvar.Class"
  627. }
  628. ]
  629. },
  630. "createdAt": {
  631. "type": "string"
  632. },
  633. "deletedAt": {
  634. "$ref": "#/definitions/gorm.DeletedAt"
  635. },
  636. "id": {
  637. "type": "integer"
  638. },
  639. "name": {
  640. "description": "名称",
  641. "type": "string"
  642. },
  643. "parentID": {
  644. "description": "上级id",
  645. "type": "integer"
  646. },
  647. "updatedAt": {
  648. "type": "string"
  649. }
  650. }
  651. },
  652. "models.Word": {
  653. "type": "object",
  654. "properties": {
  655. "content": {
  656. "description": "文字",
  657. "type": "string"
  658. },
  659. "createdAt": {
  660. "type": "string"
  661. },
  662. "deletedAt": {
  663. "$ref": "#/definitions/gorm.DeletedAt"
  664. },
  665. "id": {
  666. "type": "integer"
  667. },
  668. "locomotiveNumber": {
  669. "description": "机车号",
  670. "type": "string"
  671. },
  672. "updatedAt": {
  673. "type": "string"
  674. }
  675. }
  676. },
  677. "request.AddTextReq": {
  678. "type": "object",
  679. "required": [
  680. "content",
  681. "locomotiveNumber"
  682. ],
  683. "properties": {
  684. "content": {
  685. "description": "音频名称",
  686. "type": "string"
  687. },
  688. "locomotiveNumber": {
  689. "description": "机车号",
  690. "type": "string"
  691. }
  692. }
  693. },
  694. "request.BatchProcessAudio": {
  695. "type": "object",
  696. "required": [
  697. "ids"
  698. ],
  699. "properties": {
  700. "ids": {
  701. "type": "array",
  702. "items": {
  703. "type": "integer"
  704. }
  705. }
  706. }
  707. },
  708. "request.FollowReq": {
  709. "type": "object",
  710. "required": [
  711. "id"
  712. ],
  713. "properties": {
  714. "id": {
  715. "type": "integer"
  716. }
  717. }
  718. },
  719. "request.ProcessAudio": {
  720. "type": "object",
  721. "required": [
  722. "id"
  723. ],
  724. "properties": {
  725. "id": {
  726. "type": "integer"
  727. }
  728. }
  729. },
  730. "response.FollowResp": {
  731. "type": "object",
  732. "properties": {
  733. "followStatus": {
  734. "description": "1 已关注 2未关注",
  735. "allOf": [
  736. {
  737. "$ref": "#/definitions/constvar.BoolType"
  738. }
  739. ]
  740. }
  741. }
  742. },
  743. "util.Response": {
  744. "type": "object",
  745. "properties": {
  746. "code": {
  747. "type": "integer"
  748. },
  749. "data": {},
  750. "msg": {
  751. "type": "string"
  752. }
  753. }
  754. },
  755. "util.ResponseList": {
  756. "type": "object",
  757. "properties": {
  758. "code": {
  759. "type": "integer"
  760. },
  761. "data": {},
  762. "msg": {
  763. "type": "string"
  764. },
  765. "page": {
  766. "type": "integer"
  767. },
  768. "pageSize": {
  769. "type": "integer"
  770. },
  771. "total": {
  772. "type": "integer"
  773. }
  774. }
  775. }
  776. }
  777. }