swagger.json 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310
  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. "/category": {
  134. "get": {
  135. "consumes": [
  136. "application/json"
  137. ],
  138. "produces": [
  139. "application/json"
  140. ],
  141. "tags": [
  142. "分类模块"
  143. ],
  144. "summary": "获取所有分类",
  145. "responses": {
  146. "200": {
  147. "description": "OK",
  148. "schema": {
  149. "$ref": "#/definitions/response.Response"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "/category/create": {
  156. "post": {
  157. "consumes": [
  158. "application/json"
  159. ],
  160. "produces": [
  161. "application/json"
  162. ],
  163. "tags": [
  164. "分类模块"
  165. ],
  166. "summary": "创建分类",
  167. "parameters": [
  168. {
  169. "description": "分类数据",
  170. "name": "json",
  171. "in": "body",
  172. "required": true,
  173. "schema": {
  174. "$ref": "#/definitions/model.CategoryJson"
  175. }
  176. }
  177. ],
  178. "responses": {
  179. "200": {
  180. "description": "OK",
  181. "schema": {
  182. "$ref": "#/definitions/response.Response"
  183. }
  184. }
  185. }
  186. }
  187. },
  188. "/category/delete/{id}": {
  189. "delete": {
  190. "produces": [
  191. "application/json"
  192. ],
  193. "tags": [
  194. "分类模块"
  195. ],
  196. "summary": "根据分类id删除某个分类",
  197. "parameters": [
  198. {
  199. "type": "integer",
  200. "description": "分类id",
  201. "name": "id",
  202. "in": "path",
  203. "required": true
  204. }
  205. ],
  206. "responses": {
  207. "200": {
  208. "description": "OK",
  209. "schema": {
  210. "$ref": "#/definitions/response.Response"
  211. }
  212. }
  213. }
  214. }
  215. },
  216. "/chat": {
  217. "get": {
  218. "tags": [
  219. "聊天模块"
  220. ],
  221. "summary": "与服务端进行websocket连接,请使用postman测试",
  222. "responses": {
  223. "200": {
  224. "description": "OK",
  225. "schema": {
  226. "$ref": "#/definitions/response.Response"
  227. }
  228. }
  229. }
  230. }
  231. },
  232. "/chat/from": {
  233. "get": {
  234. "tags": [
  235. "聊天模块"
  236. ],
  237. "summary": "获取未过期且来源为特定用户的聊天记录",
  238. "parameters": [
  239. {
  240. "type": "string",
  241. "description": "用户id",
  242. "name": "uid",
  243. "in": "query",
  244. "required": true
  245. }
  246. ],
  247. "responses": {
  248. "200": {
  249. "description": "OK",
  250. "schema": {
  251. "$ref": "#/definitions/response.Response"
  252. }
  253. }
  254. }
  255. }
  256. },
  257. "/chat/to": {
  258. "get": {
  259. "tags": [
  260. "聊天模块"
  261. ],
  262. "summary": "获取未过期且目标为特定用户的聊天记录",
  263. "parameters": [
  264. {
  265. "type": "string",
  266. "description": "用户id",
  267. "name": "uid",
  268. "in": "query",
  269. "required": true
  270. }
  271. ],
  272. "responses": {
  273. "200": {
  274. "description": "OK",
  275. "schema": {
  276. "$ref": "#/definitions/response.Response"
  277. }
  278. }
  279. }
  280. }
  281. },
  282. "/goods/category/{page}/{pageSize}": {
  283. "get": {
  284. "produces": [
  285. "application/json"
  286. ],
  287. "tags": [
  288. "商品模块"
  289. ],
  290. "summary": "按分类查找商品并分页显示",
  291. "parameters": [
  292. {
  293. "type": "integer",
  294. "description": "页数",
  295. "name": "page",
  296. "in": "path",
  297. "required": true
  298. },
  299. {
  300. "type": "integer",
  301. "description": "一页的大小",
  302. "name": "pageSize",
  303. "in": "path",
  304. "required": true
  305. },
  306. {
  307. "type": "integer",
  308. "description": "商品分类id",
  309. "name": "category",
  310. "in": "query",
  311. "required": true
  312. }
  313. ],
  314. "responses": {
  315. "200": {
  316. "description": "OK",
  317. "schema": {
  318. "$ref": "#/definitions/response.Response"
  319. }
  320. }
  321. }
  322. }
  323. },
  324. "/goods/create": {
  325. "post": {
  326. "consumes": [
  327. "application/json"
  328. ],
  329. "produces": [
  330. "application/json"
  331. ],
  332. "tags": [
  333. "商品模块"
  334. ],
  335. "summary": "创建商品",
  336. "parameters": [
  337. {
  338. "description": "商品信息",
  339. "name": "json",
  340. "in": "body",
  341. "required": true,
  342. "schema": {
  343. "$ref": "#/definitions/model.GoodsJson"
  344. }
  345. }
  346. ],
  347. "responses": {
  348. "200": {
  349. "description": "OK",
  350. "schema": {
  351. "$ref": "#/definitions/response.Response"
  352. }
  353. }
  354. }
  355. }
  356. },
  357. "/goods/delete/{id}": {
  358. "delete": {
  359. "produces": [
  360. "application/json"
  361. ],
  362. "tags": [
  363. "商品模块"
  364. ],
  365. "summary": "删除商品",
  366. "parameters": [
  367. {
  368. "type": "integer",
  369. "description": "商品id",
  370. "name": "id",
  371. "in": "path",
  372. "required": true
  373. }
  374. ],
  375. "responses": {
  376. "200": {
  377. "description": "OK",
  378. "schema": {
  379. "$ref": "#/definitions/response.Response"
  380. }
  381. }
  382. }
  383. }
  384. },
  385. "/goods/detail/{id}": {
  386. "get": {
  387. "produces": [
  388. "application/json"
  389. ],
  390. "tags": [
  391. "商品模块"
  392. ],
  393. "summary": "获取商品详细信息",
  394. "parameters": [
  395. {
  396. "type": "integer",
  397. "description": "商品id",
  398. "name": "id",
  399. "in": "path",
  400. "required": true
  401. }
  402. ],
  403. "responses": {
  404. "200": {
  405. "description": "OK",
  406. "schema": {
  407. "$ref": "#/definitions/response.Response"
  408. }
  409. }
  410. }
  411. }
  412. },
  413. "/goods/recommend/{page}/{pageSize}": {
  414. "get": {
  415. "produces": [
  416. "application/json"
  417. ],
  418. "tags": [
  419. "商品模块"
  420. ],
  421. "summary": "分页获取推荐商品",
  422. "parameters": [
  423. {
  424. "type": "integer",
  425. "description": "用户id",
  426. "name": "id",
  427. "in": "query",
  428. "required": true
  429. },
  430. {
  431. "type": "integer",
  432. "description": "页数",
  433. "name": "page",
  434. "in": "path",
  435. "required": true
  436. },
  437. {
  438. "type": "integer",
  439. "description": "一页的大小",
  440. "name": "pageSize",
  441. "in": "path",
  442. "required": true
  443. }
  444. ],
  445. "responses": {
  446. "200": {
  447. "description": "OK",
  448. "schema": {
  449. "$ref": "#/definitions/response.Response"
  450. }
  451. }
  452. }
  453. }
  454. },
  455. "/goods/revise": {
  456. "post": {
  457. "produces": [
  458. "application/json"
  459. ],
  460. "tags": [
  461. "商品模块"
  462. ],
  463. "summary": "修改商品信息",
  464. "parameters": [
  465. {
  466. "description": "商品信息",
  467. "name": "json",
  468. "in": "body",
  469. "required": true,
  470. "schema": {
  471. "$ref": "#/definitions/model.Goods"
  472. }
  473. }
  474. ],
  475. "responses": {
  476. "200": {
  477. "description": "OK",
  478. "schema": {
  479. "$ref": "#/definitions/response.Response"
  480. }
  481. }
  482. }
  483. }
  484. },
  485. "/goods/search/{page}/{pageSize}": {
  486. "get": {
  487. "produces": [
  488. "application/json"
  489. ],
  490. "tags": [
  491. "商品模块"
  492. ],
  493. "summary": "搜索商品并分页显示",
  494. "parameters": [
  495. {
  496. "type": "integer",
  497. "description": "页数",
  498. "name": "page",
  499. "in": "path",
  500. "required": true
  501. },
  502. {
  503. "type": "integer",
  504. "description": "一页的大小",
  505. "name": "pageSize",
  506. "in": "path",
  507. "required": true
  508. },
  509. {
  510. "type": "string",
  511. "description": "搜素关键词",
  512. "name": "keyword",
  513. "in": "query",
  514. "required": true
  515. }
  516. ],
  517. "responses": {
  518. "200": {
  519. "description": "OK",
  520. "schema": {
  521. "$ref": "#/definitions/response.Response"
  522. }
  523. }
  524. }
  525. }
  526. },
  527. "/goods/user/{id}": {
  528. "get": {
  529. "produces": [
  530. "application/json"
  531. ],
  532. "tags": [
  533. "商品模块"
  534. ],
  535. "summary": "获取某个用户的所有商品",
  536. "parameters": [
  537. {
  538. "type": "integer",
  539. "description": "用户id",
  540. "name": "id",
  541. "in": "path",
  542. "required": true
  543. }
  544. ],
  545. "responses": {
  546. "200": {
  547. "description": "OK",
  548. "schema": {
  549. "$ref": "#/definitions/response.Response"
  550. }
  551. }
  552. }
  553. }
  554. },
  555. "/goods/{page}/{pageSize}": {
  556. "get": {
  557. "produces": [
  558. "application/json"
  559. ],
  560. "tags": [
  561. "商品模块"
  562. ],
  563. "summary": "获取所有商品",
  564. "parameters": [
  565. {
  566. "type": "integer",
  567. "description": "页数",
  568. "name": "page",
  569. "in": "path",
  570. "required": true
  571. },
  572. {
  573. "type": "integer",
  574. "description": "一页的大小",
  575. "name": "pageSize",
  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. "/message": {
  591. "get": {
  592. "produces": [
  593. "application/json"
  594. ],
  595. "tags": [
  596. "信息模块"
  597. ],
  598. "summary": "传入用户id获取用户消息记录",
  599. "parameters": [
  600. {
  601. "type": "integer",
  602. "description": "用户id",
  603. "name": "uid",
  604. "in": "query",
  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. "/message/conv": {
  619. "get": {
  620. "produces": [
  621. "application/json"
  622. ],
  623. "tags": [
  624. "信息模块"
  625. ],
  626. "summary": "传入用户id和聊天对象id获取消息记录",
  627. "parameters": [
  628. {
  629. "type": "integer",
  630. "description": "用户id",
  631. "name": "uid",
  632. "in": "query",
  633. "required": true
  634. },
  635. {
  636. "type": "integer",
  637. "description": "对象id",
  638. "name": "targetId",
  639. "in": "query",
  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. "/pic": {
  794. "get": {
  795. "produces": [
  796. "application/json"
  797. ],
  798. "tags": [
  799. "图片模块"
  800. ],
  801. "summary": "获取所有图片",
  802. "responses": {
  803. "200": {
  804. "description": "OK",
  805. "schema": {
  806. "$ref": "#/definitions/response.Response"
  807. }
  808. }
  809. }
  810. }
  811. },
  812. "/pic/delete/{id}": {
  813. "delete": {
  814. "produces": [
  815. "application/json"
  816. ],
  817. "tags": [
  818. "图片模块"
  819. ],
  820. "summary": "删除图片",
  821. "parameters": [
  822. {
  823. "type": "integer",
  824. "description": "图片id",
  825. "name": "id",
  826. "in": "path",
  827. "required": true
  828. }
  829. ],
  830. "responses": {
  831. "200": {
  832. "description": "OK",
  833. "schema": {
  834. "$ref": "#/definitions/response.Response"
  835. }
  836. }
  837. }
  838. }
  839. },
  840. "/pic/upload": {
  841. "post": {
  842. "consumes": [
  843. "multipart/form-data"
  844. ],
  845. "produces": [
  846. "application/json"
  847. ],
  848. "tags": [
  849. "图片模块"
  850. ],
  851. "summary": "上传图片",
  852. "parameters": [
  853. {
  854. "type": "file",
  855. "description": "图片",
  856. "name": "pic",
  857. "in": "formData",
  858. "required": true
  859. }
  860. ],
  861. "responses": {
  862. "200": {
  863. "description": "OK",
  864. "schema": {
  865. "$ref": "#/definitions/response.Response"
  866. }
  867. }
  868. }
  869. }
  870. },
  871. "/relation/bad": {
  872. "get": {
  873. "produces": [
  874. "application/json"
  875. ],
  876. "tags": [
  877. "用户关系模块"
  878. ],
  879. "summary": "传入用户id获取用户黑名单列表",
  880. "parameters": [
  881. {
  882. "type": "integer",
  883. "description": "用户id",
  884. "name": "uid",
  885. "in": "query",
  886. "required": true
  887. }
  888. ],
  889. "responses": {
  890. "200": {
  891. "description": "OK",
  892. "schema": {
  893. "$ref": "#/definitions/response.Response"
  894. }
  895. }
  896. }
  897. }
  898. },
  899. "/relation/create": {
  900. "post": {
  901. "consumes": [
  902. "application/json"
  903. ],
  904. "produces": [
  905. "application/json"
  906. ],
  907. "tags": [
  908. "用户关系模块"
  909. ],
  910. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  911. "parameters": [
  912. {
  913. "description": "关系数据",
  914. "name": "json",
  915. "in": "body",
  916. "required": true,
  917. "schema": {
  918. "$ref": "#/definitions/model.RelationJson"
  919. }
  920. }
  921. ],
  922. "responses": {
  923. "200": {
  924. "description": "OK",
  925. "schema": {
  926. "$ref": "#/definitions/response.Response"
  927. }
  928. }
  929. }
  930. }
  931. },
  932. "/relation/delete/{id}": {
  933. "delete": {
  934. "produces": [
  935. "application/json"
  936. ],
  937. "tags": [
  938. "用户关系模块"
  939. ],
  940. "summary": "根据关系id删除关系",
  941. "parameters": [
  942. {
  943. "type": "integer",
  944. "description": "关系id",
  945. "name": "id",
  946. "in": "path",
  947. "required": true
  948. }
  949. ],
  950. "responses": {
  951. "200": {
  952. "description": "OK",
  953. "schema": {
  954. "$ref": "#/definitions/response.Response"
  955. }
  956. }
  957. }
  958. }
  959. },
  960. "/relation/friend": {
  961. "get": {
  962. "produces": [
  963. "application/json"
  964. ],
  965. "tags": [
  966. "用户关系模块"
  967. ],
  968. "summary": "传入用户id获取用户好友列表",
  969. "parameters": [
  970. {
  971. "type": "integer",
  972. "description": "用户id",
  973. "name": "uid",
  974. "in": "query",
  975. "required": true
  976. }
  977. ],
  978. "responses": {
  979. "200": {
  980. "description": "OK",
  981. "schema": {
  982. "$ref": "#/definitions/response.Response"
  983. }
  984. }
  985. }
  986. }
  987. },
  988. "/user/info": {
  989. "get": {
  990. "produces": [
  991. "application/json"
  992. ],
  993. "tags": [
  994. "用户模块"
  995. ],
  996. "summary": "获取用户信息",
  997. "responses": {
  998. "200": {
  999. "description": "OK",
  1000. "schema": {
  1001. "$ref": "#/definitions/response.Response"
  1002. }
  1003. }
  1004. }
  1005. }
  1006. },
  1007. "/user/login": {
  1008. "post": {
  1009. "produces": [
  1010. "application/json"
  1011. ],
  1012. "tags": [
  1013. "用户模块"
  1014. ],
  1015. "summary": "登录",
  1016. "parameters": [
  1017. {
  1018. "type": "string",
  1019. "description": "微信ID",
  1020. "name": "vid",
  1021. "in": "formData"
  1022. }
  1023. ],
  1024. "responses": {
  1025. "200": {
  1026. "description": "OK",
  1027. "schema": {
  1028. "$ref": "#/definitions/response.Response"
  1029. }
  1030. }
  1031. }
  1032. }
  1033. },
  1034. "/user/modify": {
  1035. "post": {
  1036. "consumes": [
  1037. "application/json"
  1038. ],
  1039. "produces": [
  1040. "application/json"
  1041. ],
  1042. "tags": [
  1043. "用户模块"
  1044. ],
  1045. "summary": "修改用户信息",
  1046. "parameters": [
  1047. {
  1048. "description": "用户信息",
  1049. "name": "json",
  1050. "in": "body",
  1051. "required": true,
  1052. "schema": {
  1053. "$ref": "#/definitions/model.User"
  1054. }
  1055. }
  1056. ],
  1057. "responses": {
  1058. "200": {
  1059. "description": "OK",
  1060. "schema": {
  1061. "$ref": "#/definitions/response.Response"
  1062. }
  1063. }
  1064. }
  1065. }
  1066. },
  1067. "/user/register": {
  1068. "post": {
  1069. "consumes": [
  1070. "application/json"
  1071. ],
  1072. "produces": [
  1073. "application/json"
  1074. ],
  1075. "tags": [
  1076. "用户模块"
  1077. ],
  1078. "summary": "创建用户",
  1079. "parameters": [
  1080. {
  1081. "description": "用户信息",
  1082. "name": "json",
  1083. "in": "body",
  1084. "required": true,
  1085. "schema": {
  1086. "$ref": "#/definitions/model.UserJson"
  1087. }
  1088. }
  1089. ],
  1090. "responses": {
  1091. "200": {
  1092. "description": "OK",
  1093. "schema": {
  1094. "$ref": "#/definitions/response.Response"
  1095. }
  1096. }
  1097. }
  1098. }
  1099. }
  1100. },
  1101. "definitions": {
  1102. "model.Appraise": {
  1103. "type": "object",
  1104. "properties": {
  1105. "buyerId": {
  1106. "type": "integer"
  1107. },
  1108. "content": {
  1109. "type": "string"
  1110. },
  1111. "goodsId": {
  1112. "type": "integer"
  1113. },
  1114. "id": {
  1115. "type": "integer"
  1116. },
  1117. "star": {
  1118. "type": "integer"
  1119. },
  1120. "time": {
  1121. "type": "integer"
  1122. }
  1123. }
  1124. },
  1125. "model.AppraiseJson": {
  1126. "type": "object",
  1127. "properties": {
  1128. "buyerId": {
  1129. "type": "integer"
  1130. },
  1131. "content": {
  1132. "type": "string"
  1133. },
  1134. "goodsId": {
  1135. "type": "integer"
  1136. },
  1137. "star": {
  1138. "type": "integer"
  1139. },
  1140. "time": {
  1141. "type": "integer"
  1142. }
  1143. }
  1144. },
  1145. "model.CategoryJson": {
  1146. "type": "object",
  1147. "properties": {
  1148. "name": {
  1149. "type": "string"
  1150. },
  1151. "pic": {
  1152. "type": "string"
  1153. }
  1154. }
  1155. },
  1156. "model.Goods": {
  1157. "type": "object",
  1158. "properties": {
  1159. "desc": {
  1160. "type": "string"
  1161. },
  1162. "id": {
  1163. "type": "integer"
  1164. },
  1165. "integrity": {
  1166. "type": "integer"
  1167. },
  1168. "ownerId": {
  1169. "type": "integer"
  1170. },
  1171. "picId": {
  1172. "type": "integer"
  1173. },
  1174. "place": {
  1175. "type": "string"
  1176. },
  1177. "price": {
  1178. "type": "integer"
  1179. },
  1180. "state": {
  1181. "type": "integer"
  1182. },
  1183. "title": {
  1184. "type": "string"
  1185. }
  1186. }
  1187. },
  1188. "model.GoodsJson": {
  1189. "type": "object",
  1190. "properties": {
  1191. "categories": {
  1192. "type": "array",
  1193. "items": {
  1194. "type": "integer"
  1195. }
  1196. },
  1197. "desc": {
  1198. "type": "string"
  1199. },
  1200. "integrity": {
  1201. "type": "integer"
  1202. },
  1203. "ownerId": {
  1204. "type": "integer"
  1205. },
  1206. "pic_id": {
  1207. "type": "integer"
  1208. },
  1209. "place": {
  1210. "type": "string"
  1211. },
  1212. "price": {
  1213. "type": "integer"
  1214. },
  1215. "state": {
  1216. "type": "integer"
  1217. },
  1218. "title": {
  1219. "type": "string"
  1220. }
  1221. }
  1222. },
  1223. "model.OrderJson": {
  1224. "type": "object",
  1225. "properties": {
  1226. "buyerId": {
  1227. "type": "integer"
  1228. },
  1229. "goodsId": {
  1230. "type": "integer"
  1231. },
  1232. "phone": {
  1233. "type": "string"
  1234. },
  1235. "place": {
  1236. "type": "string"
  1237. },
  1238. "state": {
  1239. "type": "integer"
  1240. },
  1241. "time": {
  1242. "type": "integer"
  1243. }
  1244. }
  1245. },
  1246. "model.RelationJson": {
  1247. "type": "object",
  1248. "properties": {
  1249. "owner": {
  1250. "type": "integer"
  1251. },
  1252. "target": {
  1253. "type": "integer"
  1254. },
  1255. "type": {
  1256. "type": "integer"
  1257. }
  1258. }
  1259. },
  1260. "model.User": {
  1261. "type": "object",
  1262. "properties": {
  1263. "avatar": {
  1264. "type": "string"
  1265. },
  1266. "name": {
  1267. "type": "string"
  1268. },
  1269. "phone": {
  1270. "type": "string"
  1271. },
  1272. "uid": {
  1273. "type": "integer"
  1274. },
  1275. "vid": {
  1276. "type": "string"
  1277. }
  1278. }
  1279. },
  1280. "model.UserJson": {
  1281. "type": "object",
  1282. "properties": {
  1283. "avatar": {
  1284. "type": "string"
  1285. },
  1286. "name": {
  1287. "type": "string"
  1288. },
  1289. "phone": {
  1290. "type": "string"
  1291. },
  1292. "vid": {
  1293. "type": "string"
  1294. }
  1295. }
  1296. },
  1297. "response.Response": {
  1298. "type": "object",
  1299. "properties": {
  1300. "code": {
  1301. "type": "integer"
  1302. },
  1303. "data": {},
  1304. "message": {
  1305. "type": "string"
  1306. }
  1307. }
  1308. }
  1309. }
  1310. }