swagger.json 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "一个基于微信小程序的校园二手交易平台的api文档",
  5. "title": "二手交易",
  6. "termsOfService": "http://swagger.io/terms/",
  7. "contact": {},
  8. "license": {
  9. "name": "Apache 2.0",
  10. "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
  11. },
  12. "version": "1.0"
  13. },
  14. "host": "127.0.0.1:8084",
  15. "basePath": "/WeChatTrading/trading-go",
  16. "paths": {
  17. "/appraise/create": {
  18. "post": {
  19. "produces": [
  20. "application/json"
  21. ],
  22. "tags": [
  23. "评论模块"
  24. ],
  25. "summary": "创建评论",
  26. "parameters": [
  27. {
  28. "description": "评价信息",
  29. "name": "json",
  30. "in": "body",
  31. "required": true,
  32. "schema": {
  33. "$ref": "#/definitions/model.AppraiseJson"
  34. }
  35. }
  36. ],
  37. "responses": {
  38. "200": {
  39. "description": "OK",
  40. "schema": {
  41. "$ref": "#/definitions/response.Response"
  42. }
  43. }
  44. }
  45. }
  46. },
  47. "/appraise/delete/{id}": {
  48. "delete": {
  49. "produces": [
  50. "application/json"
  51. ],
  52. "tags": [
  53. "评论模块"
  54. ],
  55. "summary": "删除评论",
  56. "parameters": [
  57. {
  58. "type": "integer",
  59. "description": "评论id",
  60. "name": "id",
  61. "in": "path",
  62. "required": true
  63. }
  64. ],
  65. "responses": {
  66. "200": {
  67. "description": "OK",
  68. "schema": {
  69. "$ref": "#/definitions/response.Response"
  70. }
  71. }
  72. }
  73. }
  74. },
  75. "/appraise/revise": {
  76. "post": {
  77. "produces": [
  78. "application/json"
  79. ],
  80. "tags": [
  81. "评论模块"
  82. ],
  83. "summary": "修改评论",
  84. "parameters": [
  85. {
  86. "description": "评价信息",
  87. "name": "json",
  88. "in": "body",
  89. "required": true,
  90. "schema": {
  91. "$ref": "#/definitions/model.Appraise"
  92. }
  93. }
  94. ],
  95. "responses": {
  96. "200": {
  97. "description": "OK",
  98. "schema": {
  99. "$ref": "#/definitions/response.Response"
  100. }
  101. }
  102. }
  103. }
  104. },
  105. "/appraise/user": {
  106. "get": {
  107. "produces": [
  108. "application/json"
  109. ],
  110. "tags": [
  111. "评论模块"
  112. ],
  113. "summary": "获取用户评价",
  114. "parameters": [
  115. {
  116. "type": "integer",
  117. "description": "用户id",
  118. "name": "id",
  119. "in": "query",
  120. "required": true
  121. }
  122. ],
  123. "responses": {
  124. "200": {
  125. "description": "OK",
  126. "schema": {
  127. "$ref": "#/definitions/response.Response"
  128. }
  129. }
  130. }
  131. }
  132. },
  133. "/appraise/{page}/{pageSize}": {
  134. "get": {
  135. "produces": [
  136. "application/json"
  137. ],
  138. "tags": [
  139. "评论模块"
  140. ],
  141. "summary": "分页获取评论信息",
  142. "parameters": [
  143. {
  144. "type": "integer",
  145. "description": "页数",
  146. "name": "page",
  147. "in": "path",
  148. "required": true
  149. },
  150. {
  151. "type": "integer",
  152. "description": "一页的大小",
  153. "name": "pageSize",
  154. "in": "path",
  155. "required": true
  156. }
  157. ],
  158. "responses": {
  159. "200": {
  160. "description": "OK",
  161. "schema": {
  162. "$ref": "#/definitions/response.Response"
  163. }
  164. }
  165. }
  166. }
  167. },
  168. "/category": {
  169. "get": {
  170. "consumes": [
  171. "application/json"
  172. ],
  173. "produces": [
  174. "application/json"
  175. ],
  176. "tags": [
  177. "分类模块"
  178. ],
  179. "summary": "获取所有分类",
  180. "responses": {
  181. "200": {
  182. "description": "OK",
  183. "schema": {
  184. "$ref": "#/definitions/response.Response"
  185. }
  186. }
  187. }
  188. }
  189. },
  190. "/category/create": {
  191. "post": {
  192. "consumes": [
  193. "application/json"
  194. ],
  195. "produces": [
  196. "application/json"
  197. ],
  198. "tags": [
  199. "分类模块"
  200. ],
  201. "summary": "创建分类",
  202. "parameters": [
  203. {
  204. "description": "分类数据",
  205. "name": "json",
  206. "in": "body",
  207. "required": true,
  208. "schema": {
  209. "$ref": "#/definitions/model.CategoryJson"
  210. }
  211. }
  212. ],
  213. "responses": {
  214. "200": {
  215. "description": "OK",
  216. "schema": {
  217. "$ref": "#/definitions/response.Response"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "/category/delete/{id}": {
  224. "delete": {
  225. "produces": [
  226. "application/json"
  227. ],
  228. "tags": [
  229. "分类模块"
  230. ],
  231. "summary": "根据分类id删除某个分类",
  232. "parameters": [
  233. {
  234. "type": "integer",
  235. "description": "分类id",
  236. "name": "id",
  237. "in": "path",
  238. "required": true
  239. }
  240. ],
  241. "responses": {
  242. "200": {
  243. "description": "OK",
  244. "schema": {
  245. "$ref": "#/definitions/response.Response"
  246. }
  247. }
  248. }
  249. }
  250. },
  251. "/chat": {
  252. "get": {
  253. "tags": [
  254. "聊天模块"
  255. ],
  256. "summary": "与服务端进行websocket连接,请使用postman测试",
  257. "responses": {
  258. "200": {
  259. "description": "OK",
  260. "schema": {
  261. "$ref": "#/definitions/response.Response"
  262. }
  263. }
  264. }
  265. }
  266. },
  267. "/chat/from": {
  268. "get": {
  269. "tags": [
  270. "聊天模块"
  271. ],
  272. "summary": "获取未过期且来源为特定用户的聊天记录",
  273. "parameters": [
  274. {
  275. "type": "string",
  276. "description": "用户id",
  277. "name": "uid",
  278. "in": "query",
  279. "required": true
  280. }
  281. ],
  282. "responses": {
  283. "200": {
  284. "description": "OK",
  285. "schema": {
  286. "$ref": "#/definitions/response.Response"
  287. }
  288. }
  289. }
  290. }
  291. },
  292. "/chat/to": {
  293. "get": {
  294. "tags": [
  295. "聊天模块"
  296. ],
  297. "summary": "获取未过期且目标为特定用户的聊天记录",
  298. "parameters": [
  299. {
  300. "type": "string",
  301. "description": "用户id",
  302. "name": "uid",
  303. "in": "query",
  304. "required": true
  305. }
  306. ],
  307. "responses": {
  308. "200": {
  309. "description": "OK",
  310. "schema": {
  311. "$ref": "#/definitions/response.Response"
  312. }
  313. }
  314. }
  315. }
  316. },
  317. "/goods/category/{page}/{pageSize}": {
  318. "get": {
  319. "produces": [
  320. "application/json"
  321. ],
  322. "tags": [
  323. "商品模块"
  324. ],
  325. "summary": "按分类查找商品并分页显示",
  326. "parameters": [
  327. {
  328. "type": "integer",
  329. "description": "页数",
  330. "name": "page",
  331. "in": "path",
  332. "required": true
  333. },
  334. {
  335. "type": "integer",
  336. "description": "一页的大小",
  337. "name": "pageSize",
  338. "in": "path",
  339. "required": true
  340. },
  341. {
  342. "type": "integer",
  343. "description": "商品分类id",
  344. "name": "category",
  345. "in": "query",
  346. "required": true
  347. }
  348. ],
  349. "responses": {
  350. "200": {
  351. "description": "OK",
  352. "schema": {
  353. "$ref": "#/definitions/response.Response"
  354. }
  355. }
  356. }
  357. }
  358. },
  359. "/goods/create": {
  360. "post": {
  361. "consumes": [
  362. "application/json"
  363. ],
  364. "produces": [
  365. "application/json"
  366. ],
  367. "tags": [
  368. "商品模块"
  369. ],
  370. "summary": "创建商品",
  371. "parameters": [
  372. {
  373. "description": "商品信息",
  374. "name": "json",
  375. "in": "body",
  376. "required": true,
  377. "schema": {
  378. "$ref": "#/definitions/model.GoodsJson"
  379. }
  380. }
  381. ],
  382. "responses": {
  383. "200": {
  384. "description": "OK",
  385. "schema": {
  386. "$ref": "#/definitions/response.Response"
  387. }
  388. }
  389. }
  390. }
  391. },
  392. "/goods/delete/{id}": {
  393. "delete": {
  394. "produces": [
  395. "application/json"
  396. ],
  397. "tags": [
  398. "商品模块"
  399. ],
  400. "summary": "删除商品",
  401. "parameters": [
  402. {
  403. "type": "integer",
  404. "description": "商品id",
  405. "name": "id",
  406. "in": "path",
  407. "required": true
  408. }
  409. ],
  410. "responses": {
  411. "200": {
  412. "description": "OK",
  413. "schema": {
  414. "$ref": "#/definitions/response.Response"
  415. }
  416. }
  417. }
  418. }
  419. },
  420. "/goods/detail/{id}": {
  421. "get": {
  422. "produces": [
  423. "application/json"
  424. ],
  425. "tags": [
  426. "商品模块"
  427. ],
  428. "summary": "获取商品详细信息",
  429. "parameters": [
  430. {
  431. "type": "integer",
  432. "description": "商品id",
  433. "name": "id",
  434. "in": "path",
  435. "required": true
  436. }
  437. ],
  438. "responses": {
  439. "200": {
  440. "description": "OK",
  441. "schema": {
  442. "$ref": "#/definitions/response.Response"
  443. }
  444. }
  445. }
  446. }
  447. },
  448. "/goods/recommend/{page}/{pageSize}": {
  449. "get": {
  450. "produces": [
  451. "application/json"
  452. ],
  453. "tags": [
  454. "商品模块"
  455. ],
  456. "summary": "分页获取推荐商品",
  457. "parameters": [
  458. {
  459. "type": "integer",
  460. "description": "用户id",
  461. "name": "id",
  462. "in": "query",
  463. "required": true
  464. },
  465. {
  466. "type": "integer",
  467. "description": "页数",
  468. "name": "page",
  469. "in": "path",
  470. "required": true
  471. },
  472. {
  473. "type": "integer",
  474. "description": "一页的大小",
  475. "name": "pageSize",
  476. "in": "path",
  477. "required": true
  478. }
  479. ],
  480. "responses": {
  481. "200": {
  482. "description": "OK",
  483. "schema": {
  484. "$ref": "#/definitions/response.Response"
  485. }
  486. }
  487. }
  488. }
  489. },
  490. "/goods/revise": {
  491. "post": {
  492. "produces": [
  493. "application/json"
  494. ],
  495. "tags": [
  496. "商品模块"
  497. ],
  498. "summary": "修改商品信息",
  499. "parameters": [
  500. {
  501. "description": "商品信息",
  502. "name": "json",
  503. "in": "body",
  504. "required": true,
  505. "schema": {
  506. "$ref": "#/definitions/model.Goods"
  507. }
  508. }
  509. ],
  510. "responses": {
  511. "200": {
  512. "description": "OK",
  513. "schema": {
  514. "$ref": "#/definitions/response.Response"
  515. }
  516. }
  517. }
  518. }
  519. },
  520. "/goods/search/{page}/{pageSize}": {
  521. "get": {
  522. "produces": [
  523. "application/json"
  524. ],
  525. "tags": [
  526. "商品模块"
  527. ],
  528. "summary": "搜索商品并分页显示",
  529. "parameters": [
  530. {
  531. "type": "integer",
  532. "description": "页数",
  533. "name": "page",
  534. "in": "path",
  535. "required": true
  536. },
  537. {
  538. "type": "integer",
  539. "description": "一页的大小",
  540. "name": "pageSize",
  541. "in": "path",
  542. "required": true
  543. },
  544. {
  545. "type": "string",
  546. "description": "搜素关键词",
  547. "name": "keyword",
  548. "in": "query",
  549. "required": true
  550. }
  551. ],
  552. "responses": {
  553. "200": {
  554. "description": "OK",
  555. "schema": {
  556. "$ref": "#/definitions/response.Response"
  557. }
  558. }
  559. }
  560. }
  561. },
  562. "/goods/user/{id}": {
  563. "get": {
  564. "produces": [
  565. "application/json"
  566. ],
  567. "tags": [
  568. "商品模块"
  569. ],
  570. "summary": "获取某个用户的所有商品",
  571. "parameters": [
  572. {
  573. "type": "integer",
  574. "description": "用户id",
  575. "name": "id",
  576. "in": "path",
  577. "required": true
  578. }
  579. ],
  580. "responses": {
  581. "200": {
  582. "description": "OK",
  583. "schema": {
  584. "$ref": "#/definitions/response.Response"
  585. }
  586. }
  587. }
  588. }
  589. },
  590. "/goods/{page}/{pageSize}": {
  591. "get": {
  592. "produces": [
  593. "application/json"
  594. ],
  595. "tags": [
  596. "商品模块"
  597. ],
  598. "summary": "获取所有商品",
  599. "parameters": [
  600. {
  601. "type": "integer",
  602. "description": "页数",
  603. "name": "page",
  604. "in": "path",
  605. "required": true
  606. },
  607. {
  608. "type": "integer",
  609. "description": "一页的大小",
  610. "name": "pageSize",
  611. "in": "path",
  612. "required": true
  613. }
  614. ],
  615. "responses": {
  616. "200": {
  617. "description": "OK",
  618. "schema": {
  619. "$ref": "#/definitions/response.Response"
  620. }
  621. }
  622. }
  623. }
  624. },
  625. "/order": {
  626. "get": {
  627. "produces": [
  628. "application/json"
  629. ],
  630. "tags": [
  631. "订单模块"
  632. ],
  633. "summary": "获取所有订单",
  634. "responses": {
  635. "200": {
  636. "description": "OK",
  637. "schema": {
  638. "$ref": "#/definitions/response.Response"
  639. }
  640. }
  641. }
  642. }
  643. },
  644. "/order/create": {
  645. "post": {
  646. "produces": [
  647. "application/json"
  648. ],
  649. "tags": [
  650. "订单模块"
  651. ],
  652. "summary": "创建订单",
  653. "parameters": [
  654. {
  655. "description": "订单信息",
  656. "name": "json",
  657. "in": "body",
  658. "required": true,
  659. "schema": {
  660. "$ref": "#/definitions/model.OrderJson"
  661. }
  662. }
  663. ],
  664. "responses": {
  665. "200": {
  666. "description": "OK",
  667. "schema": {
  668. "$ref": "#/definitions/response.Response"
  669. }
  670. }
  671. }
  672. }
  673. },
  674. "/order/delete/{id}": {
  675. "delete": {
  676. "produces": [
  677. "application/json"
  678. ],
  679. "tags": [
  680. "订单模块"
  681. ],
  682. "summary": "删除订单",
  683. "parameters": [
  684. {
  685. "type": "integer",
  686. "description": "订单id",
  687. "name": "id",
  688. "in": "path",
  689. "required": true
  690. }
  691. ],
  692. "responses": {
  693. "200": {
  694. "description": "OK",
  695. "schema": {
  696. "$ref": "#/definitions/response.Response"
  697. }
  698. }
  699. }
  700. }
  701. },
  702. "/order/revise": {
  703. "post": {
  704. "produces": [
  705. "application/json"
  706. ],
  707. "tags": [
  708. "订单模块"
  709. ],
  710. "summary": "修改订单的状态",
  711. "parameters": [
  712. {
  713. "type": "integer",
  714. "description": "订单id",
  715. "name": "id",
  716. "in": "formData",
  717. "required": true
  718. },
  719. {
  720. "type": "integer",
  721. "description": "订单状态",
  722. "name": "state",
  723. "in": "formData",
  724. "required": true
  725. }
  726. ],
  727. "responses": {
  728. "200": {
  729. "description": "OK",
  730. "schema": {
  731. "$ref": "#/definitions/response.Response"
  732. }
  733. }
  734. }
  735. }
  736. },
  737. "/order/user": {
  738. "get": {
  739. "produces": [
  740. "application/json"
  741. ],
  742. "tags": [
  743. "订单模块"
  744. ],
  745. "summary": "获取用户的所有订单",
  746. "parameters": [
  747. {
  748. "type": "integer",
  749. "description": "用户id",
  750. "name": "id",
  751. "in": "query",
  752. "required": true
  753. }
  754. ],
  755. "responses": {
  756. "200": {
  757. "description": "OK",
  758. "schema": {
  759. "$ref": "#/definitions/response.Response"
  760. }
  761. }
  762. }
  763. }
  764. },
  765. "/order/{page}/{pageSize}": {
  766. "get": {
  767. "produces": [
  768. "application/json"
  769. ],
  770. "tags": [
  771. "订单模块"
  772. ],
  773. "summary": "分页获取订单",
  774. "parameters": [
  775. {
  776. "type": "integer",
  777. "description": "页数",
  778. "name": "page",
  779. "in": "path",
  780. "required": true
  781. },
  782. {
  783. "type": "integer",
  784. "description": "一页的大小",
  785. "name": "pageSize",
  786. "in": "path",
  787. "required": true
  788. }
  789. ],
  790. "responses": {
  791. "200": {
  792. "description": "OK",
  793. "schema": {
  794. "$ref": "#/definitions/response.Response"
  795. }
  796. }
  797. }
  798. }
  799. },
  800. "/pic": {
  801. "get": {
  802. "produces": [
  803. "application/json"
  804. ],
  805. "tags": [
  806. "图片模块"
  807. ],
  808. "summary": "获取所有图片",
  809. "responses": {
  810. "200": {
  811. "description": "OK",
  812. "schema": {
  813. "$ref": "#/definitions/response.Response"
  814. }
  815. }
  816. }
  817. }
  818. },
  819. "/pic/delete/{id}": {
  820. "delete": {
  821. "produces": [
  822. "application/json"
  823. ],
  824. "tags": [
  825. "图片模块"
  826. ],
  827. "summary": "删除图片",
  828. "parameters": [
  829. {
  830. "type": "integer",
  831. "description": "图片id",
  832. "name": "id",
  833. "in": "path",
  834. "required": true
  835. }
  836. ],
  837. "responses": {
  838. "200": {
  839. "description": "OK",
  840. "schema": {
  841. "$ref": "#/definitions/response.Response"
  842. }
  843. }
  844. }
  845. }
  846. },
  847. "/pic/upload": {
  848. "post": {
  849. "consumes": [
  850. "multipart/form-data"
  851. ],
  852. "produces": [
  853. "application/json"
  854. ],
  855. "tags": [
  856. "图片模块"
  857. ],
  858. "summary": "上传图片",
  859. "parameters": [
  860. {
  861. "type": "file",
  862. "description": "图片",
  863. "name": "pic",
  864. "in": "formData",
  865. "required": true
  866. }
  867. ],
  868. "responses": {
  869. "200": {
  870. "description": "OK",
  871. "schema": {
  872. "$ref": "#/definitions/response.Response"
  873. }
  874. }
  875. }
  876. }
  877. },
  878. "/pic/{page}/{pageSize}": {
  879. "get": {
  880. "produces": [
  881. "application/json"
  882. ],
  883. "tags": [
  884. "图片模块"
  885. ],
  886. "summary": "分页获取图片",
  887. "parameters": [
  888. {
  889. "type": "integer",
  890. "description": "页数",
  891. "name": "page",
  892. "in": "path",
  893. "required": true
  894. },
  895. {
  896. "type": "integer",
  897. "description": "一页的大小",
  898. "name": "pageSize",
  899. "in": "path",
  900. "required": true
  901. }
  902. ],
  903. "responses": {
  904. "200": {
  905. "description": "OK",
  906. "schema": {
  907. "$ref": "#/definitions/response.Response"
  908. }
  909. }
  910. }
  911. }
  912. },
  913. "/relation/bad": {
  914. "get": {
  915. "produces": [
  916. "application/json"
  917. ],
  918. "tags": [
  919. "用户关系模块"
  920. ],
  921. "summary": "传入用户id获取用户黑名单列表",
  922. "parameters": [
  923. {
  924. "type": "integer",
  925. "description": "用户id",
  926. "name": "uid",
  927. "in": "query",
  928. "required": true
  929. }
  930. ],
  931. "responses": {
  932. "200": {
  933. "description": "OK",
  934. "schema": {
  935. "$ref": "#/definitions/response.Response"
  936. }
  937. }
  938. }
  939. }
  940. },
  941. "/relation/create": {
  942. "post": {
  943. "consumes": [
  944. "application/json"
  945. ],
  946. "produces": [
  947. "application/json"
  948. ],
  949. "tags": [
  950. "用户关系模块"
  951. ],
  952. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  953. "parameters": [
  954. {
  955. "description": "关系数据",
  956. "name": "json",
  957. "in": "body",
  958. "required": true,
  959. "schema": {
  960. "$ref": "#/definitions/model.RelationJson"
  961. }
  962. }
  963. ],
  964. "responses": {
  965. "200": {
  966. "description": "OK",
  967. "schema": {
  968. "$ref": "#/definitions/response.Response"
  969. }
  970. }
  971. }
  972. }
  973. },
  974. "/relation/delete/{id}": {
  975. "delete": {
  976. "produces": [
  977. "application/json"
  978. ],
  979. "tags": [
  980. "用户关系模块"
  981. ],
  982. "summary": "根据关系id删除关系",
  983. "parameters": [
  984. {
  985. "type": "integer",
  986. "description": "关系id",
  987. "name": "id",
  988. "in": "path",
  989. "required": true
  990. }
  991. ],
  992. "responses": {
  993. "200": {
  994. "description": "OK",
  995. "schema": {
  996. "$ref": "#/definitions/response.Response"
  997. }
  998. }
  999. }
  1000. }
  1001. },
  1002. "/relation/friend": {
  1003. "get": {
  1004. "produces": [
  1005. "application/json"
  1006. ],
  1007. "tags": [
  1008. "用户关系模块"
  1009. ],
  1010. "summary": "传入用户id获取用户好友列表",
  1011. "parameters": [
  1012. {
  1013. "type": "integer",
  1014. "description": "用户id",
  1015. "name": "uid",
  1016. "in": "query",
  1017. "required": true
  1018. }
  1019. ],
  1020. "responses": {
  1021. "200": {
  1022. "description": "OK",
  1023. "schema": {
  1024. "$ref": "#/definitions/response.Response"
  1025. }
  1026. }
  1027. }
  1028. }
  1029. },
  1030. "/relation/{page}/{pageSize}": {
  1031. "get": {
  1032. "produces": [
  1033. "application/json"
  1034. ],
  1035. "tags": [
  1036. "用户关系模块"
  1037. ],
  1038. "summary": "分页用户关系",
  1039. "parameters": [
  1040. {
  1041. "type": "integer",
  1042. "description": "页数",
  1043. "name": "page",
  1044. "in": "path",
  1045. "required": true
  1046. },
  1047. {
  1048. "type": "integer",
  1049. "description": "一页的大小",
  1050. "name": "pageSize",
  1051. "in": "path",
  1052. "required": true
  1053. }
  1054. ],
  1055. "responses": {
  1056. "200": {
  1057. "description": "OK",
  1058. "schema": {
  1059. "$ref": "#/definitions/response.Response"
  1060. }
  1061. }
  1062. }
  1063. }
  1064. },
  1065. "/user/info": {
  1066. "get": {
  1067. "produces": [
  1068. "application/json"
  1069. ],
  1070. "tags": [
  1071. "用户模块"
  1072. ],
  1073. "summary": "获取用户信息",
  1074. "responses": {
  1075. "200": {
  1076. "description": "OK",
  1077. "schema": {
  1078. "$ref": "#/definitions/response.Response"
  1079. }
  1080. }
  1081. }
  1082. }
  1083. },
  1084. "/user/login": {
  1085. "post": {
  1086. "produces": [
  1087. "application/json"
  1088. ],
  1089. "tags": [
  1090. "用户模块"
  1091. ],
  1092. "summary": "登录",
  1093. "parameters": [
  1094. {
  1095. "type": "string",
  1096. "description": "微信ID",
  1097. "name": "vid",
  1098. "in": "formData"
  1099. }
  1100. ],
  1101. "responses": {
  1102. "200": {
  1103. "description": "OK",
  1104. "schema": {
  1105. "$ref": "#/definitions/response.Response"
  1106. }
  1107. }
  1108. }
  1109. }
  1110. },
  1111. "/user/modify": {
  1112. "post": {
  1113. "consumes": [
  1114. "application/json"
  1115. ],
  1116. "produces": [
  1117. "application/json"
  1118. ],
  1119. "tags": [
  1120. "用户模块"
  1121. ],
  1122. "summary": "修改用户信息",
  1123. "parameters": [
  1124. {
  1125. "description": "用户信息",
  1126. "name": "json",
  1127. "in": "body",
  1128. "required": true,
  1129. "schema": {
  1130. "$ref": "#/definitions/model.User"
  1131. }
  1132. }
  1133. ],
  1134. "responses": {
  1135. "200": {
  1136. "description": "OK",
  1137. "schema": {
  1138. "$ref": "#/definitions/response.Response"
  1139. }
  1140. }
  1141. }
  1142. }
  1143. },
  1144. "/user/register": {
  1145. "post": {
  1146. "consumes": [
  1147. "application/json"
  1148. ],
  1149. "produces": [
  1150. "application/json"
  1151. ],
  1152. "tags": [
  1153. "用户模块"
  1154. ],
  1155. "summary": "创建用户",
  1156. "parameters": [
  1157. {
  1158. "description": "用户信息",
  1159. "name": "json",
  1160. "in": "body",
  1161. "required": true,
  1162. "schema": {
  1163. "$ref": "#/definitions/model.UserJson"
  1164. }
  1165. }
  1166. ],
  1167. "responses": {
  1168. "200": {
  1169. "description": "OK",
  1170. "schema": {
  1171. "$ref": "#/definitions/response.Response"
  1172. }
  1173. }
  1174. }
  1175. }
  1176. },
  1177. "/user/{page}/{pageSize}": {
  1178. "get": {
  1179. "produces": [
  1180. "application/json"
  1181. ],
  1182. "tags": [
  1183. "用户模块"
  1184. ],
  1185. "summary": "分页用户信息",
  1186. "parameters": [
  1187. {
  1188. "type": "integer",
  1189. "description": "页数",
  1190. "name": "page",
  1191. "in": "path",
  1192. "required": true
  1193. },
  1194. {
  1195. "type": "integer",
  1196. "description": "一页的大小",
  1197. "name": "pageSize",
  1198. "in": "path",
  1199. "required": true
  1200. }
  1201. ],
  1202. "responses": {
  1203. "200": {
  1204. "description": "OK",
  1205. "schema": {
  1206. "$ref": "#/definitions/response.Response"
  1207. }
  1208. }
  1209. }
  1210. }
  1211. }
  1212. },
  1213. "definitions": {
  1214. "model.Appraise": {
  1215. "type": "object",
  1216. "properties": {
  1217. "buyerId": {
  1218. "type": "integer"
  1219. },
  1220. "content": {
  1221. "type": "string"
  1222. },
  1223. "goodsId": {
  1224. "type": "integer"
  1225. },
  1226. "id": {
  1227. "type": "integer"
  1228. },
  1229. "star": {
  1230. "type": "integer"
  1231. },
  1232. "time": {
  1233. "type": "integer"
  1234. }
  1235. }
  1236. },
  1237. "model.AppraiseJson": {
  1238. "type": "object",
  1239. "properties": {
  1240. "buyerId": {
  1241. "type": "integer"
  1242. },
  1243. "content": {
  1244. "type": "string"
  1245. },
  1246. "goodsId": {
  1247. "type": "integer"
  1248. },
  1249. "star": {
  1250. "type": "integer"
  1251. },
  1252. "time": {
  1253. "type": "integer"
  1254. }
  1255. }
  1256. },
  1257. "model.CategoryJson": {
  1258. "type": "object",
  1259. "properties": {
  1260. "name": {
  1261. "type": "string"
  1262. },
  1263. "pic": {
  1264. "type": "string"
  1265. }
  1266. }
  1267. },
  1268. "model.Goods": {
  1269. "type": "object",
  1270. "properties": {
  1271. "desc": {
  1272. "type": "string"
  1273. },
  1274. "id": {
  1275. "type": "integer"
  1276. },
  1277. "integrity": {
  1278. "type": "integer"
  1279. },
  1280. "ownerId": {
  1281. "type": "integer"
  1282. },
  1283. "picId": {
  1284. "type": "integer"
  1285. },
  1286. "place": {
  1287. "type": "string"
  1288. },
  1289. "price": {
  1290. "type": "integer"
  1291. },
  1292. "state": {
  1293. "type": "integer"
  1294. },
  1295. "title": {
  1296. "type": "string"
  1297. }
  1298. }
  1299. },
  1300. "model.GoodsJson": {
  1301. "type": "object",
  1302. "properties": {
  1303. "categories": {
  1304. "type": "array",
  1305. "items": {
  1306. "type": "integer"
  1307. }
  1308. },
  1309. "desc": {
  1310. "type": "string"
  1311. },
  1312. "integrity": {
  1313. "type": "integer"
  1314. },
  1315. "ownerId": {
  1316. "type": "integer"
  1317. },
  1318. "pic_id": {
  1319. "type": "integer"
  1320. },
  1321. "place": {
  1322. "type": "string"
  1323. },
  1324. "price": {
  1325. "type": "integer"
  1326. },
  1327. "state": {
  1328. "type": "integer"
  1329. },
  1330. "title": {
  1331. "type": "string"
  1332. }
  1333. }
  1334. },
  1335. "model.OrderJson": {
  1336. "type": "object",
  1337. "properties": {
  1338. "buyerId": {
  1339. "type": "integer"
  1340. },
  1341. "goodsId": {
  1342. "type": "integer"
  1343. },
  1344. "phone": {
  1345. "type": "string"
  1346. },
  1347. "place": {
  1348. "type": "string"
  1349. },
  1350. "state": {
  1351. "type": "integer"
  1352. },
  1353. "time": {
  1354. "type": "integer"
  1355. }
  1356. }
  1357. },
  1358. "model.RelationJson": {
  1359. "type": "object",
  1360. "properties": {
  1361. "owner": {
  1362. "type": "integer"
  1363. },
  1364. "target": {
  1365. "type": "integer"
  1366. },
  1367. "type": {
  1368. "type": "integer"
  1369. }
  1370. }
  1371. },
  1372. "model.User": {
  1373. "type": "object",
  1374. "properties": {
  1375. "avatar": {
  1376. "type": "string"
  1377. },
  1378. "name": {
  1379. "type": "string"
  1380. },
  1381. "phone": {
  1382. "type": "string"
  1383. },
  1384. "uid": {
  1385. "type": "integer"
  1386. },
  1387. "vid": {
  1388. "type": "string"
  1389. }
  1390. }
  1391. },
  1392. "model.UserJson": {
  1393. "type": "object",
  1394. "properties": {
  1395. "avatar": {
  1396. "type": "string"
  1397. },
  1398. "name": {
  1399. "type": "string"
  1400. },
  1401. "phone": {
  1402. "type": "string"
  1403. },
  1404. "vid": {
  1405. "type": "string"
  1406. }
  1407. }
  1408. },
  1409. "response.Response": {
  1410. "type": "object",
  1411. "properties": {
  1412. "code": {
  1413. "type": "integer"
  1414. },
  1415. "data": {},
  1416. "message": {
  1417. "type": "string"
  1418. }
  1419. }
  1420. }
  1421. }
  1422. }