swagger.json 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
  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. "/goods/category/{page}/{pageSize}": {
  233. "get": {
  234. "produces": [
  235. "application/json"
  236. ],
  237. "tags": [
  238. "商品模块"
  239. ],
  240. "summary": "按分类查找商品并分页显示",
  241. "parameters": [
  242. {
  243. "type": "integer",
  244. "description": "页数",
  245. "name": "page",
  246. "in": "path",
  247. "required": true
  248. },
  249. {
  250. "type": "integer",
  251. "description": "一页的大小",
  252. "name": "pageSize",
  253. "in": "path",
  254. "required": true
  255. },
  256. {
  257. "type": "integer",
  258. "description": "商品分类id",
  259. "name": "category",
  260. "in": "query",
  261. "required": true
  262. }
  263. ],
  264. "responses": {
  265. "200": {
  266. "description": "OK",
  267. "schema": {
  268. "$ref": "#/definitions/response.Response"
  269. }
  270. }
  271. }
  272. }
  273. },
  274. "/goods/create": {
  275. "post": {
  276. "consumes": [
  277. "application/json"
  278. ],
  279. "produces": [
  280. "application/json"
  281. ],
  282. "tags": [
  283. "商品模块"
  284. ],
  285. "summary": "创建商品",
  286. "parameters": [
  287. {
  288. "description": "商品信息",
  289. "name": "json",
  290. "in": "body",
  291. "required": true,
  292. "schema": {
  293. "$ref": "#/definitions/model.GoodsJson"
  294. }
  295. }
  296. ],
  297. "responses": {
  298. "200": {
  299. "description": "OK",
  300. "schema": {
  301. "$ref": "#/definitions/response.Response"
  302. }
  303. }
  304. }
  305. }
  306. },
  307. "/goods/delete/{id}": {
  308. "delete": {
  309. "produces": [
  310. "application/json"
  311. ],
  312. "tags": [
  313. "商品模块"
  314. ],
  315. "summary": "删除商品",
  316. "parameters": [
  317. {
  318. "type": "integer",
  319. "description": "商品id",
  320. "name": "id",
  321. "in": "path",
  322. "required": true
  323. }
  324. ],
  325. "responses": {
  326. "200": {
  327. "description": "OK",
  328. "schema": {
  329. "$ref": "#/definitions/response.Response"
  330. }
  331. }
  332. }
  333. }
  334. },
  335. "/goods/detail/{id}": {
  336. "get": {
  337. "produces": [
  338. "application/json"
  339. ],
  340. "tags": [
  341. "商品模块"
  342. ],
  343. "summary": "获取商品详细信息",
  344. "parameters": [
  345. {
  346. "type": "integer",
  347. "description": "商品id",
  348. "name": "id",
  349. "in": "path",
  350. "required": true
  351. }
  352. ],
  353. "responses": {
  354. "200": {
  355. "description": "OK",
  356. "schema": {
  357. "$ref": "#/definitions/response.Response"
  358. }
  359. }
  360. }
  361. }
  362. },
  363. "/goods/recommend/{page}/{pageSize}": {
  364. "get": {
  365. "produces": [
  366. "application/json"
  367. ],
  368. "tags": [
  369. "商品模块"
  370. ],
  371. "summary": "分页获取推荐商品",
  372. "parameters": [
  373. {
  374. "type": "integer",
  375. "description": "用户id",
  376. "name": "id",
  377. "in": "query",
  378. "required": true
  379. },
  380. {
  381. "type": "integer",
  382. "description": "页数",
  383. "name": "page",
  384. "in": "path",
  385. "required": true
  386. },
  387. {
  388. "type": "integer",
  389. "description": "一页的大小",
  390. "name": "pageSize",
  391. "in": "path",
  392. "required": true
  393. }
  394. ],
  395. "responses": {
  396. "200": {
  397. "description": "OK",
  398. "schema": {
  399. "$ref": "#/definitions/response.Response"
  400. }
  401. }
  402. }
  403. }
  404. },
  405. "/goods/revise": {
  406. "post": {
  407. "produces": [
  408. "application/json"
  409. ],
  410. "tags": [
  411. "商品模块"
  412. ],
  413. "summary": "修改商品信息",
  414. "parameters": [
  415. {
  416. "description": "商品信息",
  417. "name": "json",
  418. "in": "body",
  419. "required": true,
  420. "schema": {
  421. "$ref": "#/definitions/model.Goods"
  422. }
  423. }
  424. ],
  425. "responses": {
  426. "200": {
  427. "description": "OK",
  428. "schema": {
  429. "$ref": "#/definitions/response.Response"
  430. }
  431. }
  432. }
  433. }
  434. },
  435. "/goods/search/{page}/{pageSize}": {
  436. "get": {
  437. "produces": [
  438. "application/json"
  439. ],
  440. "tags": [
  441. "商品模块"
  442. ],
  443. "summary": "搜索商品并分页显示",
  444. "parameters": [
  445. {
  446. "type": "integer",
  447. "description": "页数",
  448. "name": "page",
  449. "in": "path",
  450. "required": true
  451. },
  452. {
  453. "type": "integer",
  454. "description": "一页的大小",
  455. "name": "pageSize",
  456. "in": "path",
  457. "required": true
  458. },
  459. {
  460. "type": "string",
  461. "description": "搜素关键词",
  462. "name": "keyword",
  463. "in": "query",
  464. "required": true
  465. }
  466. ],
  467. "responses": {
  468. "200": {
  469. "description": "OK",
  470. "schema": {
  471. "$ref": "#/definitions/response.Response"
  472. }
  473. }
  474. }
  475. }
  476. },
  477. "/goods/user/{id}": {
  478. "get": {
  479. "produces": [
  480. "application/json"
  481. ],
  482. "tags": [
  483. "商品模块"
  484. ],
  485. "summary": "获取某个用户的所有商品",
  486. "parameters": [
  487. {
  488. "type": "integer",
  489. "description": "用户id",
  490. "name": "id",
  491. "in": "path",
  492. "required": true
  493. }
  494. ],
  495. "responses": {
  496. "200": {
  497. "description": "OK",
  498. "schema": {
  499. "$ref": "#/definitions/response.Response"
  500. }
  501. }
  502. }
  503. }
  504. },
  505. "/goods/{page}/{pageSize}": {
  506. "get": {
  507. "produces": [
  508. "application/json"
  509. ],
  510. "tags": [
  511. "商品模块"
  512. ],
  513. "summary": "获取所有商品",
  514. "parameters": [
  515. {
  516. "type": "integer",
  517. "description": "页数",
  518. "name": "page",
  519. "in": "path",
  520. "required": true
  521. },
  522. {
  523. "type": "integer",
  524. "description": "一页的大小",
  525. "name": "pageSize",
  526. "in": "path",
  527. "required": true
  528. }
  529. ],
  530. "responses": {
  531. "200": {
  532. "description": "OK",
  533. "schema": {
  534. "$ref": "#/definitions/response.Response"
  535. }
  536. }
  537. }
  538. }
  539. },
  540. "/message": {
  541. "get": {
  542. "produces": [
  543. "application/json"
  544. ],
  545. "tags": [
  546. "信息模块"
  547. ],
  548. "summary": "传入用户id获取用户消息记录",
  549. "parameters": [
  550. {
  551. "type": "integer",
  552. "description": "用户id",
  553. "name": "uid",
  554. "in": "query",
  555. "required": true
  556. }
  557. ],
  558. "responses": {
  559. "200": {
  560. "description": "OK",
  561. "schema": {
  562. "$ref": "#/definitions/response.Response"
  563. }
  564. }
  565. }
  566. }
  567. },
  568. "/message/conv": {
  569. "get": {
  570. "produces": [
  571. "application/json"
  572. ],
  573. "tags": [
  574. "信息模块"
  575. ],
  576. "summary": "传入用户id和聊天对象id获取消息记录",
  577. "parameters": [
  578. {
  579. "type": "integer",
  580. "description": "用户id",
  581. "name": "uid",
  582. "in": "query",
  583. "required": true
  584. },
  585. {
  586. "type": "integer",
  587. "description": "对象id",
  588. "name": "targetId",
  589. "in": "query",
  590. "required": true
  591. }
  592. ],
  593. "responses": {
  594. "200": {
  595. "description": "OK",
  596. "schema": {
  597. "$ref": "#/definitions/response.Response"
  598. }
  599. }
  600. }
  601. }
  602. },
  603. "/order": {
  604. "get": {
  605. "produces": [
  606. "application/json"
  607. ],
  608. "tags": [
  609. "订单模块"
  610. ],
  611. "summary": "获取所有订单",
  612. "responses": {
  613. "200": {
  614. "description": "OK",
  615. "schema": {
  616. "$ref": "#/definitions/response.Response"
  617. }
  618. }
  619. }
  620. }
  621. },
  622. "/order/create": {
  623. "post": {
  624. "produces": [
  625. "application/json"
  626. ],
  627. "tags": [
  628. "订单模块"
  629. ],
  630. "summary": "创建订单",
  631. "parameters": [
  632. {
  633. "description": "订单信息",
  634. "name": "json",
  635. "in": "body",
  636. "required": true,
  637. "schema": {
  638. "$ref": "#/definitions/model.OrderJson"
  639. }
  640. }
  641. ],
  642. "responses": {
  643. "200": {
  644. "description": "OK",
  645. "schema": {
  646. "$ref": "#/definitions/response.Response"
  647. }
  648. }
  649. }
  650. }
  651. },
  652. "/order/delete/{id}": {
  653. "delete": {
  654. "produces": [
  655. "application/json"
  656. ],
  657. "tags": [
  658. "订单模块"
  659. ],
  660. "summary": "删除订单",
  661. "parameters": [
  662. {
  663. "type": "integer",
  664. "description": "订单id",
  665. "name": "id",
  666. "in": "path",
  667. "required": true
  668. }
  669. ],
  670. "responses": {
  671. "200": {
  672. "description": "OK",
  673. "schema": {
  674. "$ref": "#/definitions/response.Response"
  675. }
  676. }
  677. }
  678. }
  679. },
  680. "/order/revise": {
  681. "post": {
  682. "produces": [
  683. "application/json"
  684. ],
  685. "tags": [
  686. "订单模块"
  687. ],
  688. "summary": "修改订单的状态",
  689. "parameters": [
  690. {
  691. "type": "integer",
  692. "description": "订单id",
  693. "name": "id",
  694. "in": "formData",
  695. "required": true
  696. },
  697. {
  698. "type": "integer",
  699. "description": "订单状态",
  700. "name": "state",
  701. "in": "formData",
  702. "required": true
  703. }
  704. ],
  705. "responses": {
  706. "200": {
  707. "description": "OK",
  708. "schema": {
  709. "$ref": "#/definitions/response.Response"
  710. }
  711. }
  712. }
  713. }
  714. },
  715. "/order/user": {
  716. "get": {
  717. "produces": [
  718. "application/json"
  719. ],
  720. "tags": [
  721. "订单模块"
  722. ],
  723. "summary": "获取用户的所有订单",
  724. "parameters": [
  725. {
  726. "type": "integer",
  727. "description": "用户id",
  728. "name": "id",
  729. "in": "query",
  730. "required": true
  731. }
  732. ],
  733. "responses": {
  734. "200": {
  735. "description": "OK",
  736. "schema": {
  737. "$ref": "#/definitions/response.Response"
  738. }
  739. }
  740. }
  741. }
  742. },
  743. "/pic": {
  744. "get": {
  745. "produces": [
  746. "application/json"
  747. ],
  748. "tags": [
  749. "图片模块"
  750. ],
  751. "summary": "获取所有图片",
  752. "responses": {
  753. "200": {
  754. "description": "OK",
  755. "schema": {
  756. "$ref": "#/definitions/response.Response"
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "/pic/delete/{id}": {
  763. "delete": {
  764. "produces": [
  765. "application/json"
  766. ],
  767. "tags": [
  768. "图片模块"
  769. ],
  770. "summary": "删除图片",
  771. "parameters": [
  772. {
  773. "type": "integer",
  774. "description": "图片id",
  775. "name": "id",
  776. "in": "path",
  777. "required": true
  778. }
  779. ],
  780. "responses": {
  781. "200": {
  782. "description": "OK",
  783. "schema": {
  784. "$ref": "#/definitions/response.Response"
  785. }
  786. }
  787. }
  788. }
  789. },
  790. "/pic/upload": {
  791. "post": {
  792. "consumes": [
  793. "multipart/form-data"
  794. ],
  795. "produces": [
  796. "application/json"
  797. ],
  798. "tags": [
  799. "图片模块"
  800. ],
  801. "summary": "上传图片",
  802. "parameters": [
  803. {
  804. "type": "file",
  805. "description": "图片",
  806. "name": "pic",
  807. "in": "formData",
  808. "required": true
  809. }
  810. ],
  811. "responses": {
  812. "200": {
  813. "description": "OK",
  814. "schema": {
  815. "$ref": "#/definitions/response.Response"
  816. }
  817. }
  818. }
  819. }
  820. },
  821. "/relation/bad": {
  822. "get": {
  823. "produces": [
  824. "application/json"
  825. ],
  826. "tags": [
  827. "用户关系模块"
  828. ],
  829. "summary": "传入用户id获取用户黑名单列表",
  830. "parameters": [
  831. {
  832. "type": "integer",
  833. "description": "用户id",
  834. "name": "uid",
  835. "in": "query",
  836. "required": true
  837. }
  838. ],
  839. "responses": {
  840. "200": {
  841. "description": "OK",
  842. "schema": {
  843. "$ref": "#/definitions/response.Response"
  844. }
  845. }
  846. }
  847. }
  848. },
  849. "/relation/create": {
  850. "post": {
  851. "consumes": [
  852. "application/json"
  853. ],
  854. "produces": [
  855. "application/json"
  856. ],
  857. "tags": [
  858. "用户关系模块"
  859. ],
  860. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  861. "parameters": [
  862. {
  863. "description": "关系数据",
  864. "name": "json",
  865. "in": "body",
  866. "required": true,
  867. "schema": {
  868. "$ref": "#/definitions/model.RelationJson"
  869. }
  870. }
  871. ],
  872. "responses": {
  873. "200": {
  874. "description": "OK",
  875. "schema": {
  876. "$ref": "#/definitions/response.Response"
  877. }
  878. }
  879. }
  880. }
  881. },
  882. "/relation/delete/{id}": {
  883. "delete": {
  884. "produces": [
  885. "application/json"
  886. ],
  887. "tags": [
  888. "用户关系模块"
  889. ],
  890. "summary": "根据关系id删除关系",
  891. "parameters": [
  892. {
  893. "type": "integer",
  894. "description": "关系id",
  895. "name": "id",
  896. "in": "path",
  897. "required": true
  898. }
  899. ],
  900. "responses": {
  901. "200": {
  902. "description": "OK",
  903. "schema": {
  904. "$ref": "#/definitions/response.Response"
  905. }
  906. }
  907. }
  908. }
  909. },
  910. "/relation/friend": {
  911. "get": {
  912. "produces": [
  913. "application/json"
  914. ],
  915. "tags": [
  916. "用户关系模块"
  917. ],
  918. "summary": "传入用户id获取用户好友列表",
  919. "parameters": [
  920. {
  921. "type": "integer",
  922. "description": "用户id",
  923. "name": "uid",
  924. "in": "query",
  925. "required": true
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "OK",
  931. "schema": {
  932. "$ref": "#/definitions/response.Response"
  933. }
  934. }
  935. }
  936. }
  937. },
  938. "/user/info": {
  939. "get": {
  940. "produces": [
  941. "application/json"
  942. ],
  943. "tags": [
  944. "用户模块"
  945. ],
  946. "summary": "获取用户信息",
  947. "responses": {
  948. "200": {
  949. "description": "OK",
  950. "schema": {
  951. "$ref": "#/definitions/response.Response"
  952. }
  953. }
  954. }
  955. }
  956. },
  957. "/user/login": {
  958. "post": {
  959. "produces": [
  960. "application/json"
  961. ],
  962. "tags": [
  963. "用户模块"
  964. ],
  965. "summary": "登录",
  966. "parameters": [
  967. {
  968. "type": "string",
  969. "description": "微信ID",
  970. "name": "vid",
  971. "in": "formData"
  972. }
  973. ],
  974. "responses": {
  975. "200": {
  976. "description": "OK",
  977. "schema": {
  978. "$ref": "#/definitions/response.Response"
  979. }
  980. }
  981. }
  982. }
  983. },
  984. "/user/modify": {
  985. "post": {
  986. "consumes": [
  987. "application/json"
  988. ],
  989. "produces": [
  990. "application/json"
  991. ],
  992. "tags": [
  993. "用户模块"
  994. ],
  995. "summary": "修改用户信息",
  996. "parameters": [
  997. {
  998. "description": "用户信息",
  999. "name": "json",
  1000. "in": "body",
  1001. "required": true,
  1002. "schema": {
  1003. "$ref": "#/definitions/model.User"
  1004. }
  1005. }
  1006. ],
  1007. "responses": {
  1008. "200": {
  1009. "description": "OK",
  1010. "schema": {
  1011. "$ref": "#/definitions/response.Response"
  1012. }
  1013. }
  1014. }
  1015. }
  1016. },
  1017. "/user/register": {
  1018. "post": {
  1019. "consumes": [
  1020. "application/json"
  1021. ],
  1022. "produces": [
  1023. "application/json"
  1024. ],
  1025. "tags": [
  1026. "用户模块"
  1027. ],
  1028. "summary": "创建用户",
  1029. "parameters": [
  1030. {
  1031. "description": "用户信息",
  1032. "name": "json",
  1033. "in": "body",
  1034. "required": true,
  1035. "schema": {
  1036. "$ref": "#/definitions/model.UserJson"
  1037. }
  1038. }
  1039. ],
  1040. "responses": {
  1041. "200": {
  1042. "description": "OK",
  1043. "schema": {
  1044. "$ref": "#/definitions/response.Response"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. }
  1050. },
  1051. "definitions": {
  1052. "model.Appraise": {
  1053. "type": "object",
  1054. "properties": {
  1055. "buyerId": {
  1056. "type": "integer"
  1057. },
  1058. "content": {
  1059. "type": "string"
  1060. },
  1061. "goodsId": {
  1062. "type": "integer"
  1063. },
  1064. "id": {
  1065. "type": "integer"
  1066. },
  1067. "star": {
  1068. "type": "integer"
  1069. },
  1070. "time": {
  1071. "type": "integer"
  1072. }
  1073. }
  1074. },
  1075. "model.AppraiseJson": {
  1076. "type": "object",
  1077. "properties": {
  1078. "buyerId": {
  1079. "type": "integer"
  1080. },
  1081. "content": {
  1082. "type": "string"
  1083. },
  1084. "goodsId": {
  1085. "type": "integer"
  1086. },
  1087. "star": {
  1088. "type": "integer"
  1089. },
  1090. "time": {
  1091. "type": "integer"
  1092. }
  1093. }
  1094. },
  1095. "model.CategoryJson": {
  1096. "type": "object",
  1097. "properties": {
  1098. "name": {
  1099. "type": "string"
  1100. },
  1101. "pic": {
  1102. "type": "string"
  1103. }
  1104. }
  1105. },
  1106. "model.Goods": {
  1107. "type": "object",
  1108. "properties": {
  1109. "desc": {
  1110. "type": "string"
  1111. },
  1112. "id": {
  1113. "type": "integer"
  1114. },
  1115. "integrity": {
  1116. "type": "integer"
  1117. },
  1118. "ownerId": {
  1119. "type": "integer"
  1120. },
  1121. "picId": {
  1122. "type": "integer"
  1123. },
  1124. "place": {
  1125. "type": "string"
  1126. },
  1127. "price": {
  1128. "type": "integer"
  1129. },
  1130. "state": {
  1131. "type": "integer"
  1132. },
  1133. "title": {
  1134. "type": "string"
  1135. }
  1136. }
  1137. },
  1138. "model.GoodsJson": {
  1139. "type": "object",
  1140. "properties": {
  1141. "categories": {
  1142. "type": "array",
  1143. "items": {
  1144. "type": "integer"
  1145. }
  1146. },
  1147. "desc": {
  1148. "type": "string"
  1149. },
  1150. "integrity": {
  1151. "type": "integer"
  1152. },
  1153. "ownerId": {
  1154. "type": "integer"
  1155. },
  1156. "pic_id": {
  1157. "type": "integer"
  1158. },
  1159. "place": {
  1160. "type": "string"
  1161. },
  1162. "price": {
  1163. "type": "integer"
  1164. },
  1165. "state": {
  1166. "type": "integer"
  1167. },
  1168. "title": {
  1169. "type": "string"
  1170. }
  1171. }
  1172. },
  1173. "model.OrderJson": {
  1174. "type": "object",
  1175. "properties": {
  1176. "buyerId": {
  1177. "type": "integer"
  1178. },
  1179. "goodsId": {
  1180. "type": "integer"
  1181. },
  1182. "phone": {
  1183. "type": "string"
  1184. },
  1185. "place": {
  1186. "type": "string"
  1187. },
  1188. "state": {
  1189. "type": "integer"
  1190. },
  1191. "time": {
  1192. "type": "integer"
  1193. }
  1194. }
  1195. },
  1196. "model.RelationJson": {
  1197. "type": "object",
  1198. "properties": {
  1199. "owner": {
  1200. "type": "integer"
  1201. },
  1202. "target": {
  1203. "type": "integer"
  1204. },
  1205. "type": {
  1206. "type": "integer"
  1207. }
  1208. }
  1209. },
  1210. "model.User": {
  1211. "type": "object",
  1212. "properties": {
  1213. "avatar": {
  1214. "type": "string"
  1215. },
  1216. "name": {
  1217. "type": "string"
  1218. },
  1219. "phone": {
  1220. "type": "string"
  1221. },
  1222. "uid": {
  1223. "type": "integer"
  1224. },
  1225. "vid": {
  1226. "type": "string"
  1227. }
  1228. }
  1229. },
  1230. "model.UserJson": {
  1231. "type": "object",
  1232. "properties": {
  1233. "avatar": {
  1234. "type": "string"
  1235. },
  1236. "name": {
  1237. "type": "string"
  1238. },
  1239. "phone": {
  1240. "type": "string"
  1241. },
  1242. "vid": {
  1243. "type": "string"
  1244. }
  1245. }
  1246. },
  1247. "response.Response": {
  1248. "type": "object",
  1249. "properties": {
  1250. "code": {
  1251. "type": "integer"
  1252. },
  1253. "data": {},
  1254. "message": {
  1255. "type": "string"
  1256. }
  1257. }
  1258. }
  1259. }
  1260. }