swagger.json 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602
  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.27: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/latest": {
  307. "get": {
  308. "tags": [
  309. "聊天模块"
  310. ],
  311. "summary": "获取与特定用户相关的最后一条聊天记录",
  312. "parameters": [
  313. {
  314. "type": "string",
  315. "description": "用户id",
  316. "name": "uid",
  317. "in": "query",
  318. "required": true
  319. },
  320. {
  321. "type": "string",
  322. "description": "对象id",
  323. "name": "target",
  324. "in": "query",
  325. "required": true
  326. }
  327. ],
  328. "responses": {
  329. "200": {
  330. "description": "OK",
  331. "schema": {
  332. "$ref": "#/definitions/response.Response"
  333. }
  334. }
  335. }
  336. }
  337. },
  338. "/chat/msg": {
  339. "get": {
  340. "tags": [
  341. "聊天模块"
  342. ],
  343. "summary": "获取与特定两个用户之间的所有聊天记录",
  344. "parameters": [
  345. {
  346. "type": "string",
  347. "description": "用户id",
  348. "name": "uid",
  349. "in": "query",
  350. "required": true
  351. },
  352. {
  353. "type": "string",
  354. "description": "对象id",
  355. "name": "target",
  356. "in": "query",
  357. "required": true
  358. }
  359. ],
  360. "responses": {
  361. "200": {
  362. "description": "OK",
  363. "schema": {
  364. "$ref": "#/definitions/response.Response"
  365. }
  366. }
  367. }
  368. }
  369. },
  370. "/chat/to/{page}/{pageSize}": {
  371. "get": {
  372. "tags": [
  373. "聊天模块"
  374. ],
  375. "summary": "获取未过期且目标为特定用户的聊天记录",
  376. "parameters": [
  377. {
  378. "type": "integer",
  379. "description": "页数",
  380. "name": "page",
  381. "in": "path",
  382. "required": true
  383. },
  384. {
  385. "type": "integer",
  386. "description": "一页的大小",
  387. "name": "pageSize",
  388. "in": "path",
  389. "required": true
  390. },
  391. {
  392. "type": "string",
  393. "description": "用户id",
  394. "name": "uid",
  395. "in": "query",
  396. "required": true
  397. }
  398. ],
  399. "responses": {
  400. "200": {
  401. "description": "OK",
  402. "schema": {
  403. "$ref": "#/definitions/response.Response"
  404. }
  405. }
  406. }
  407. }
  408. },
  409. "/goods/category/{page}/{pageSize}": {
  410. "get": {
  411. "produces": [
  412. "application/json"
  413. ],
  414. "tags": [
  415. "商品模块"
  416. ],
  417. "summary": "按分类查找商品并分页显示",
  418. "parameters": [
  419. {
  420. "type": "integer",
  421. "description": "页数",
  422. "name": "page",
  423. "in": "path",
  424. "required": true
  425. },
  426. {
  427. "type": "integer",
  428. "description": "一页的大小",
  429. "name": "pageSize",
  430. "in": "path",
  431. "required": true
  432. },
  433. {
  434. "type": "integer",
  435. "description": "商品分类id",
  436. "name": "category",
  437. "in": "query",
  438. "required": true
  439. }
  440. ],
  441. "responses": {
  442. "200": {
  443. "description": "OK",
  444. "schema": {
  445. "$ref": "#/definitions/response.Response"
  446. }
  447. }
  448. }
  449. }
  450. },
  451. "/goods/create": {
  452. "post": {
  453. "consumes": [
  454. "application/json"
  455. ],
  456. "produces": [
  457. "application/json"
  458. ],
  459. "tags": [
  460. "商品模块"
  461. ],
  462. "summary": "创建商品",
  463. "parameters": [
  464. {
  465. "description": "商品信息",
  466. "name": "json",
  467. "in": "body",
  468. "required": true,
  469. "schema": {
  470. "$ref": "#/definitions/model.GoodsJson"
  471. }
  472. }
  473. ],
  474. "responses": {
  475. "200": {
  476. "description": "OK",
  477. "schema": {
  478. "$ref": "#/definitions/response.Response"
  479. }
  480. }
  481. }
  482. }
  483. },
  484. "/goods/delete/{id}": {
  485. "delete": {
  486. "produces": [
  487. "application/json"
  488. ],
  489. "tags": [
  490. "商品模块"
  491. ],
  492. "summary": "删除商品",
  493. "parameters": [
  494. {
  495. "type": "integer",
  496. "description": "商品id",
  497. "name": "id",
  498. "in": "path",
  499. "required": true
  500. }
  501. ],
  502. "responses": {
  503. "200": {
  504. "description": "OK",
  505. "schema": {
  506. "$ref": "#/definitions/response.Response"
  507. }
  508. }
  509. }
  510. }
  511. },
  512. "/goods/detail/{id}": {
  513. "get": {
  514. "produces": [
  515. "application/json"
  516. ],
  517. "tags": [
  518. "商品模块"
  519. ],
  520. "summary": "获取商品详细信息",
  521. "parameters": [
  522. {
  523. "type": "integer",
  524. "description": "商品id",
  525. "name": "id",
  526. "in": "path",
  527. "required": true
  528. },
  529. {
  530. "type": "integer",
  531. "description": "访问的用户id",
  532. "name": "uid",
  533. "in": "query",
  534. "required": true
  535. },
  536. {
  537. "type": "integer",
  538. "description": "访问时间的时间戳",
  539. "name": "date",
  540. "in": "query",
  541. "required": true
  542. }
  543. ],
  544. "responses": {
  545. "200": {
  546. "description": "OK",
  547. "schema": {
  548. "$ref": "#/definitions/response.Response"
  549. }
  550. }
  551. }
  552. }
  553. },
  554. "/goods/list": {
  555. "post": {
  556. "produces": [
  557. "application/json"
  558. ],
  559. "tags": [
  560. "商品模块"
  561. ],
  562. "summary": "批量获取商品信息",
  563. "parameters": [
  564. {
  565. "description": "商品id列表",
  566. "name": "id",
  567. "in": "body",
  568. "required": true,
  569. "schema": {
  570. "type": "array",
  571. "items": {
  572. "type": "string"
  573. }
  574. }
  575. }
  576. ],
  577. "responses": {
  578. "200": {
  579. "description": "OK",
  580. "schema": {
  581. "$ref": "#/definitions/response.Response"
  582. }
  583. }
  584. }
  585. }
  586. },
  587. "/goods/recommend": {
  588. "get": {
  589. "produces": [
  590. "application/json"
  591. ],
  592. "tags": [
  593. "商品模块"
  594. ],
  595. "summary": "分页获取推荐商品",
  596. "parameters": [
  597. {
  598. "type": "integer",
  599. "description": "用户id",
  600. "name": "id",
  601. "in": "query",
  602. "required": true
  603. },
  604. {
  605. "type": "integer",
  606. "description": "推荐的数目",
  607. "name": "size",
  608. "in": "query",
  609. "required": true
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "OK",
  615. "schema": {
  616. "$ref": "#/definitions/response.Response"
  617. }
  618. }
  619. }
  620. }
  621. },
  622. "/goods/revise": {
  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.Goods"
  639. }
  640. }
  641. ],
  642. "responses": {
  643. "200": {
  644. "description": "OK",
  645. "schema": {
  646. "$ref": "#/definitions/response.Response"
  647. }
  648. }
  649. }
  650. }
  651. },
  652. "/goods/search/{page}/{pageSize}": {
  653. "get": {
  654. "produces": [
  655. "application/json"
  656. ],
  657. "tags": [
  658. "商品模块"
  659. ],
  660. "summary": "搜索商品并分页显示",
  661. "parameters": [
  662. {
  663. "type": "integer",
  664. "description": "页数",
  665. "name": "page",
  666. "in": "path",
  667. "required": true
  668. },
  669. {
  670. "type": "integer",
  671. "description": "一页的大小",
  672. "name": "pageSize",
  673. "in": "path",
  674. "required": true
  675. },
  676. {
  677. "type": "string",
  678. "description": "搜素关键词",
  679. "name": "keyword",
  680. "in": "query",
  681. "required": true
  682. }
  683. ],
  684. "responses": {
  685. "200": {
  686. "description": "OK",
  687. "schema": {
  688. "$ref": "#/definitions/response.Response"
  689. }
  690. }
  691. }
  692. }
  693. },
  694. "/goods/user/{id}": {
  695. "get": {
  696. "produces": [
  697. "application/json"
  698. ],
  699. "tags": [
  700. "商品模块"
  701. ],
  702. "summary": "获取某个用户的所有商品",
  703. "parameters": [
  704. {
  705. "type": "integer",
  706. "description": "用户id",
  707. "name": "id",
  708. "in": "path",
  709. "required": true
  710. }
  711. ],
  712. "responses": {
  713. "200": {
  714. "description": "OK",
  715. "schema": {
  716. "$ref": "#/definitions/response.Response"
  717. }
  718. }
  719. }
  720. }
  721. },
  722. "/goods/{page}/{pageSize}": {
  723. "get": {
  724. "produces": [
  725. "application/json"
  726. ],
  727. "tags": [
  728. "商品模块"
  729. ],
  730. "summary": "获取所有商品",
  731. "parameters": [
  732. {
  733. "type": "integer",
  734. "description": "页数",
  735. "name": "page",
  736. "in": "path",
  737. "required": true
  738. },
  739. {
  740. "type": "integer",
  741. "description": "一页的大小",
  742. "name": "pageSize",
  743. "in": "path",
  744. "required": true
  745. }
  746. ],
  747. "responses": {
  748. "200": {
  749. "description": "OK",
  750. "schema": {
  751. "$ref": "#/definitions/response.Response"
  752. }
  753. }
  754. }
  755. }
  756. },
  757. "/order": {
  758. "get": {
  759. "produces": [
  760. "application/json"
  761. ],
  762. "tags": [
  763. "订单模块"
  764. ],
  765. "summary": "获取所有订单",
  766. "responses": {
  767. "200": {
  768. "description": "OK",
  769. "schema": {
  770. "$ref": "#/definitions/response.Response"
  771. }
  772. }
  773. }
  774. }
  775. },
  776. "/order/create": {
  777. "post": {
  778. "produces": [
  779. "application/json"
  780. ],
  781. "tags": [
  782. "订单模块"
  783. ],
  784. "summary": "创建订单",
  785. "parameters": [
  786. {
  787. "description": "订单信息",
  788. "name": "json",
  789. "in": "body",
  790. "required": true,
  791. "schema": {
  792. "$ref": "#/definitions/model.OrderJson"
  793. }
  794. }
  795. ],
  796. "responses": {
  797. "200": {
  798. "description": "OK",
  799. "schema": {
  800. "$ref": "#/definitions/response.Response"
  801. }
  802. }
  803. }
  804. }
  805. },
  806. "/order/delete/{id}": {
  807. "delete": {
  808. "produces": [
  809. "application/json"
  810. ],
  811. "tags": [
  812. "订单模块"
  813. ],
  814. "summary": "删除订单",
  815. "parameters": [
  816. {
  817. "type": "integer",
  818. "description": "订单id",
  819. "name": "id",
  820. "in": "path",
  821. "required": true
  822. }
  823. ],
  824. "responses": {
  825. "200": {
  826. "description": "OK",
  827. "schema": {
  828. "$ref": "#/definitions/response.Response"
  829. }
  830. }
  831. }
  832. }
  833. },
  834. "/order/revise": {
  835. "post": {
  836. "produces": [
  837. "application/json"
  838. ],
  839. "tags": [
  840. "订单模块"
  841. ],
  842. "summary": "修改订单的状态",
  843. "parameters": [
  844. {
  845. "type": "integer",
  846. "description": "订单id",
  847. "name": "id",
  848. "in": "formData",
  849. "required": true
  850. },
  851. {
  852. "type": "integer",
  853. "description": "订单状态",
  854. "name": "state",
  855. "in": "formData",
  856. "required": true
  857. }
  858. ],
  859. "responses": {
  860. "200": {
  861. "description": "OK",
  862. "schema": {
  863. "$ref": "#/definitions/response.Response"
  864. }
  865. }
  866. }
  867. }
  868. },
  869. "/order/user": {
  870. "get": {
  871. "produces": [
  872. "application/json"
  873. ],
  874. "tags": [
  875. "订单模块"
  876. ],
  877. "summary": "获取用户的所有订单",
  878. "parameters": [
  879. {
  880. "type": "integer",
  881. "description": "用户id",
  882. "name": "id",
  883. "in": "query",
  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. "/order/{page}/{pageSize}": {
  898. "get": {
  899. "produces": [
  900. "application/json"
  901. ],
  902. "tags": [
  903. "订单模块"
  904. ],
  905. "summary": "分页获取订单",
  906. "parameters": [
  907. {
  908. "type": "integer",
  909. "description": "页数",
  910. "name": "page",
  911. "in": "path",
  912. "required": true
  913. },
  914. {
  915. "type": "integer",
  916. "description": "一页的大小",
  917. "name": "pageSize",
  918. "in": "path",
  919. "required": true
  920. }
  921. ],
  922. "responses": {
  923. "200": {
  924. "description": "OK",
  925. "schema": {
  926. "$ref": "#/definitions/response.Response"
  927. }
  928. }
  929. }
  930. }
  931. },
  932. "/pic": {
  933. "get": {
  934. "produces": [
  935. "application/json"
  936. ],
  937. "tags": [
  938. "图片模块"
  939. ],
  940. "summary": "获取所有图片",
  941. "responses": {
  942. "200": {
  943. "description": "OK",
  944. "schema": {
  945. "$ref": "#/definitions/response.Response"
  946. }
  947. }
  948. }
  949. }
  950. },
  951. "/pic/delete/{id}": {
  952. "delete": {
  953. "produces": [
  954. "application/json"
  955. ],
  956. "tags": [
  957. "图片模块"
  958. ],
  959. "summary": "删除图片",
  960. "parameters": [
  961. {
  962. "type": "integer",
  963. "description": "图片id",
  964. "name": "id",
  965. "in": "path",
  966. "required": true
  967. }
  968. ],
  969. "responses": {
  970. "200": {
  971. "description": "OK",
  972. "schema": {
  973. "$ref": "#/definitions/response.Response"
  974. }
  975. }
  976. }
  977. }
  978. },
  979. "/pic/upload": {
  980. "post": {
  981. "consumes": [
  982. "multipart/form-data"
  983. ],
  984. "produces": [
  985. "application/json"
  986. ],
  987. "tags": [
  988. "图片模块"
  989. ],
  990. "summary": "上传图片",
  991. "parameters": [
  992. {
  993. "type": "file",
  994. "description": "图片",
  995. "name": "pic",
  996. "in": "formData",
  997. "required": true
  998. }
  999. ],
  1000. "responses": {
  1001. "200": {
  1002. "description": "OK",
  1003. "schema": {
  1004. "$ref": "#/definitions/response.Response"
  1005. }
  1006. }
  1007. }
  1008. }
  1009. },
  1010. "/pic/{page}/{pageSize}": {
  1011. "get": {
  1012. "produces": [
  1013. "application/json"
  1014. ],
  1015. "tags": [
  1016. "图片模块"
  1017. ],
  1018. "summary": "分页获取图片",
  1019. "parameters": [
  1020. {
  1021. "type": "integer",
  1022. "description": "页数",
  1023. "name": "page",
  1024. "in": "path",
  1025. "required": true
  1026. },
  1027. {
  1028. "type": "integer",
  1029. "description": "一页的大小",
  1030. "name": "pageSize",
  1031. "in": "path",
  1032. "required": true
  1033. }
  1034. ],
  1035. "responses": {
  1036. "200": {
  1037. "description": "OK",
  1038. "schema": {
  1039. "$ref": "#/definitions/response.Response"
  1040. }
  1041. }
  1042. }
  1043. }
  1044. },
  1045. "/relation/bad": {
  1046. "get": {
  1047. "produces": [
  1048. "application/json"
  1049. ],
  1050. "tags": [
  1051. "用户关系模块"
  1052. ],
  1053. "summary": "传入用户id获取用户黑名单列表",
  1054. "parameters": [
  1055. {
  1056. "type": "integer",
  1057. "description": "用户id",
  1058. "name": "uid",
  1059. "in": "query",
  1060. "required": true
  1061. }
  1062. ],
  1063. "responses": {
  1064. "200": {
  1065. "description": "OK",
  1066. "schema": {
  1067. "$ref": "#/definitions/response.Response"
  1068. }
  1069. }
  1070. }
  1071. }
  1072. },
  1073. "/relation/create": {
  1074. "post": {
  1075. "consumes": [
  1076. "application/json"
  1077. ],
  1078. "produces": [
  1079. "application/json"
  1080. ],
  1081. "tags": [
  1082. "用户关系模块"
  1083. ],
  1084. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  1085. "parameters": [
  1086. {
  1087. "description": "关系数据",
  1088. "name": "json",
  1089. "in": "body",
  1090. "required": true,
  1091. "schema": {
  1092. "$ref": "#/definitions/model.RelationJson"
  1093. }
  1094. }
  1095. ],
  1096. "responses": {
  1097. "200": {
  1098. "description": "OK",
  1099. "schema": {
  1100. "$ref": "#/definitions/response.Response"
  1101. }
  1102. }
  1103. }
  1104. }
  1105. },
  1106. "/relation/delete/{id}": {
  1107. "delete": {
  1108. "produces": [
  1109. "application/json"
  1110. ],
  1111. "tags": [
  1112. "用户关系模块"
  1113. ],
  1114. "summary": "根据关系id删除关系",
  1115. "parameters": [
  1116. {
  1117. "type": "integer",
  1118. "description": "关系id",
  1119. "name": "id",
  1120. "in": "path",
  1121. "required": true
  1122. }
  1123. ],
  1124. "responses": {
  1125. "200": {
  1126. "description": "OK",
  1127. "schema": {
  1128. "$ref": "#/definitions/response.Response"
  1129. }
  1130. }
  1131. }
  1132. }
  1133. },
  1134. "/relation/friend": {
  1135. "get": {
  1136. "produces": [
  1137. "application/json"
  1138. ],
  1139. "tags": [
  1140. "用户关系模块"
  1141. ],
  1142. "summary": "传入用户id获取用户好友列表",
  1143. "parameters": [
  1144. {
  1145. "type": "integer",
  1146. "description": "用户id",
  1147. "name": "uid",
  1148. "in": "query",
  1149. "required": true
  1150. }
  1151. ],
  1152. "responses": {
  1153. "200": {
  1154. "description": "OK",
  1155. "schema": {
  1156. "$ref": "#/definitions/response.Response"
  1157. }
  1158. }
  1159. }
  1160. }
  1161. },
  1162. "/relation/{page}/{pageSize}": {
  1163. "get": {
  1164. "produces": [
  1165. "application/json"
  1166. ],
  1167. "tags": [
  1168. "用户关系模块"
  1169. ],
  1170. "summary": "分页用户关系",
  1171. "parameters": [
  1172. {
  1173. "type": "integer",
  1174. "description": "页数",
  1175. "name": "page",
  1176. "in": "path",
  1177. "required": true
  1178. },
  1179. {
  1180. "type": "integer",
  1181. "description": "一页的大小",
  1182. "name": "pageSize",
  1183. "in": "path",
  1184. "required": true
  1185. }
  1186. ],
  1187. "responses": {
  1188. "200": {
  1189. "description": "OK",
  1190. "schema": {
  1191. "$ref": "#/definitions/response.Response"
  1192. }
  1193. }
  1194. }
  1195. }
  1196. },
  1197. "/user/info": {
  1198. "get": {
  1199. "produces": [
  1200. "application/json"
  1201. ],
  1202. "tags": [
  1203. "用户模块"
  1204. ],
  1205. "summary": "获取用户信息",
  1206. "responses": {
  1207. "200": {
  1208. "description": "OK",
  1209. "schema": {
  1210. "$ref": "#/definitions/response.Response"
  1211. }
  1212. }
  1213. }
  1214. }
  1215. },
  1216. "/user/list": {
  1217. "post": {
  1218. "produces": [
  1219. "application/json"
  1220. ],
  1221. "tags": [
  1222. "用户模块"
  1223. ],
  1224. "summary": "批量获取用户信息",
  1225. "parameters": [
  1226. {
  1227. "description": "用户id列表",
  1228. "name": "uid",
  1229. "in": "body",
  1230. "required": true,
  1231. "schema": {
  1232. "type": "array",
  1233. "items": {
  1234. "type": "string"
  1235. }
  1236. }
  1237. }
  1238. ],
  1239. "responses": {
  1240. "200": {
  1241. "description": "OK",
  1242. "schema": {
  1243. "$ref": "#/definitions/response.Response"
  1244. }
  1245. }
  1246. }
  1247. }
  1248. },
  1249. "/user/login": {
  1250. "post": {
  1251. "produces": [
  1252. "application/json"
  1253. ],
  1254. "tags": [
  1255. "用户模块"
  1256. ],
  1257. "summary": "登录",
  1258. "parameters": [
  1259. {
  1260. "type": "string",
  1261. "description": "微信ID",
  1262. "name": "vid",
  1263. "in": "formData"
  1264. }
  1265. ],
  1266. "responses": {
  1267. "200": {
  1268. "description": "OK",
  1269. "schema": {
  1270. "$ref": "#/definitions/response.Response"
  1271. }
  1272. }
  1273. }
  1274. }
  1275. },
  1276. "/user/modify": {
  1277. "post": {
  1278. "consumes": [
  1279. "application/json"
  1280. ],
  1281. "produces": [
  1282. "application/json"
  1283. ],
  1284. "tags": [
  1285. "用户模块"
  1286. ],
  1287. "summary": "修改用户信息",
  1288. "parameters": [
  1289. {
  1290. "description": "用户信息",
  1291. "name": "json",
  1292. "in": "body",
  1293. "required": true,
  1294. "schema": {
  1295. "$ref": "#/definitions/model.User"
  1296. }
  1297. }
  1298. ],
  1299. "responses": {
  1300. "200": {
  1301. "description": "OK",
  1302. "schema": {
  1303. "$ref": "#/definitions/response.Response"
  1304. }
  1305. }
  1306. }
  1307. }
  1308. },
  1309. "/user/register": {
  1310. "post": {
  1311. "consumes": [
  1312. "application/json"
  1313. ],
  1314. "produces": [
  1315. "application/json"
  1316. ],
  1317. "tags": [
  1318. "用户模块"
  1319. ],
  1320. "summary": "创建用户",
  1321. "parameters": [
  1322. {
  1323. "description": "用户信息",
  1324. "name": "json",
  1325. "in": "body",
  1326. "required": true,
  1327. "schema": {
  1328. "$ref": "#/definitions/model.UserJson"
  1329. }
  1330. }
  1331. ],
  1332. "responses": {
  1333. "200": {
  1334. "description": "OK",
  1335. "schema": {
  1336. "$ref": "#/definitions/response.Response"
  1337. }
  1338. }
  1339. }
  1340. }
  1341. },
  1342. "/user/{page}/{pageSize}": {
  1343. "get": {
  1344. "produces": [
  1345. "application/json"
  1346. ],
  1347. "tags": [
  1348. "用户模块"
  1349. ],
  1350. "summary": "分页用户信息",
  1351. "parameters": [
  1352. {
  1353. "type": "integer",
  1354. "description": "页数",
  1355. "name": "page",
  1356. "in": "path",
  1357. "required": true
  1358. },
  1359. {
  1360. "type": "integer",
  1361. "description": "一页的大小",
  1362. "name": "pageSize",
  1363. "in": "path",
  1364. "required": true
  1365. }
  1366. ],
  1367. "responses": {
  1368. "200": {
  1369. "description": "OK",
  1370. "schema": {
  1371. "$ref": "#/definitions/response.Response"
  1372. }
  1373. }
  1374. }
  1375. }
  1376. }
  1377. },
  1378. "definitions": {
  1379. "model.Appraise": {
  1380. "type": "object",
  1381. "properties": {
  1382. "buyerId": {
  1383. "type": "integer"
  1384. },
  1385. "content": {
  1386. "type": "string"
  1387. },
  1388. "goodsId": {
  1389. "type": "integer"
  1390. },
  1391. "id": {
  1392. "type": "integer"
  1393. },
  1394. "star": {
  1395. "type": "integer"
  1396. },
  1397. "time": {
  1398. "type": "integer"
  1399. }
  1400. }
  1401. },
  1402. "model.AppraiseJson": {
  1403. "type": "object",
  1404. "properties": {
  1405. "buyerId": {
  1406. "type": "integer"
  1407. },
  1408. "content": {
  1409. "type": "string"
  1410. },
  1411. "goodsId": {
  1412. "type": "integer"
  1413. },
  1414. "star": {
  1415. "type": "integer"
  1416. },
  1417. "time": {
  1418. "type": "integer"
  1419. }
  1420. }
  1421. },
  1422. "model.CategoryJson": {
  1423. "type": "object",
  1424. "properties": {
  1425. "name": {
  1426. "type": "string"
  1427. },
  1428. "pic": {
  1429. "type": "string"
  1430. }
  1431. }
  1432. },
  1433. "model.Goods": {
  1434. "type": "object",
  1435. "properties": {
  1436. "desc": {
  1437. "type": "string"
  1438. },
  1439. "id": {
  1440. "type": "integer"
  1441. },
  1442. "ownerId": {
  1443. "type": "integer"
  1444. },
  1445. "pic": {
  1446. "type": "array",
  1447. "items": {
  1448. "type": "string"
  1449. }
  1450. },
  1451. "place": {
  1452. "type": "string"
  1453. },
  1454. "price": {
  1455. "type": "integer"
  1456. },
  1457. "state": {
  1458. "type": "integer"
  1459. },
  1460. "title": {
  1461. "type": "string"
  1462. }
  1463. }
  1464. },
  1465. "model.GoodsJson": {
  1466. "type": "object",
  1467. "properties": {
  1468. "categories": {
  1469. "type": "array",
  1470. "items": {
  1471. "type": "integer"
  1472. }
  1473. },
  1474. "desc": {
  1475. "type": "string"
  1476. },
  1477. "ownerId": {
  1478. "type": "integer"
  1479. },
  1480. "pic": {
  1481. "type": "array",
  1482. "items": {
  1483. "type": "string"
  1484. }
  1485. },
  1486. "place": {
  1487. "type": "string"
  1488. },
  1489. "price": {
  1490. "type": "integer"
  1491. },
  1492. "state": {
  1493. "type": "integer"
  1494. },
  1495. "title": {
  1496. "type": "string"
  1497. }
  1498. }
  1499. },
  1500. "model.OrderJson": {
  1501. "type": "object",
  1502. "properties": {
  1503. "buyerId": {
  1504. "type": "integer"
  1505. },
  1506. "goodsId": {
  1507. "type": "integer"
  1508. },
  1509. "phone": {
  1510. "type": "string"
  1511. },
  1512. "place": {
  1513. "type": "string"
  1514. },
  1515. "state": {
  1516. "type": "integer"
  1517. },
  1518. "time": {
  1519. "type": "integer"
  1520. }
  1521. }
  1522. },
  1523. "model.RelationJson": {
  1524. "type": "object",
  1525. "properties": {
  1526. "goodsId": {
  1527. "type": "integer"
  1528. },
  1529. "owner": {
  1530. "type": "string",
  1531. "example": "0"
  1532. },
  1533. "target": {
  1534. "type": "string",
  1535. "example": "0"
  1536. },
  1537. "type": {
  1538. "type": "integer"
  1539. }
  1540. }
  1541. },
  1542. "model.User": {
  1543. "type": "object",
  1544. "properties": {
  1545. "avatar": {
  1546. "type": "string"
  1547. },
  1548. "name": {
  1549. "type": "string"
  1550. },
  1551. "phone": {
  1552. "type": "string"
  1553. },
  1554. "sign": {
  1555. "type": "string"
  1556. },
  1557. "uid": {
  1558. "type": "string",
  1559. "example": "0"
  1560. },
  1561. "vid": {
  1562. "type": "string"
  1563. }
  1564. }
  1565. },
  1566. "model.UserJson": {
  1567. "type": "object",
  1568. "properties": {
  1569. "avatar": {
  1570. "type": "string"
  1571. },
  1572. "name": {
  1573. "type": "string"
  1574. },
  1575. "phone": {
  1576. "type": "string"
  1577. },
  1578. "sign": {
  1579. "type": "string"
  1580. },
  1581. "uid": {
  1582. "type": "string"
  1583. },
  1584. "vid": {
  1585. "type": "string"
  1586. }
  1587. }
  1588. },
  1589. "response.Response": {
  1590. "type": "object",
  1591. "properties": {
  1592. "code": {
  1593. "type": "integer"
  1594. },
  1595. "data": {},
  1596. "message": {
  1597. "type": "string"
  1598. }
  1599. }
  1600. }
  1601. }
  1602. }