swagger.json 38 KB

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