swagger.json 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457
  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. "type": "integer",
  467. "description": "访问的用户id",
  468. "name": "uid",
  469. "in": "query",
  470. "required": true
  471. },
  472. {
  473. "type": "integer",
  474. "description": "访问时间的时间戳",
  475. "name": "date",
  476. "in": "query",
  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/recommend": {
  491. "get": {
  492. "produces": [
  493. "application/json"
  494. ],
  495. "tags": [
  496. "商品模块"
  497. ],
  498. "summary": "分页获取推荐商品",
  499. "parameters": [
  500. {
  501. "type": "integer",
  502. "description": "用户id",
  503. "name": "id",
  504. "in": "query",
  505. "required": true
  506. },
  507. {
  508. "type": "integer",
  509. "description": "推荐的数目",
  510. "name": "size",
  511. "in": "query",
  512. "required": true
  513. }
  514. ],
  515. "responses": {
  516. "200": {
  517. "description": "OK",
  518. "schema": {
  519. "$ref": "#/definitions/response.Response"
  520. }
  521. }
  522. }
  523. }
  524. },
  525. "/goods/revise": {
  526. "post": {
  527. "produces": [
  528. "application/json"
  529. ],
  530. "tags": [
  531. "商品模块"
  532. ],
  533. "summary": "修改商品信息",
  534. "parameters": [
  535. {
  536. "description": "商品信息",
  537. "name": "json",
  538. "in": "body",
  539. "required": true,
  540. "schema": {
  541. "$ref": "#/definitions/model.Goods"
  542. }
  543. }
  544. ],
  545. "responses": {
  546. "200": {
  547. "description": "OK",
  548. "schema": {
  549. "$ref": "#/definitions/response.Response"
  550. }
  551. }
  552. }
  553. }
  554. },
  555. "/goods/search/{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. "type": "string",
  581. "description": "搜素关键词",
  582. "name": "keyword",
  583. "in": "query",
  584. "required": true
  585. }
  586. ],
  587. "responses": {
  588. "200": {
  589. "description": "OK",
  590. "schema": {
  591. "$ref": "#/definitions/response.Response"
  592. }
  593. }
  594. }
  595. }
  596. },
  597. "/goods/user/{id}": {
  598. "get": {
  599. "produces": [
  600. "application/json"
  601. ],
  602. "tags": [
  603. "商品模块"
  604. ],
  605. "summary": "获取某个用户的所有商品",
  606. "parameters": [
  607. {
  608. "type": "integer",
  609. "description": "用户id",
  610. "name": "id",
  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. "/goods/{page}/{pageSize}": {
  626. "get": {
  627. "produces": [
  628. "application/json"
  629. ],
  630. "tags": [
  631. "商品模块"
  632. ],
  633. "summary": "获取所有商品",
  634. "parameters": [
  635. {
  636. "type": "integer",
  637. "description": "页数",
  638. "name": "page",
  639. "in": "path",
  640. "required": true
  641. },
  642. {
  643. "type": "integer",
  644. "description": "一页的大小",
  645. "name": "pageSize",
  646. "in": "path",
  647. "required": true
  648. }
  649. ],
  650. "responses": {
  651. "200": {
  652. "description": "OK",
  653. "schema": {
  654. "$ref": "#/definitions/response.Response"
  655. }
  656. }
  657. }
  658. }
  659. },
  660. "/order": {
  661. "get": {
  662. "produces": [
  663. "application/json"
  664. ],
  665. "tags": [
  666. "订单模块"
  667. ],
  668. "summary": "获取所有订单",
  669. "responses": {
  670. "200": {
  671. "description": "OK",
  672. "schema": {
  673. "$ref": "#/definitions/response.Response"
  674. }
  675. }
  676. }
  677. }
  678. },
  679. "/order/create": {
  680. "post": {
  681. "produces": [
  682. "application/json"
  683. ],
  684. "tags": [
  685. "订单模块"
  686. ],
  687. "summary": "创建订单",
  688. "parameters": [
  689. {
  690. "description": "订单信息",
  691. "name": "json",
  692. "in": "body",
  693. "required": true,
  694. "schema": {
  695. "$ref": "#/definitions/model.OrderJson"
  696. }
  697. }
  698. ],
  699. "responses": {
  700. "200": {
  701. "description": "OK",
  702. "schema": {
  703. "$ref": "#/definitions/response.Response"
  704. }
  705. }
  706. }
  707. }
  708. },
  709. "/order/delete/{id}": {
  710. "delete": {
  711. "produces": [
  712. "application/json"
  713. ],
  714. "tags": [
  715. "订单模块"
  716. ],
  717. "summary": "删除订单",
  718. "parameters": [
  719. {
  720. "type": "integer",
  721. "description": "订单id",
  722. "name": "id",
  723. "in": "path",
  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/revise": {
  738. "post": {
  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": "formData",
  752. "required": true
  753. },
  754. {
  755. "type": "integer",
  756. "description": "订单状态",
  757. "name": "state",
  758. "in": "formData",
  759. "required": true
  760. }
  761. ],
  762. "responses": {
  763. "200": {
  764. "description": "OK",
  765. "schema": {
  766. "$ref": "#/definitions/response.Response"
  767. }
  768. }
  769. }
  770. }
  771. },
  772. "/order/user": {
  773. "get": {
  774. "produces": [
  775. "application/json"
  776. ],
  777. "tags": [
  778. "订单模块"
  779. ],
  780. "summary": "获取用户的所有订单",
  781. "parameters": [
  782. {
  783. "type": "integer",
  784. "description": "用户id",
  785. "name": "id",
  786. "in": "query",
  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. "/order/{page}/{pageSize}": {
  801. "get": {
  802. "produces": [
  803. "application/json"
  804. ],
  805. "tags": [
  806. "订单模块"
  807. ],
  808. "summary": "分页获取订单",
  809. "parameters": [
  810. {
  811. "type": "integer",
  812. "description": "页数",
  813. "name": "page",
  814. "in": "path",
  815. "required": true
  816. },
  817. {
  818. "type": "integer",
  819. "description": "一页的大小",
  820. "name": "pageSize",
  821. "in": "path",
  822. "required": true
  823. }
  824. ],
  825. "responses": {
  826. "200": {
  827. "description": "OK",
  828. "schema": {
  829. "$ref": "#/definitions/response.Response"
  830. }
  831. }
  832. }
  833. }
  834. },
  835. "/pic": {
  836. "get": {
  837. "produces": [
  838. "application/json"
  839. ],
  840. "tags": [
  841. "图片模块"
  842. ],
  843. "summary": "获取所有图片",
  844. "responses": {
  845. "200": {
  846. "description": "OK",
  847. "schema": {
  848. "$ref": "#/definitions/response.Response"
  849. }
  850. }
  851. }
  852. }
  853. },
  854. "/pic/delete/{id}": {
  855. "delete": {
  856. "produces": [
  857. "application/json"
  858. ],
  859. "tags": [
  860. "图片模块"
  861. ],
  862. "summary": "删除图片",
  863. "parameters": [
  864. {
  865. "type": "integer",
  866. "description": "图片id",
  867. "name": "id",
  868. "in": "path",
  869. "required": true
  870. }
  871. ],
  872. "responses": {
  873. "200": {
  874. "description": "OK",
  875. "schema": {
  876. "$ref": "#/definitions/response.Response"
  877. }
  878. }
  879. }
  880. }
  881. },
  882. "/pic/upload": {
  883. "post": {
  884. "consumes": [
  885. "multipart/form-data"
  886. ],
  887. "produces": [
  888. "application/json"
  889. ],
  890. "tags": [
  891. "图片模块"
  892. ],
  893. "summary": "上传图片",
  894. "parameters": [
  895. {
  896. "type": "file",
  897. "description": "图片",
  898. "name": "pic",
  899. "in": "formData",
  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. "/pic/{page}/{pageSize}": {
  914. "get": {
  915. "produces": [
  916. "application/json"
  917. ],
  918. "tags": [
  919. "图片模块"
  920. ],
  921. "summary": "分页获取图片",
  922. "parameters": [
  923. {
  924. "type": "integer",
  925. "description": "页数",
  926. "name": "page",
  927. "in": "path",
  928. "required": true
  929. },
  930. {
  931. "type": "integer",
  932. "description": "一页的大小",
  933. "name": "pageSize",
  934. "in": "path",
  935. "required": true
  936. }
  937. ],
  938. "responses": {
  939. "200": {
  940. "description": "OK",
  941. "schema": {
  942. "$ref": "#/definitions/response.Response"
  943. }
  944. }
  945. }
  946. }
  947. },
  948. "/relation/bad": {
  949. "get": {
  950. "produces": [
  951. "application/json"
  952. ],
  953. "tags": [
  954. "用户关系模块"
  955. ],
  956. "summary": "传入用户id获取用户黑名单列表",
  957. "parameters": [
  958. {
  959. "type": "integer",
  960. "description": "用户id",
  961. "name": "uid",
  962. "in": "query",
  963. "required": true
  964. }
  965. ],
  966. "responses": {
  967. "200": {
  968. "description": "OK",
  969. "schema": {
  970. "$ref": "#/definitions/response.Response"
  971. }
  972. }
  973. }
  974. }
  975. },
  976. "/relation/create": {
  977. "post": {
  978. "consumes": [
  979. "application/json"
  980. ],
  981. "produces": [
  982. "application/json"
  983. ],
  984. "tags": [
  985. "用户关系模块"
  986. ],
  987. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  988. "parameters": [
  989. {
  990. "description": "关系数据",
  991. "name": "json",
  992. "in": "body",
  993. "required": true,
  994. "schema": {
  995. "$ref": "#/definitions/model.RelationJson"
  996. }
  997. }
  998. ],
  999. "responses": {
  1000. "200": {
  1001. "description": "OK",
  1002. "schema": {
  1003. "$ref": "#/definitions/response.Response"
  1004. }
  1005. }
  1006. }
  1007. }
  1008. },
  1009. "/relation/delete/{id}": {
  1010. "delete": {
  1011. "produces": [
  1012. "application/json"
  1013. ],
  1014. "tags": [
  1015. "用户关系模块"
  1016. ],
  1017. "summary": "根据关系id删除关系",
  1018. "parameters": [
  1019. {
  1020. "type": "integer",
  1021. "description": "关系id",
  1022. "name": "id",
  1023. "in": "path",
  1024. "required": true
  1025. }
  1026. ],
  1027. "responses": {
  1028. "200": {
  1029. "description": "OK",
  1030. "schema": {
  1031. "$ref": "#/definitions/response.Response"
  1032. }
  1033. }
  1034. }
  1035. }
  1036. },
  1037. "/relation/friend": {
  1038. "get": {
  1039. "produces": [
  1040. "application/json"
  1041. ],
  1042. "tags": [
  1043. "用户关系模块"
  1044. ],
  1045. "summary": "传入用户id获取用户好友列表",
  1046. "parameters": [
  1047. {
  1048. "type": "integer",
  1049. "description": "用户id",
  1050. "name": "uid",
  1051. "in": "query",
  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. "/relation/{page}/{pageSize}": {
  1066. "get": {
  1067. "produces": [
  1068. "application/json"
  1069. ],
  1070. "tags": [
  1071. "用户关系模块"
  1072. ],
  1073. "summary": "分页用户关系",
  1074. "parameters": [
  1075. {
  1076. "type": "integer",
  1077. "description": "页数",
  1078. "name": "page",
  1079. "in": "path",
  1080. "required": true
  1081. },
  1082. {
  1083. "type": "integer",
  1084. "description": "一页的大小",
  1085. "name": "pageSize",
  1086. "in": "path",
  1087. "required": true
  1088. }
  1089. ],
  1090. "responses": {
  1091. "200": {
  1092. "description": "OK",
  1093. "schema": {
  1094. "$ref": "#/definitions/response.Response"
  1095. }
  1096. }
  1097. }
  1098. }
  1099. },
  1100. "/user/info": {
  1101. "get": {
  1102. "produces": [
  1103. "application/json"
  1104. ],
  1105. "tags": [
  1106. "用户模块"
  1107. ],
  1108. "summary": "获取用户信息",
  1109. "responses": {
  1110. "200": {
  1111. "description": "OK",
  1112. "schema": {
  1113. "$ref": "#/definitions/response.Response"
  1114. }
  1115. }
  1116. }
  1117. }
  1118. },
  1119. "/user/login": {
  1120. "post": {
  1121. "produces": [
  1122. "application/json"
  1123. ],
  1124. "tags": [
  1125. "用户模块"
  1126. ],
  1127. "summary": "登录",
  1128. "parameters": [
  1129. {
  1130. "type": "string",
  1131. "description": "微信ID",
  1132. "name": "vid",
  1133. "in": "formData"
  1134. }
  1135. ],
  1136. "responses": {
  1137. "200": {
  1138. "description": "OK",
  1139. "schema": {
  1140. "$ref": "#/definitions/response.Response"
  1141. }
  1142. }
  1143. }
  1144. }
  1145. },
  1146. "/user/modify": {
  1147. "post": {
  1148. "consumes": [
  1149. "application/json"
  1150. ],
  1151. "produces": [
  1152. "application/json"
  1153. ],
  1154. "tags": [
  1155. "用户模块"
  1156. ],
  1157. "summary": "修改用户信息",
  1158. "parameters": [
  1159. {
  1160. "description": "用户信息",
  1161. "name": "json",
  1162. "in": "body",
  1163. "required": true,
  1164. "schema": {
  1165. "$ref": "#/definitions/model.User"
  1166. }
  1167. }
  1168. ],
  1169. "responses": {
  1170. "200": {
  1171. "description": "OK",
  1172. "schema": {
  1173. "$ref": "#/definitions/response.Response"
  1174. }
  1175. }
  1176. }
  1177. }
  1178. },
  1179. "/user/register": {
  1180. "post": {
  1181. "consumes": [
  1182. "application/json"
  1183. ],
  1184. "produces": [
  1185. "application/json"
  1186. ],
  1187. "tags": [
  1188. "用户模块"
  1189. ],
  1190. "summary": "创建用户",
  1191. "parameters": [
  1192. {
  1193. "description": "用户信息",
  1194. "name": "json",
  1195. "in": "body",
  1196. "required": true,
  1197. "schema": {
  1198. "$ref": "#/definitions/model.UserJson"
  1199. }
  1200. }
  1201. ],
  1202. "responses": {
  1203. "200": {
  1204. "description": "OK",
  1205. "schema": {
  1206. "$ref": "#/definitions/response.Response"
  1207. }
  1208. }
  1209. }
  1210. }
  1211. },
  1212. "/user/{page}/{pageSize}": {
  1213. "get": {
  1214. "produces": [
  1215. "application/json"
  1216. ],
  1217. "tags": [
  1218. "用户模块"
  1219. ],
  1220. "summary": "分页用户信息",
  1221. "parameters": [
  1222. {
  1223. "type": "integer",
  1224. "description": "页数",
  1225. "name": "page",
  1226. "in": "path",
  1227. "required": true
  1228. },
  1229. {
  1230. "type": "integer",
  1231. "description": "一页的大小",
  1232. "name": "pageSize",
  1233. "in": "path",
  1234. "required": true
  1235. }
  1236. ],
  1237. "responses": {
  1238. "200": {
  1239. "description": "OK",
  1240. "schema": {
  1241. "$ref": "#/definitions/response.Response"
  1242. }
  1243. }
  1244. }
  1245. }
  1246. }
  1247. },
  1248. "definitions": {
  1249. "model.Appraise": {
  1250. "type": "object",
  1251. "properties": {
  1252. "buyerId": {
  1253. "type": "integer"
  1254. },
  1255. "content": {
  1256. "type": "string"
  1257. },
  1258. "goodsId": {
  1259. "type": "integer"
  1260. },
  1261. "id": {
  1262. "type": "integer"
  1263. },
  1264. "star": {
  1265. "type": "integer"
  1266. },
  1267. "time": {
  1268. "type": "integer"
  1269. }
  1270. }
  1271. },
  1272. "model.AppraiseJson": {
  1273. "type": "object",
  1274. "properties": {
  1275. "buyerId": {
  1276. "type": "integer"
  1277. },
  1278. "content": {
  1279. "type": "string"
  1280. },
  1281. "goodsId": {
  1282. "type": "integer"
  1283. },
  1284. "star": {
  1285. "type": "integer"
  1286. },
  1287. "time": {
  1288. "type": "integer"
  1289. }
  1290. }
  1291. },
  1292. "model.CategoryJson": {
  1293. "type": "object",
  1294. "properties": {
  1295. "name": {
  1296. "type": "string"
  1297. },
  1298. "pic": {
  1299. "type": "string"
  1300. }
  1301. }
  1302. },
  1303. "model.Goods": {
  1304. "type": "object",
  1305. "properties": {
  1306. "desc": {
  1307. "type": "string"
  1308. },
  1309. "id": {
  1310. "type": "integer"
  1311. },
  1312. "integrity": {
  1313. "type": "integer"
  1314. },
  1315. "ownerId": {
  1316. "type": "integer"
  1317. },
  1318. "picId": {
  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.GoodsJson": {
  1336. "type": "object",
  1337. "properties": {
  1338. "categories": {
  1339. "type": "array",
  1340. "items": {
  1341. "type": "integer"
  1342. }
  1343. },
  1344. "desc": {
  1345. "type": "string"
  1346. },
  1347. "integrity": {
  1348. "type": "integer"
  1349. },
  1350. "ownerId": {
  1351. "type": "integer"
  1352. },
  1353. "pic_id": {
  1354. "type": "integer"
  1355. },
  1356. "place": {
  1357. "type": "string"
  1358. },
  1359. "price": {
  1360. "type": "integer"
  1361. },
  1362. "state": {
  1363. "type": "integer"
  1364. },
  1365. "title": {
  1366. "type": "string"
  1367. }
  1368. }
  1369. },
  1370. "model.OrderJson": {
  1371. "type": "object",
  1372. "properties": {
  1373. "buyerId": {
  1374. "type": "integer"
  1375. },
  1376. "goodsId": {
  1377. "type": "integer"
  1378. },
  1379. "phone": {
  1380. "type": "string"
  1381. },
  1382. "place": {
  1383. "type": "string"
  1384. },
  1385. "state": {
  1386. "type": "integer"
  1387. },
  1388. "time": {
  1389. "type": "integer"
  1390. }
  1391. }
  1392. },
  1393. "model.RelationJson": {
  1394. "type": "object",
  1395. "properties": {
  1396. "owner": {
  1397. "type": "integer"
  1398. },
  1399. "target": {
  1400. "type": "integer"
  1401. },
  1402. "type": {
  1403. "type": "integer"
  1404. }
  1405. }
  1406. },
  1407. "model.User": {
  1408. "type": "object",
  1409. "properties": {
  1410. "avatar": {
  1411. "type": "string"
  1412. },
  1413. "name": {
  1414. "type": "string"
  1415. },
  1416. "phone": {
  1417. "type": "string"
  1418. },
  1419. "uid": {
  1420. "type": "integer"
  1421. },
  1422. "vid": {
  1423. "type": "string"
  1424. }
  1425. }
  1426. },
  1427. "model.UserJson": {
  1428. "type": "object",
  1429. "properties": {
  1430. "avatar": {
  1431. "type": "string"
  1432. },
  1433. "name": {
  1434. "type": "string"
  1435. },
  1436. "phone": {
  1437. "type": "string"
  1438. },
  1439. "vid": {
  1440. "type": "string"
  1441. }
  1442. }
  1443. },
  1444. "response.Response": {
  1445. "type": "object",
  1446. "properties": {
  1447. "code": {
  1448. "type": "integer"
  1449. },
  1450. "data": {},
  1451. "message": {
  1452. "type": "string"
  1453. }
  1454. }
  1455. }
  1456. }
  1457. }