swagger.json 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450
  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": "192.168.31.28: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/{page}/{pageSize}": {
  268. "get": {
  269. "tags": [
  270. "聊天模块"
  271. ],
  272. "summary": "获取未过期且来源为特定用户的聊天记录",
  273. "parameters": [
  274. {
  275. "type": "integer",
  276. "description": "页数",
  277. "name": "page",
  278. "in": "path",
  279. "required": true
  280. },
  281. {
  282. "type": "integer",
  283. "description": "一页的大小",
  284. "name": "pageSize",
  285. "in": "path",
  286. "required": true
  287. },
  288. {
  289. "type": "string",
  290. "description": "用户id",
  291. "name": "uid",
  292. "in": "query",
  293. "required": true
  294. }
  295. ],
  296. "responses": {
  297. "200": {
  298. "description": "OK",
  299. "schema": {
  300. "$ref": "#/definitions/response.Response"
  301. }
  302. }
  303. }
  304. }
  305. },
  306. "/chat/to/{page}/{pageSize}": {
  307. "get": {
  308. "tags": [
  309. "聊天模块"
  310. ],
  311. "summary": "获取未过期且目标为特定用户的聊天记录",
  312. "parameters": [
  313. {
  314. "type": "integer",
  315. "description": "页数",
  316. "name": "page",
  317. "in": "path",
  318. "required": true
  319. },
  320. {
  321. "type": "integer",
  322. "description": "一页的大小",
  323. "name": "pageSize",
  324. "in": "path",
  325. "required": true
  326. },
  327. {
  328. "type": "string",
  329. "description": "用户id",
  330. "name": "uid",
  331. "in": "query",
  332. "required": true
  333. }
  334. ],
  335. "responses": {
  336. "200": {
  337. "description": "OK",
  338. "schema": {
  339. "$ref": "#/definitions/response.Response"
  340. }
  341. }
  342. }
  343. }
  344. },
  345. "/goods/category/{page}/{pageSize}": {
  346. "get": {
  347. "produces": [
  348. "application/json"
  349. ],
  350. "tags": [
  351. "商品模块"
  352. ],
  353. "summary": "按分类查找商品并分页显示",
  354. "parameters": [
  355. {
  356. "type": "integer",
  357. "description": "页数",
  358. "name": "page",
  359. "in": "path",
  360. "required": true
  361. },
  362. {
  363. "type": "integer",
  364. "description": "一页的大小",
  365. "name": "pageSize",
  366. "in": "path",
  367. "required": true
  368. },
  369. {
  370. "type": "integer",
  371. "description": "商品分类id",
  372. "name": "category",
  373. "in": "query",
  374. "required": true
  375. }
  376. ],
  377. "responses": {
  378. "200": {
  379. "description": "OK",
  380. "schema": {
  381. "$ref": "#/definitions/response.Response"
  382. }
  383. }
  384. }
  385. }
  386. },
  387. "/goods/create": {
  388. "post": {
  389. "consumes": [
  390. "application/json"
  391. ],
  392. "produces": [
  393. "application/json"
  394. ],
  395. "tags": [
  396. "商品模块"
  397. ],
  398. "summary": "创建商品",
  399. "parameters": [
  400. {
  401. "description": "商品信息",
  402. "name": "json",
  403. "in": "body",
  404. "required": true,
  405. "schema": {
  406. "$ref": "#/definitions/model.GoodsJson"
  407. }
  408. }
  409. ],
  410. "responses": {
  411. "200": {
  412. "description": "OK",
  413. "schema": {
  414. "$ref": "#/definitions/response.Response"
  415. }
  416. }
  417. }
  418. }
  419. },
  420. "/goods/delete/{id}": {
  421. "delete": {
  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/detail/{id}": {
  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": "path",
  463. "required": true
  464. }
  465. ],
  466. "responses": {
  467. "200": {
  468. "description": "OK",
  469. "schema": {
  470. "$ref": "#/definitions/response.Response"
  471. }
  472. }
  473. }
  474. }
  475. },
  476. "/goods/recommend/{page}/{pageSize}": {
  477. "get": {
  478. "produces": [
  479. "application/json"
  480. ],
  481. "tags": [
  482. "商品模块"
  483. ],
  484. "summary": "分页获取推荐商品",
  485. "parameters": [
  486. {
  487. "type": "integer",
  488. "description": "用户id",
  489. "name": "id",
  490. "in": "query",
  491. "required": true
  492. },
  493. {
  494. "type": "integer",
  495. "description": "页数",
  496. "name": "page",
  497. "in": "path",
  498. "required": true
  499. },
  500. {
  501. "type": "integer",
  502. "description": "一页的大小",
  503. "name": "pageSize",
  504. "in": "path",
  505. "required": true
  506. }
  507. ],
  508. "responses": {
  509. "200": {
  510. "description": "OK",
  511. "schema": {
  512. "$ref": "#/definitions/response.Response"
  513. }
  514. }
  515. }
  516. }
  517. },
  518. "/goods/revise": {
  519. "post": {
  520. "produces": [
  521. "application/json"
  522. ],
  523. "tags": [
  524. "商品模块"
  525. ],
  526. "summary": "修改商品信息",
  527. "parameters": [
  528. {
  529. "description": "商品信息",
  530. "name": "json",
  531. "in": "body",
  532. "required": true,
  533. "schema": {
  534. "$ref": "#/definitions/model.Goods"
  535. }
  536. }
  537. ],
  538. "responses": {
  539. "200": {
  540. "description": "OK",
  541. "schema": {
  542. "$ref": "#/definitions/response.Response"
  543. }
  544. }
  545. }
  546. }
  547. },
  548. "/goods/search/{page}/{pageSize}": {
  549. "get": {
  550. "produces": [
  551. "application/json"
  552. ],
  553. "tags": [
  554. "商品模块"
  555. ],
  556. "summary": "搜索商品并分页显示",
  557. "parameters": [
  558. {
  559. "type": "integer",
  560. "description": "页数",
  561. "name": "page",
  562. "in": "path",
  563. "required": true
  564. },
  565. {
  566. "type": "integer",
  567. "description": "一页的大小",
  568. "name": "pageSize",
  569. "in": "path",
  570. "required": true
  571. },
  572. {
  573. "type": "string",
  574. "description": "搜素关键词",
  575. "name": "keyword",
  576. "in": "query",
  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/user/{id}": {
  591. "get": {
  592. "produces": [
  593. "application/json"
  594. ],
  595. "tags": [
  596. "商品模块"
  597. ],
  598. "summary": "获取某个用户的所有商品",
  599. "parameters": [
  600. {
  601. "type": "integer",
  602. "description": "用户id",
  603. "name": "id",
  604. "in": "path",
  605. "required": true
  606. }
  607. ],
  608. "responses": {
  609. "200": {
  610. "description": "OK",
  611. "schema": {
  612. "$ref": "#/definitions/response.Response"
  613. }
  614. }
  615. }
  616. }
  617. },
  618. "/goods/{page}/{pageSize}": {
  619. "get": {
  620. "produces": [
  621. "application/json"
  622. ],
  623. "tags": [
  624. "商品模块"
  625. ],
  626. "summary": "获取所有商品",
  627. "parameters": [
  628. {
  629. "type": "integer",
  630. "description": "页数",
  631. "name": "page",
  632. "in": "path",
  633. "required": true
  634. },
  635. {
  636. "type": "integer",
  637. "description": "一页的大小",
  638. "name": "pageSize",
  639. "in": "path",
  640. "required": true
  641. }
  642. ],
  643. "responses": {
  644. "200": {
  645. "description": "OK",
  646. "schema": {
  647. "$ref": "#/definitions/response.Response"
  648. }
  649. }
  650. }
  651. }
  652. },
  653. "/order": {
  654. "get": {
  655. "produces": [
  656. "application/json"
  657. ],
  658. "tags": [
  659. "订单模块"
  660. ],
  661. "summary": "获取所有订单",
  662. "responses": {
  663. "200": {
  664. "description": "OK",
  665. "schema": {
  666. "$ref": "#/definitions/response.Response"
  667. }
  668. }
  669. }
  670. }
  671. },
  672. "/order/create": {
  673. "post": {
  674. "produces": [
  675. "application/json"
  676. ],
  677. "tags": [
  678. "订单模块"
  679. ],
  680. "summary": "创建订单",
  681. "parameters": [
  682. {
  683. "description": "订单信息",
  684. "name": "json",
  685. "in": "body",
  686. "required": true,
  687. "schema": {
  688. "$ref": "#/definitions/model.OrderJson"
  689. }
  690. }
  691. ],
  692. "responses": {
  693. "200": {
  694. "description": "OK",
  695. "schema": {
  696. "$ref": "#/definitions/response.Response"
  697. }
  698. }
  699. }
  700. }
  701. },
  702. "/order/delete/{id}": {
  703. "delete": {
  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": "path",
  717. "required": true
  718. }
  719. ],
  720. "responses": {
  721. "200": {
  722. "description": "OK",
  723. "schema": {
  724. "$ref": "#/definitions/response.Response"
  725. }
  726. }
  727. }
  728. }
  729. },
  730. "/order/revise": {
  731. "post": {
  732. "produces": [
  733. "application/json"
  734. ],
  735. "tags": [
  736. "订单模块"
  737. ],
  738. "summary": "修改订单的状态",
  739. "parameters": [
  740. {
  741. "type": "integer",
  742. "description": "订单id",
  743. "name": "id",
  744. "in": "formData",
  745. "required": true
  746. },
  747. {
  748. "type": "integer",
  749. "description": "订单状态",
  750. "name": "state",
  751. "in": "formData",
  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/user": {
  766. "get": {
  767. "produces": [
  768. "application/json"
  769. ],
  770. "tags": [
  771. "订单模块"
  772. ],
  773. "summary": "获取用户的所有订单",
  774. "parameters": [
  775. {
  776. "type": "integer",
  777. "description": "用户id",
  778. "name": "id",
  779. "in": "query",
  780. "required": true
  781. }
  782. ],
  783. "responses": {
  784. "200": {
  785. "description": "OK",
  786. "schema": {
  787. "$ref": "#/definitions/response.Response"
  788. }
  789. }
  790. }
  791. }
  792. },
  793. "/order/{page}/{pageSize}": {
  794. "get": {
  795. "produces": [
  796. "application/json"
  797. ],
  798. "tags": [
  799. "订单模块"
  800. ],
  801. "summary": "分页获取订单",
  802. "parameters": [
  803. {
  804. "type": "integer",
  805. "description": "页数",
  806. "name": "page",
  807. "in": "path",
  808. "required": true
  809. },
  810. {
  811. "type": "integer",
  812. "description": "一页的大小",
  813. "name": "pageSize",
  814. "in": "path",
  815. "required": true
  816. }
  817. ],
  818. "responses": {
  819. "200": {
  820. "description": "OK",
  821. "schema": {
  822. "$ref": "#/definitions/response.Response"
  823. }
  824. }
  825. }
  826. }
  827. },
  828. "/pic": {
  829. "get": {
  830. "produces": [
  831. "application/json"
  832. ],
  833. "tags": [
  834. "图片模块"
  835. ],
  836. "summary": "获取所有图片",
  837. "responses": {
  838. "200": {
  839. "description": "OK",
  840. "schema": {
  841. "$ref": "#/definitions/response.Response"
  842. }
  843. }
  844. }
  845. }
  846. },
  847. "/pic/delete/{id}": {
  848. "delete": {
  849. "produces": [
  850. "application/json"
  851. ],
  852. "tags": [
  853. "图片模块"
  854. ],
  855. "summary": "删除图片",
  856. "parameters": [
  857. {
  858. "type": "integer",
  859. "description": "图片id",
  860. "name": "id",
  861. "in": "path",
  862. "required": true
  863. }
  864. ],
  865. "responses": {
  866. "200": {
  867. "description": "OK",
  868. "schema": {
  869. "$ref": "#/definitions/response.Response"
  870. }
  871. }
  872. }
  873. }
  874. },
  875. "/pic/upload": {
  876. "post": {
  877. "consumes": [
  878. "multipart/form-data"
  879. ],
  880. "produces": [
  881. "application/json"
  882. ],
  883. "tags": [
  884. "图片模块"
  885. ],
  886. "summary": "上传图片",
  887. "parameters": [
  888. {
  889. "type": "file",
  890. "description": "图片",
  891. "name": "pic",
  892. "in": "formData",
  893. "required": true
  894. }
  895. ],
  896. "responses": {
  897. "200": {
  898. "description": "OK",
  899. "schema": {
  900. "$ref": "#/definitions/response.Response"
  901. }
  902. }
  903. }
  904. }
  905. },
  906. "/pic/{page}/{pageSize}": {
  907. "get": {
  908. "produces": [
  909. "application/json"
  910. ],
  911. "tags": [
  912. "图片模块"
  913. ],
  914. "summary": "分页获取图片",
  915. "parameters": [
  916. {
  917. "type": "integer",
  918. "description": "页数",
  919. "name": "page",
  920. "in": "path",
  921. "required": true
  922. },
  923. {
  924. "type": "integer",
  925. "description": "一页的大小",
  926. "name": "pageSize",
  927. "in": "path",
  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/bad": {
  942. "get": {
  943. "produces": [
  944. "application/json"
  945. ],
  946. "tags": [
  947. "用户关系模块"
  948. ],
  949. "summary": "传入用户id获取用户黑名单列表",
  950. "parameters": [
  951. {
  952. "type": "integer",
  953. "description": "用户id",
  954. "name": "uid",
  955. "in": "query",
  956. "required": true
  957. }
  958. ],
  959. "responses": {
  960. "200": {
  961. "description": "OK",
  962. "schema": {
  963. "$ref": "#/definitions/response.Response"
  964. }
  965. }
  966. }
  967. }
  968. },
  969. "/relation/create": {
  970. "post": {
  971. "consumes": [
  972. "application/json"
  973. ],
  974. "produces": [
  975. "application/json"
  976. ],
  977. "tags": [
  978. "用户关系模块"
  979. ],
  980. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  981. "parameters": [
  982. {
  983. "description": "关系数据",
  984. "name": "json",
  985. "in": "body",
  986. "required": true,
  987. "schema": {
  988. "$ref": "#/definitions/model.RelationJson"
  989. }
  990. }
  991. ],
  992. "responses": {
  993. "200": {
  994. "description": "OK",
  995. "schema": {
  996. "$ref": "#/definitions/response.Response"
  997. }
  998. }
  999. }
  1000. }
  1001. },
  1002. "/relation/delete/{id}": {
  1003. "delete": {
  1004. "produces": [
  1005. "application/json"
  1006. ],
  1007. "tags": [
  1008. "用户关系模块"
  1009. ],
  1010. "summary": "根据关系id删除关系",
  1011. "parameters": [
  1012. {
  1013. "type": "integer",
  1014. "description": "关系id",
  1015. "name": "id",
  1016. "in": "path",
  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/friend": {
  1031. "get": {
  1032. "produces": [
  1033. "application/json"
  1034. ],
  1035. "tags": [
  1036. "用户关系模块"
  1037. ],
  1038. "summary": "传入用户id获取用户好友列表",
  1039. "parameters": [
  1040. {
  1041. "type": "integer",
  1042. "description": "用户id",
  1043. "name": "uid",
  1044. "in": "query",
  1045. "required": true
  1046. }
  1047. ],
  1048. "responses": {
  1049. "200": {
  1050. "description": "OK",
  1051. "schema": {
  1052. "$ref": "#/definitions/response.Response"
  1053. }
  1054. }
  1055. }
  1056. }
  1057. },
  1058. "/relation/{page}/{pageSize}": {
  1059. "get": {
  1060. "produces": [
  1061. "application/json"
  1062. ],
  1063. "tags": [
  1064. "用户关系模块"
  1065. ],
  1066. "summary": "分页用户关系",
  1067. "parameters": [
  1068. {
  1069. "type": "integer",
  1070. "description": "页数",
  1071. "name": "page",
  1072. "in": "path",
  1073. "required": true
  1074. },
  1075. {
  1076. "type": "integer",
  1077. "description": "一页的大小",
  1078. "name": "pageSize",
  1079. "in": "path",
  1080. "required": true
  1081. }
  1082. ],
  1083. "responses": {
  1084. "200": {
  1085. "description": "OK",
  1086. "schema": {
  1087. "$ref": "#/definitions/response.Response"
  1088. }
  1089. }
  1090. }
  1091. }
  1092. },
  1093. "/user/info": {
  1094. "get": {
  1095. "produces": [
  1096. "application/json"
  1097. ],
  1098. "tags": [
  1099. "用户模块"
  1100. ],
  1101. "summary": "获取用户信息",
  1102. "responses": {
  1103. "200": {
  1104. "description": "OK",
  1105. "schema": {
  1106. "$ref": "#/definitions/response.Response"
  1107. }
  1108. }
  1109. }
  1110. }
  1111. },
  1112. "/user/login": {
  1113. "post": {
  1114. "produces": [
  1115. "application/json"
  1116. ],
  1117. "tags": [
  1118. "用户模块"
  1119. ],
  1120. "summary": "登录",
  1121. "parameters": [
  1122. {
  1123. "type": "string",
  1124. "description": "微信ID",
  1125. "name": "vid",
  1126. "in": "formData"
  1127. }
  1128. ],
  1129. "responses": {
  1130. "200": {
  1131. "description": "OK",
  1132. "schema": {
  1133. "$ref": "#/definitions/response.Response"
  1134. }
  1135. }
  1136. }
  1137. }
  1138. },
  1139. "/user/modify": {
  1140. "post": {
  1141. "consumes": [
  1142. "application/json"
  1143. ],
  1144. "produces": [
  1145. "application/json"
  1146. ],
  1147. "tags": [
  1148. "用户模块"
  1149. ],
  1150. "summary": "修改用户信息",
  1151. "parameters": [
  1152. {
  1153. "description": "用户信息",
  1154. "name": "json",
  1155. "in": "body",
  1156. "required": true,
  1157. "schema": {
  1158. "$ref": "#/definitions/model.User"
  1159. }
  1160. }
  1161. ],
  1162. "responses": {
  1163. "200": {
  1164. "description": "OK",
  1165. "schema": {
  1166. "$ref": "#/definitions/response.Response"
  1167. }
  1168. }
  1169. }
  1170. }
  1171. },
  1172. "/user/register": {
  1173. "post": {
  1174. "consumes": [
  1175. "application/json"
  1176. ],
  1177. "produces": [
  1178. "application/json"
  1179. ],
  1180. "tags": [
  1181. "用户模块"
  1182. ],
  1183. "summary": "创建用户",
  1184. "parameters": [
  1185. {
  1186. "description": "用户信息",
  1187. "name": "json",
  1188. "in": "body",
  1189. "required": true,
  1190. "schema": {
  1191. "$ref": "#/definitions/model.UserJson"
  1192. }
  1193. }
  1194. ],
  1195. "responses": {
  1196. "200": {
  1197. "description": "OK",
  1198. "schema": {
  1199. "$ref": "#/definitions/response.Response"
  1200. }
  1201. }
  1202. }
  1203. }
  1204. },
  1205. "/user/{page}/{pageSize}": {
  1206. "get": {
  1207. "produces": [
  1208. "application/json"
  1209. ],
  1210. "tags": [
  1211. "用户模块"
  1212. ],
  1213. "summary": "分页用户信息",
  1214. "parameters": [
  1215. {
  1216. "type": "integer",
  1217. "description": "页数",
  1218. "name": "page",
  1219. "in": "path",
  1220. "required": true
  1221. },
  1222. {
  1223. "type": "integer",
  1224. "description": "一页的大小",
  1225. "name": "pageSize",
  1226. "in": "path",
  1227. "required": true
  1228. }
  1229. ],
  1230. "responses": {
  1231. "200": {
  1232. "description": "OK",
  1233. "schema": {
  1234. "$ref": "#/definitions/response.Response"
  1235. }
  1236. }
  1237. }
  1238. }
  1239. }
  1240. },
  1241. "definitions": {
  1242. "model.Appraise": {
  1243. "type": "object",
  1244. "properties": {
  1245. "buyerId": {
  1246. "type": "integer"
  1247. },
  1248. "content": {
  1249. "type": "string"
  1250. },
  1251. "goodsId": {
  1252. "type": "integer"
  1253. },
  1254. "id": {
  1255. "type": "integer"
  1256. },
  1257. "star": {
  1258. "type": "integer"
  1259. },
  1260. "time": {
  1261. "type": "integer"
  1262. }
  1263. }
  1264. },
  1265. "model.AppraiseJson": {
  1266. "type": "object",
  1267. "properties": {
  1268. "buyerId": {
  1269. "type": "integer"
  1270. },
  1271. "content": {
  1272. "type": "string"
  1273. },
  1274. "goodsId": {
  1275. "type": "integer"
  1276. },
  1277. "star": {
  1278. "type": "integer"
  1279. },
  1280. "time": {
  1281. "type": "integer"
  1282. }
  1283. }
  1284. },
  1285. "model.CategoryJson": {
  1286. "type": "object",
  1287. "properties": {
  1288. "name": {
  1289. "type": "string"
  1290. },
  1291. "pic": {
  1292. "type": "string"
  1293. }
  1294. }
  1295. },
  1296. "model.Goods": {
  1297. "type": "object",
  1298. "properties": {
  1299. "desc": {
  1300. "type": "string"
  1301. },
  1302. "id": {
  1303. "type": "integer"
  1304. },
  1305. "integrity": {
  1306. "type": "integer"
  1307. },
  1308. "ownerId": {
  1309. "type": "integer"
  1310. },
  1311. "picId": {
  1312. "type": "integer"
  1313. },
  1314. "place": {
  1315. "type": "string"
  1316. },
  1317. "price": {
  1318. "type": "integer"
  1319. },
  1320. "state": {
  1321. "type": "integer"
  1322. },
  1323. "title": {
  1324. "type": "string"
  1325. }
  1326. }
  1327. },
  1328. "model.GoodsJson": {
  1329. "type": "object",
  1330. "properties": {
  1331. "categories": {
  1332. "type": "array",
  1333. "items": {
  1334. "type": "integer"
  1335. }
  1336. },
  1337. "desc": {
  1338. "type": "string"
  1339. },
  1340. "integrity": {
  1341. "type": "integer"
  1342. },
  1343. "ownerId": {
  1344. "type": "integer"
  1345. },
  1346. "pic_id": {
  1347. "type": "integer"
  1348. },
  1349. "place": {
  1350. "type": "string"
  1351. },
  1352. "price": {
  1353. "type": "integer"
  1354. },
  1355. "state": {
  1356. "type": "integer"
  1357. },
  1358. "title": {
  1359. "type": "string"
  1360. }
  1361. }
  1362. },
  1363. "model.OrderJson": {
  1364. "type": "object",
  1365. "properties": {
  1366. "buyerId": {
  1367. "type": "integer"
  1368. },
  1369. "goodsId": {
  1370. "type": "integer"
  1371. },
  1372. "phone": {
  1373. "type": "string"
  1374. },
  1375. "place": {
  1376. "type": "string"
  1377. },
  1378. "state": {
  1379. "type": "integer"
  1380. },
  1381. "time": {
  1382. "type": "integer"
  1383. }
  1384. }
  1385. },
  1386. "model.RelationJson": {
  1387. "type": "object",
  1388. "properties": {
  1389. "owner": {
  1390. "type": "integer"
  1391. },
  1392. "target": {
  1393. "type": "integer"
  1394. },
  1395. "type": {
  1396. "type": "integer"
  1397. }
  1398. }
  1399. },
  1400. "model.User": {
  1401. "type": "object",
  1402. "properties": {
  1403. "avatar": {
  1404. "type": "string"
  1405. },
  1406. "name": {
  1407. "type": "string"
  1408. },
  1409. "phone": {
  1410. "type": "string"
  1411. },
  1412. "uid": {
  1413. "type": "integer"
  1414. },
  1415. "vid": {
  1416. "type": "string"
  1417. }
  1418. }
  1419. },
  1420. "model.UserJson": {
  1421. "type": "object",
  1422. "properties": {
  1423. "avatar": {
  1424. "type": "string"
  1425. },
  1426. "name": {
  1427. "type": "string"
  1428. },
  1429. "phone": {
  1430. "type": "string"
  1431. },
  1432. "vid": {
  1433. "type": "string"
  1434. }
  1435. }
  1436. },
  1437. "response.Response": {
  1438. "type": "object",
  1439. "properties": {
  1440. "code": {
  1441. "type": "integer"
  1442. },
  1443. "data": {},
  1444. "message": {
  1445. "type": "string"
  1446. }
  1447. }
  1448. }
  1449. }
  1450. }