swagger.json 23 KB

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