swagger.json 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247
  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": "124.222.126.172: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. "/order": {
  591. "get": {
  592. "produces": [
  593. "application/json"
  594. ],
  595. "tags": [
  596. "订单模块"
  597. ],
  598. "summary": "获取所有订单",
  599. "responses": {
  600. "200": {
  601. "description": "OK",
  602. "schema": {
  603. "$ref": "#/definitions/response.Response"
  604. }
  605. }
  606. }
  607. }
  608. },
  609. "/order/create": {
  610. "post": {
  611. "produces": [
  612. "application/json"
  613. ],
  614. "tags": [
  615. "订单模块"
  616. ],
  617. "summary": "创建订单",
  618. "parameters": [
  619. {
  620. "description": "订单信息",
  621. "name": "json",
  622. "in": "body",
  623. "required": true,
  624. "schema": {
  625. "$ref": "#/definitions/model.OrderJson"
  626. }
  627. }
  628. ],
  629. "responses": {
  630. "200": {
  631. "description": "OK",
  632. "schema": {
  633. "$ref": "#/definitions/response.Response"
  634. }
  635. }
  636. }
  637. }
  638. },
  639. "/order/delete/{id}": {
  640. "delete": {
  641. "produces": [
  642. "application/json"
  643. ],
  644. "tags": [
  645. "订单模块"
  646. ],
  647. "summary": "删除订单",
  648. "parameters": [
  649. {
  650. "type": "integer",
  651. "description": "订单id",
  652. "name": "id",
  653. "in": "path",
  654. "required": true
  655. }
  656. ],
  657. "responses": {
  658. "200": {
  659. "description": "OK",
  660. "schema": {
  661. "$ref": "#/definitions/response.Response"
  662. }
  663. }
  664. }
  665. }
  666. },
  667. "/order/revise": {
  668. "post": {
  669. "produces": [
  670. "application/json"
  671. ],
  672. "tags": [
  673. "订单模块"
  674. ],
  675. "summary": "修改订单的状态",
  676. "parameters": [
  677. {
  678. "type": "integer",
  679. "description": "订单id",
  680. "name": "id",
  681. "in": "formData",
  682. "required": true
  683. },
  684. {
  685. "type": "integer",
  686. "description": "订单状态",
  687. "name": "state",
  688. "in": "formData",
  689. "required": true
  690. }
  691. ],
  692. "responses": {
  693. "200": {
  694. "description": "OK",
  695. "schema": {
  696. "$ref": "#/definitions/response.Response"
  697. }
  698. }
  699. }
  700. }
  701. },
  702. "/order/user": {
  703. "get": {
  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": "query",
  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. "/pic": {
  731. "get": {
  732. "produces": [
  733. "application/json"
  734. ],
  735. "tags": [
  736. "图片模块"
  737. ],
  738. "summary": "获取所有图片",
  739. "responses": {
  740. "200": {
  741. "description": "OK",
  742. "schema": {
  743. "$ref": "#/definitions/response.Response"
  744. }
  745. }
  746. }
  747. }
  748. },
  749. "/pic/delete/{id}": {
  750. "delete": {
  751. "produces": [
  752. "application/json"
  753. ],
  754. "tags": [
  755. "图片模块"
  756. ],
  757. "summary": "删除图片",
  758. "parameters": [
  759. {
  760. "type": "integer",
  761. "description": "图片id",
  762. "name": "id",
  763. "in": "path",
  764. "required": true
  765. }
  766. ],
  767. "responses": {
  768. "200": {
  769. "description": "OK",
  770. "schema": {
  771. "$ref": "#/definitions/response.Response"
  772. }
  773. }
  774. }
  775. }
  776. },
  777. "/pic/upload": {
  778. "post": {
  779. "consumes": [
  780. "multipart/form-data"
  781. ],
  782. "produces": [
  783. "application/json"
  784. ],
  785. "tags": [
  786. "图片模块"
  787. ],
  788. "summary": "上传图片",
  789. "parameters": [
  790. {
  791. "type": "file",
  792. "description": "图片",
  793. "name": "pic",
  794. "in": "formData",
  795. "required": true
  796. }
  797. ],
  798. "responses": {
  799. "200": {
  800. "description": "OK",
  801. "schema": {
  802. "$ref": "#/definitions/response.Response"
  803. }
  804. }
  805. }
  806. }
  807. },
  808. "/relation/bad": {
  809. "get": {
  810. "produces": [
  811. "application/json"
  812. ],
  813. "tags": [
  814. "用户关系模块"
  815. ],
  816. "summary": "传入用户id获取用户黑名单列表",
  817. "parameters": [
  818. {
  819. "type": "integer",
  820. "description": "用户id",
  821. "name": "uid",
  822. "in": "query",
  823. "required": true
  824. }
  825. ],
  826. "responses": {
  827. "200": {
  828. "description": "OK",
  829. "schema": {
  830. "$ref": "#/definitions/response.Response"
  831. }
  832. }
  833. }
  834. }
  835. },
  836. "/relation/create": {
  837. "post": {
  838. "consumes": [
  839. "application/json"
  840. ],
  841. "produces": [
  842. "application/json"
  843. ],
  844. "tags": [
  845. "用户关系模块"
  846. ],
  847. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  848. "parameters": [
  849. {
  850. "description": "关系数据",
  851. "name": "json",
  852. "in": "body",
  853. "required": true,
  854. "schema": {
  855. "$ref": "#/definitions/model.RelationJson"
  856. }
  857. }
  858. ],
  859. "responses": {
  860. "200": {
  861. "description": "OK",
  862. "schema": {
  863. "$ref": "#/definitions/response.Response"
  864. }
  865. }
  866. }
  867. }
  868. },
  869. "/relation/delete/{id}": {
  870. "delete": {
  871. "produces": [
  872. "application/json"
  873. ],
  874. "tags": [
  875. "用户关系模块"
  876. ],
  877. "summary": "根据关系id删除关系",
  878. "parameters": [
  879. {
  880. "type": "integer",
  881. "description": "关系id",
  882. "name": "id",
  883. "in": "path",
  884. "required": true
  885. }
  886. ],
  887. "responses": {
  888. "200": {
  889. "description": "OK",
  890. "schema": {
  891. "$ref": "#/definitions/response.Response"
  892. }
  893. }
  894. }
  895. }
  896. },
  897. "/relation/friend": {
  898. "get": {
  899. "produces": [
  900. "application/json"
  901. ],
  902. "tags": [
  903. "用户关系模块"
  904. ],
  905. "summary": "传入用户id获取用户好友列表",
  906. "parameters": [
  907. {
  908. "type": "integer",
  909. "description": "用户id",
  910. "name": "uid",
  911. "in": "query",
  912. "required": true
  913. }
  914. ],
  915. "responses": {
  916. "200": {
  917. "description": "OK",
  918. "schema": {
  919. "$ref": "#/definitions/response.Response"
  920. }
  921. }
  922. }
  923. }
  924. },
  925. "/user/info": {
  926. "get": {
  927. "produces": [
  928. "application/json"
  929. ],
  930. "tags": [
  931. "用户模块"
  932. ],
  933. "summary": "获取用户信息",
  934. "responses": {
  935. "200": {
  936. "description": "OK",
  937. "schema": {
  938. "$ref": "#/definitions/response.Response"
  939. }
  940. }
  941. }
  942. }
  943. },
  944. "/user/login": {
  945. "post": {
  946. "produces": [
  947. "application/json"
  948. ],
  949. "tags": [
  950. "用户模块"
  951. ],
  952. "summary": "登录",
  953. "parameters": [
  954. {
  955. "type": "string",
  956. "description": "微信ID",
  957. "name": "vid",
  958. "in": "formData"
  959. }
  960. ],
  961. "responses": {
  962. "200": {
  963. "description": "OK",
  964. "schema": {
  965. "$ref": "#/definitions/response.Response"
  966. }
  967. }
  968. }
  969. }
  970. },
  971. "/user/modify": {
  972. "post": {
  973. "consumes": [
  974. "application/json"
  975. ],
  976. "produces": [
  977. "application/json"
  978. ],
  979. "tags": [
  980. "用户模块"
  981. ],
  982. "summary": "修改用户信息",
  983. "parameters": [
  984. {
  985. "description": "用户信息",
  986. "name": "json",
  987. "in": "body",
  988. "required": true,
  989. "schema": {
  990. "$ref": "#/definitions/model.User"
  991. }
  992. }
  993. ],
  994. "responses": {
  995. "200": {
  996. "description": "OK",
  997. "schema": {
  998. "$ref": "#/definitions/response.Response"
  999. }
  1000. }
  1001. }
  1002. }
  1003. },
  1004. "/user/register": {
  1005. "post": {
  1006. "consumes": [
  1007. "application/json"
  1008. ],
  1009. "produces": [
  1010. "application/json"
  1011. ],
  1012. "tags": [
  1013. "用户模块"
  1014. ],
  1015. "summary": "创建用户",
  1016. "parameters": [
  1017. {
  1018. "description": "用户信息",
  1019. "name": "json",
  1020. "in": "body",
  1021. "required": true,
  1022. "schema": {
  1023. "$ref": "#/definitions/model.UserJson"
  1024. }
  1025. }
  1026. ],
  1027. "responses": {
  1028. "200": {
  1029. "description": "OK",
  1030. "schema": {
  1031. "$ref": "#/definitions/response.Response"
  1032. }
  1033. }
  1034. }
  1035. }
  1036. }
  1037. },
  1038. "definitions": {
  1039. "model.Appraise": {
  1040. "type": "object",
  1041. "properties": {
  1042. "buyerId": {
  1043. "type": "integer"
  1044. },
  1045. "content": {
  1046. "type": "string"
  1047. },
  1048. "goodsId": {
  1049. "type": "integer"
  1050. },
  1051. "id": {
  1052. "type": "integer"
  1053. },
  1054. "star": {
  1055. "type": "integer"
  1056. },
  1057. "time": {
  1058. "type": "integer"
  1059. }
  1060. }
  1061. },
  1062. "model.AppraiseJson": {
  1063. "type": "object",
  1064. "properties": {
  1065. "buyerId": {
  1066. "type": "integer"
  1067. },
  1068. "content": {
  1069. "type": "string"
  1070. },
  1071. "goodsId": {
  1072. "type": "integer"
  1073. },
  1074. "star": {
  1075. "type": "integer"
  1076. },
  1077. "time": {
  1078. "type": "integer"
  1079. }
  1080. }
  1081. },
  1082. "model.CategoryJson": {
  1083. "type": "object",
  1084. "properties": {
  1085. "name": {
  1086. "type": "string"
  1087. },
  1088. "pic": {
  1089. "type": "string"
  1090. }
  1091. }
  1092. },
  1093. "model.Goods": {
  1094. "type": "object",
  1095. "properties": {
  1096. "desc": {
  1097. "type": "string"
  1098. },
  1099. "id": {
  1100. "type": "integer"
  1101. },
  1102. "integrity": {
  1103. "type": "integer"
  1104. },
  1105. "ownerId": {
  1106. "type": "integer"
  1107. },
  1108. "picId": {
  1109. "type": "integer"
  1110. },
  1111. "place": {
  1112. "type": "string"
  1113. },
  1114. "price": {
  1115. "type": "integer"
  1116. },
  1117. "state": {
  1118. "type": "integer"
  1119. },
  1120. "title": {
  1121. "type": "string"
  1122. }
  1123. }
  1124. },
  1125. "model.GoodsJson": {
  1126. "type": "object",
  1127. "properties": {
  1128. "categories": {
  1129. "type": "array",
  1130. "items": {
  1131. "type": "integer"
  1132. }
  1133. },
  1134. "desc": {
  1135. "type": "string"
  1136. },
  1137. "integrity": {
  1138. "type": "integer"
  1139. },
  1140. "ownerId": {
  1141. "type": "integer"
  1142. },
  1143. "pic_id": {
  1144. "type": "integer"
  1145. },
  1146. "place": {
  1147. "type": "string"
  1148. },
  1149. "price": {
  1150. "type": "integer"
  1151. },
  1152. "state": {
  1153. "type": "integer"
  1154. },
  1155. "title": {
  1156. "type": "string"
  1157. }
  1158. }
  1159. },
  1160. "model.OrderJson": {
  1161. "type": "object",
  1162. "properties": {
  1163. "buyerId": {
  1164. "type": "integer"
  1165. },
  1166. "goodsId": {
  1167. "type": "integer"
  1168. },
  1169. "phone": {
  1170. "type": "string"
  1171. },
  1172. "place": {
  1173. "type": "string"
  1174. },
  1175. "state": {
  1176. "type": "integer"
  1177. },
  1178. "time": {
  1179. "type": "integer"
  1180. }
  1181. }
  1182. },
  1183. "model.RelationJson": {
  1184. "type": "object",
  1185. "properties": {
  1186. "owner": {
  1187. "type": "integer"
  1188. },
  1189. "target": {
  1190. "type": "integer"
  1191. },
  1192. "type": {
  1193. "type": "integer"
  1194. }
  1195. }
  1196. },
  1197. "model.User": {
  1198. "type": "object",
  1199. "properties": {
  1200. "avatar": {
  1201. "type": "string"
  1202. },
  1203. "name": {
  1204. "type": "string"
  1205. },
  1206. "phone": {
  1207. "type": "string"
  1208. },
  1209. "uid": {
  1210. "type": "integer"
  1211. },
  1212. "vid": {
  1213. "type": "string"
  1214. }
  1215. }
  1216. },
  1217. "model.UserJson": {
  1218. "type": "object",
  1219. "properties": {
  1220. "avatar": {
  1221. "type": "string"
  1222. },
  1223. "name": {
  1224. "type": "string"
  1225. },
  1226. "phone": {
  1227. "type": "string"
  1228. },
  1229. "vid": {
  1230. "type": "string"
  1231. }
  1232. }
  1233. },
  1234. "response.Response": {
  1235. "type": "object",
  1236. "properties": {
  1237. "code": {
  1238. "type": "integer"
  1239. },
  1240. "data": {},
  1241. "message": {
  1242. "type": "string"
  1243. }
  1244. }
  1245. }
  1246. }
  1247. }