swagger.json 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641
  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. "basePath": "/WeChatTrading/trading-go",
  15. "paths": {
  16. "/appraise/create": {
  17. "post": {
  18. "produces": [
  19. "application/json"
  20. ],
  21. "tags": [
  22. "评论模块"
  23. ],
  24. "summary": "创建评论",
  25. "parameters": [
  26. {
  27. "description": "评价信息",
  28. "name": "json",
  29. "in": "body",
  30. "required": true,
  31. "schema": {
  32. "$ref": "#/definitions/model.AppraiseJson"
  33. }
  34. }
  35. ],
  36. "responses": {
  37. "200": {
  38. "description": "OK",
  39. "schema": {
  40. "$ref": "#/definitions/response.Response"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "/appraise/delete/{id}": {
  47. "delete": {
  48. "produces": [
  49. "application/json"
  50. ],
  51. "tags": [
  52. "评论模块"
  53. ],
  54. "summary": "删除评论",
  55. "parameters": [
  56. {
  57. "type": "integer",
  58. "description": "评论id",
  59. "name": "id",
  60. "in": "path",
  61. "required": true
  62. }
  63. ],
  64. "responses": {
  65. "200": {
  66. "description": "OK",
  67. "schema": {
  68. "$ref": "#/definitions/response.Response"
  69. }
  70. }
  71. }
  72. }
  73. },
  74. "/appraise/revise": {
  75. "post": {
  76. "produces": [
  77. "application/json"
  78. ],
  79. "tags": [
  80. "评论模块"
  81. ],
  82. "summary": "修改评论",
  83. "parameters": [
  84. {
  85. "description": "评价信息",
  86. "name": "json",
  87. "in": "body",
  88. "required": true,
  89. "schema": {
  90. "$ref": "#/definitions/model.Appraise"
  91. }
  92. }
  93. ],
  94. "responses": {
  95. "200": {
  96. "description": "OK",
  97. "schema": {
  98. "$ref": "#/definitions/response.Response"
  99. }
  100. }
  101. }
  102. }
  103. },
  104. "/appraise/user": {
  105. "get": {
  106. "produces": [
  107. "application/json"
  108. ],
  109. "tags": [
  110. "评论模块"
  111. ],
  112. "summary": "获取用户评价",
  113. "parameters": [
  114. {
  115. "type": "integer",
  116. "description": "用户id",
  117. "name": "id",
  118. "in": "query",
  119. "required": true
  120. }
  121. ],
  122. "responses": {
  123. "200": {
  124. "description": "OK",
  125. "schema": {
  126. "$ref": "#/definitions/response.Response"
  127. }
  128. }
  129. }
  130. }
  131. },
  132. "/appraise/{page}/{pageSize}": {
  133. "get": {
  134. "produces": [
  135. "application/json"
  136. ],
  137. "tags": [
  138. "评论模块"
  139. ],
  140. "summary": "分页获取评论信息",
  141. "parameters": [
  142. {
  143. "type": "integer",
  144. "description": "页数",
  145. "name": "page",
  146. "in": "path",
  147. "required": true
  148. },
  149. {
  150. "type": "integer",
  151. "description": "一页的大小",
  152. "name": "pageSize",
  153. "in": "path",
  154. "required": true
  155. }
  156. ],
  157. "responses": {
  158. "200": {
  159. "description": "OK",
  160. "schema": {
  161. "$ref": "#/definitions/response.Response"
  162. }
  163. }
  164. }
  165. }
  166. },
  167. "/category": {
  168. "get": {
  169. "consumes": [
  170. "application/json"
  171. ],
  172. "produces": [
  173. "application/json"
  174. ],
  175. "tags": [
  176. "分类模块"
  177. ],
  178. "summary": "获取所有分类",
  179. "responses": {
  180. "200": {
  181. "description": "OK",
  182. "schema": {
  183. "$ref": "#/definitions/response.Response"
  184. }
  185. }
  186. }
  187. }
  188. },
  189. "/category/create": {
  190. "post": {
  191. "consumes": [
  192. "application/json"
  193. ],
  194. "produces": [
  195. "application/json"
  196. ],
  197. "tags": [
  198. "分类模块"
  199. ],
  200. "summary": "创建分类",
  201. "parameters": [
  202. {
  203. "description": "分类数据",
  204. "name": "json",
  205. "in": "body",
  206. "required": true,
  207. "schema": {
  208. "$ref": "#/definitions/model.CategoryJson"
  209. }
  210. }
  211. ],
  212. "responses": {
  213. "200": {
  214. "description": "OK",
  215. "schema": {
  216. "$ref": "#/definitions/response.Response"
  217. }
  218. }
  219. }
  220. }
  221. },
  222. "/category/delete/{id}": {
  223. "delete": {
  224. "produces": [
  225. "application/json"
  226. ],
  227. "tags": [
  228. "分类模块"
  229. ],
  230. "summary": "根据分类id删除某个分类",
  231. "parameters": [
  232. {
  233. "type": "integer",
  234. "description": "分类id",
  235. "name": "id",
  236. "in": "path",
  237. "required": true
  238. }
  239. ],
  240. "responses": {
  241. "200": {
  242. "description": "OK",
  243. "schema": {
  244. "$ref": "#/definitions/response.Response"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "/chat": {
  251. "get": {
  252. "tags": [
  253. "聊天模块"
  254. ],
  255. "summary": "与服务端进行websocket连接,请使用postman测试",
  256. "responses": {
  257. "200": {
  258. "description": "OK",
  259. "schema": {
  260. "$ref": "#/definitions/response.Response"
  261. }
  262. }
  263. }
  264. }
  265. },
  266. "/chat/from/{page}/{pageSize}": {
  267. "get": {
  268. "tags": [
  269. "聊天模块"
  270. ],
  271. "summary": "获取未过期且来源为特定用户的聊天记录",
  272. "parameters": [
  273. {
  274. "type": "integer",
  275. "description": "页数",
  276. "name": "page",
  277. "in": "path",
  278. "required": true
  279. },
  280. {
  281. "type": "integer",
  282. "description": "一页的大小",
  283. "name": "pageSize",
  284. "in": "path",
  285. "required": true
  286. },
  287. {
  288. "type": "string",
  289. "description": "用户id",
  290. "name": "uid",
  291. "in": "query",
  292. "required": true
  293. }
  294. ],
  295. "responses": {
  296. "200": {
  297. "description": "OK",
  298. "schema": {
  299. "$ref": "#/definitions/response.Response"
  300. }
  301. }
  302. }
  303. }
  304. },
  305. "/chat/latest": {
  306. "get": {
  307. "tags": [
  308. "聊天模块"
  309. ],
  310. "summary": "获取与特定用户相关的最后一条聊天记录",
  311. "parameters": [
  312. {
  313. "type": "string",
  314. "description": "用户id",
  315. "name": "uid",
  316. "in": "query",
  317. "required": true
  318. },
  319. {
  320. "type": "string",
  321. "description": "对象id",
  322. "name": "target",
  323. "in": "query",
  324. "required": true
  325. }
  326. ],
  327. "responses": {
  328. "200": {
  329. "description": "OK",
  330. "schema": {
  331. "$ref": "#/definitions/response.Response"
  332. }
  333. }
  334. }
  335. }
  336. },
  337. "/chat/msg": {
  338. "get": {
  339. "tags": [
  340. "聊天模块"
  341. ],
  342. "summary": "获取与特定两个用户之间的所有聊天记录",
  343. "parameters": [
  344. {
  345. "type": "string",
  346. "description": "用户id",
  347. "name": "uid",
  348. "in": "query",
  349. "required": true
  350. },
  351. {
  352. "type": "string",
  353. "description": "对象id",
  354. "name": "target",
  355. "in": "query",
  356. "required": true
  357. }
  358. ],
  359. "responses": {
  360. "200": {
  361. "description": "OK",
  362. "schema": {
  363. "$ref": "#/definitions/response.Response"
  364. }
  365. }
  366. }
  367. }
  368. },
  369. "/chat/to/{page}/{pageSize}": {
  370. "get": {
  371. "tags": [
  372. "聊天模块"
  373. ],
  374. "summary": "获取未过期且目标为特定用户的聊天记录",
  375. "parameters": [
  376. {
  377. "type": "integer",
  378. "description": "页数",
  379. "name": "page",
  380. "in": "path",
  381. "required": true
  382. },
  383. {
  384. "type": "integer",
  385. "description": "一页的大小",
  386. "name": "pageSize",
  387. "in": "path",
  388. "required": true
  389. },
  390. {
  391. "type": "string",
  392. "description": "用户id",
  393. "name": "uid",
  394. "in": "query",
  395. "required": true
  396. }
  397. ],
  398. "responses": {
  399. "200": {
  400. "description": "OK",
  401. "schema": {
  402. "$ref": "#/definitions/response.Response"
  403. }
  404. }
  405. }
  406. }
  407. },
  408. "/goods/category/{page}/{pageSize}": {
  409. "get": {
  410. "produces": [
  411. "application/json"
  412. ],
  413. "tags": [
  414. "商品模块"
  415. ],
  416. "summary": "按分类查找商品并分页显示",
  417. "parameters": [
  418. {
  419. "type": "integer",
  420. "description": "页数",
  421. "name": "page",
  422. "in": "path",
  423. "required": true
  424. },
  425. {
  426. "type": "integer",
  427. "description": "一页的大小",
  428. "name": "pageSize",
  429. "in": "path",
  430. "required": true
  431. },
  432. {
  433. "type": "integer",
  434. "description": "商品分类id",
  435. "name": "category",
  436. "in": "query",
  437. "required": true
  438. }
  439. ],
  440. "responses": {
  441. "200": {
  442. "description": "OK",
  443. "schema": {
  444. "$ref": "#/definitions/response.Response"
  445. }
  446. }
  447. }
  448. }
  449. },
  450. "/goods/create": {
  451. "post": {
  452. "consumes": [
  453. "application/json"
  454. ],
  455. "produces": [
  456. "application/json"
  457. ],
  458. "tags": [
  459. "商品模块"
  460. ],
  461. "summary": "创建商品",
  462. "parameters": [
  463. {
  464. "description": "商品信息",
  465. "name": "json",
  466. "in": "body",
  467. "required": true,
  468. "schema": {
  469. "$ref": "#/definitions/model.GoodsJson"
  470. }
  471. }
  472. ],
  473. "responses": {
  474. "200": {
  475. "description": "OK",
  476. "schema": {
  477. "$ref": "#/definitions/response.Response"
  478. }
  479. }
  480. }
  481. }
  482. },
  483. "/goods/delete/{id}": {
  484. "delete": {
  485. "produces": [
  486. "application/json"
  487. ],
  488. "tags": [
  489. "商品模块"
  490. ],
  491. "summary": "删除商品",
  492. "parameters": [
  493. {
  494. "type": "integer",
  495. "description": "商品id",
  496. "name": "id",
  497. "in": "path",
  498. "required": true
  499. }
  500. ],
  501. "responses": {
  502. "200": {
  503. "description": "OK",
  504. "schema": {
  505. "$ref": "#/definitions/response.Response"
  506. }
  507. }
  508. }
  509. }
  510. },
  511. "/goods/detail/{id}": {
  512. "get": {
  513. "produces": [
  514. "application/json"
  515. ],
  516. "tags": [
  517. "商品模块"
  518. ],
  519. "summary": "获取商品详细信息",
  520. "parameters": [
  521. {
  522. "type": "integer",
  523. "description": "商品id",
  524. "name": "id",
  525. "in": "path",
  526. "required": true
  527. },
  528. {
  529. "type": "integer",
  530. "description": "访问的用户id",
  531. "name": "uid",
  532. "in": "query",
  533. "required": true
  534. }
  535. ],
  536. "responses": {
  537. "200": {
  538. "description": "OK",
  539. "schema": {
  540. "$ref": "#/definitions/response.Response"
  541. }
  542. }
  543. }
  544. }
  545. },
  546. "/goods/list": {
  547. "post": {
  548. "produces": [
  549. "application/json"
  550. ],
  551. "tags": [
  552. "商品模块"
  553. ],
  554. "summary": "批量获取商品信息",
  555. "parameters": [
  556. {
  557. "description": "商品id列表",
  558. "name": "id",
  559. "in": "body",
  560. "required": true,
  561. "schema": {
  562. "type": "array",
  563. "items": {
  564. "type": "string"
  565. }
  566. }
  567. }
  568. ],
  569. "responses": {
  570. "200": {
  571. "description": "OK",
  572. "schema": {
  573. "$ref": "#/definitions/response.Response"
  574. }
  575. }
  576. }
  577. }
  578. },
  579. "/goods/recommend": {
  580. "get": {
  581. "produces": [
  582. "application/json"
  583. ],
  584. "tags": [
  585. "商品模块"
  586. ],
  587. "summary": "分页获取推荐商品",
  588. "parameters": [
  589. {
  590. "type": "integer",
  591. "description": "用户id",
  592. "name": "id",
  593. "in": "query",
  594. "required": true
  595. },
  596. {
  597. "type": "integer",
  598. "description": "推荐的数目",
  599. "name": "size",
  600. "in": "query",
  601. "required": true
  602. }
  603. ],
  604. "responses": {
  605. "200": {
  606. "description": "OK",
  607. "schema": {
  608. "$ref": "#/definitions/response.Response"
  609. }
  610. }
  611. }
  612. }
  613. },
  614. "/goods/revise": {
  615. "post": {
  616. "produces": [
  617. "application/json"
  618. ],
  619. "tags": [
  620. "商品模块"
  621. ],
  622. "summary": "修改商品信息",
  623. "parameters": [
  624. {
  625. "description": "商品信息",
  626. "name": "json",
  627. "in": "body",
  628. "required": true,
  629. "schema": {
  630. "$ref": "#/definitions/model.Goods"
  631. }
  632. }
  633. ],
  634. "responses": {
  635. "200": {
  636. "description": "OK",
  637. "schema": {
  638. "$ref": "#/definitions/response.Response"
  639. }
  640. }
  641. }
  642. }
  643. },
  644. "/goods/search/{page}/{pageSize}": {
  645. "get": {
  646. "produces": [
  647. "application/json"
  648. ],
  649. "tags": [
  650. "商品模块"
  651. ],
  652. "summary": "搜索商品并分页显示",
  653. "parameters": [
  654. {
  655. "type": "integer",
  656. "description": "页数",
  657. "name": "page",
  658. "in": "path",
  659. "required": true
  660. },
  661. {
  662. "type": "integer",
  663. "description": "一页的大小",
  664. "name": "pageSize",
  665. "in": "path",
  666. "required": true
  667. },
  668. {
  669. "type": "string",
  670. "description": "搜素关键词",
  671. "name": "keyword",
  672. "in": "query",
  673. "required": true
  674. }
  675. ],
  676. "responses": {
  677. "200": {
  678. "description": "OK",
  679. "schema": {
  680. "$ref": "#/definitions/response.Response"
  681. }
  682. }
  683. }
  684. }
  685. },
  686. "/goods/user/{id}": {
  687. "get": {
  688. "produces": [
  689. "application/json"
  690. ],
  691. "tags": [
  692. "商品模块"
  693. ],
  694. "summary": "获取某个用户的所有商品",
  695. "parameters": [
  696. {
  697. "type": "integer",
  698. "description": "用户id",
  699. "name": "id",
  700. "in": "path",
  701. "required": true
  702. }
  703. ],
  704. "responses": {
  705. "200": {
  706. "description": "OK",
  707. "schema": {
  708. "$ref": "#/definitions/response.Response"
  709. }
  710. }
  711. }
  712. }
  713. },
  714. "/goods/{page}/{pageSize}": {
  715. "get": {
  716. "produces": [
  717. "application/json"
  718. ],
  719. "tags": [
  720. "商品模块"
  721. ],
  722. "summary": "获取所有商品",
  723. "parameters": [
  724. {
  725. "type": "integer",
  726. "description": "页数",
  727. "name": "page",
  728. "in": "path",
  729. "required": true
  730. },
  731. {
  732. "type": "integer",
  733. "description": "一页的大小",
  734. "name": "pageSize",
  735. "in": "path",
  736. "required": true
  737. }
  738. ],
  739. "responses": {
  740. "200": {
  741. "description": "OK",
  742. "schema": {
  743. "$ref": "#/definitions/response.Response"
  744. }
  745. }
  746. }
  747. }
  748. },
  749. "/order": {
  750. "get": {
  751. "produces": [
  752. "application/json"
  753. ],
  754. "tags": [
  755. "订单模块"
  756. ],
  757. "summary": "获取所有订单",
  758. "responses": {
  759. "200": {
  760. "description": "OK",
  761. "schema": {
  762. "$ref": "#/definitions/response.Response"
  763. }
  764. }
  765. }
  766. }
  767. },
  768. "/order/create": {
  769. "post": {
  770. "produces": [
  771. "application/json"
  772. ],
  773. "tags": [
  774. "订单模块"
  775. ],
  776. "summary": "创建订单",
  777. "parameters": [
  778. {
  779. "description": "订单信息",
  780. "name": "json",
  781. "in": "body",
  782. "required": true,
  783. "schema": {
  784. "$ref": "#/definitions/model.OrderJson"
  785. }
  786. }
  787. ],
  788. "responses": {
  789. "200": {
  790. "description": "OK",
  791. "schema": {
  792. "$ref": "#/definitions/response.Response"
  793. }
  794. }
  795. }
  796. }
  797. },
  798. "/order/delete/{id}": {
  799. "delete": {
  800. "produces": [
  801. "application/json"
  802. ],
  803. "tags": [
  804. "订单模块"
  805. ],
  806. "summary": "删除订单",
  807. "parameters": [
  808. {
  809. "type": "integer",
  810. "description": "订单id",
  811. "name": "id",
  812. "in": "path",
  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. "/order/revise": {
  827. "post": {
  828. "produces": [
  829. "application/json"
  830. ],
  831. "tags": [
  832. "订单模块"
  833. ],
  834. "summary": "修改订单的状态",
  835. "parameters": [
  836. {
  837. "type": "integer",
  838. "description": "订单id",
  839. "name": "id",
  840. "in": "formData",
  841. "required": true
  842. },
  843. {
  844. "type": "integer",
  845. "description": "订单状态",
  846. "name": "state",
  847. "in": "formData",
  848. "required": true
  849. }
  850. ],
  851. "responses": {
  852. "200": {
  853. "description": "OK",
  854. "schema": {
  855. "$ref": "#/definitions/response.Response"
  856. }
  857. }
  858. }
  859. }
  860. },
  861. "/order/user": {
  862. "get": {
  863. "produces": [
  864. "application/json"
  865. ],
  866. "tags": [
  867. "订单模块"
  868. ],
  869. "summary": "获取用户的所有订单",
  870. "parameters": [
  871. {
  872. "type": "string",
  873. "description": "用户id",
  874. "name": "id",
  875. "in": "query",
  876. "required": true
  877. }
  878. ],
  879. "responses": {
  880. "200": {
  881. "description": "OK",
  882. "schema": {
  883. "$ref": "#/definitions/response.Response"
  884. }
  885. }
  886. }
  887. }
  888. },
  889. "/order/{page}/{pageSize}": {
  890. "get": {
  891. "produces": [
  892. "application/json"
  893. ],
  894. "tags": [
  895. "订单模块"
  896. ],
  897. "summary": "分页获取订单",
  898. "parameters": [
  899. {
  900. "type": "integer",
  901. "description": "页数",
  902. "name": "page",
  903. "in": "path",
  904. "required": true
  905. },
  906. {
  907. "type": "integer",
  908. "description": "一页的大小",
  909. "name": "pageSize",
  910. "in": "path",
  911. "required": true
  912. }
  913. ],
  914. "responses": {
  915. "200": {
  916. "description": "OK",
  917. "schema": {
  918. "$ref": "#/definitions/response.Response"
  919. }
  920. }
  921. }
  922. }
  923. },
  924. "/pic": {
  925. "get": {
  926. "produces": [
  927. "application/json"
  928. ],
  929. "tags": [
  930. "图片模块"
  931. ],
  932. "summary": "获取所有图片",
  933. "responses": {
  934. "200": {
  935. "description": "OK",
  936. "schema": {
  937. "$ref": "#/definitions/response.Response"
  938. }
  939. }
  940. }
  941. }
  942. },
  943. "/pic/delete/{id}": {
  944. "delete": {
  945. "produces": [
  946. "application/json"
  947. ],
  948. "tags": [
  949. "图片模块"
  950. ],
  951. "summary": "删除图片",
  952. "parameters": [
  953. {
  954. "type": "integer",
  955. "description": "图片id",
  956. "name": "id",
  957. "in": "path",
  958. "required": true
  959. }
  960. ],
  961. "responses": {
  962. "200": {
  963. "description": "OK",
  964. "schema": {
  965. "$ref": "#/definitions/response.Response"
  966. }
  967. }
  968. }
  969. }
  970. },
  971. "/pic/upload": {
  972. "post": {
  973. "consumes": [
  974. "multipart/form-data"
  975. ],
  976. "produces": [
  977. "application/json"
  978. ],
  979. "tags": [
  980. "图片模块"
  981. ],
  982. "summary": "上传图片",
  983. "parameters": [
  984. {
  985. "type": "file",
  986. "description": "图片",
  987. "name": "pic",
  988. "in": "formData",
  989. "required": true
  990. }
  991. ],
  992. "responses": {
  993. "200": {
  994. "description": "OK",
  995. "schema": {
  996. "$ref": "#/definitions/response.Response"
  997. }
  998. }
  999. }
  1000. }
  1001. },
  1002. "/pic/{page}/{pageSize}": {
  1003. "get": {
  1004. "produces": [
  1005. "application/json"
  1006. ],
  1007. "tags": [
  1008. "图片模块"
  1009. ],
  1010. "summary": "分页获取图片",
  1011. "parameters": [
  1012. {
  1013. "type": "integer",
  1014. "description": "页数",
  1015. "name": "page",
  1016. "in": "path",
  1017. "required": true
  1018. },
  1019. {
  1020. "type": "integer",
  1021. "description": "一页的大小",
  1022. "name": "pageSize",
  1023. "in": "path",
  1024. "required": true
  1025. }
  1026. ],
  1027. "responses": {
  1028. "200": {
  1029. "description": "OK",
  1030. "schema": {
  1031. "$ref": "#/definitions/response.Response"
  1032. }
  1033. }
  1034. }
  1035. }
  1036. },
  1037. "/relation/bad": {
  1038. "get": {
  1039. "produces": [
  1040. "application/json"
  1041. ],
  1042. "tags": [
  1043. "用户关系模块"
  1044. ],
  1045. "summary": "传入用户id获取用户黑名单列表",
  1046. "parameters": [
  1047. {
  1048. "type": "integer",
  1049. "description": "用户id",
  1050. "name": "uid",
  1051. "in": "query",
  1052. "required": true
  1053. }
  1054. ],
  1055. "responses": {
  1056. "200": {
  1057. "description": "OK",
  1058. "schema": {
  1059. "$ref": "#/definitions/response.Response"
  1060. }
  1061. }
  1062. }
  1063. }
  1064. },
  1065. "/relation/create": {
  1066. "post": {
  1067. "consumes": [
  1068. "application/json"
  1069. ],
  1070. "produces": [
  1071. "application/json"
  1072. ],
  1073. "tags": [
  1074. "用户关系模块"
  1075. ],
  1076. "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
  1077. "parameters": [
  1078. {
  1079. "description": "关系数据",
  1080. "name": "json",
  1081. "in": "body",
  1082. "required": true,
  1083. "schema": {
  1084. "$ref": "#/definitions/model.RelationJson"
  1085. }
  1086. }
  1087. ],
  1088. "responses": {
  1089. "200": {
  1090. "description": "OK",
  1091. "schema": {
  1092. "$ref": "#/definitions/response.Response"
  1093. }
  1094. }
  1095. }
  1096. }
  1097. },
  1098. "/relation/delete/{id}": {
  1099. "delete": {
  1100. "produces": [
  1101. "application/json"
  1102. ],
  1103. "tags": [
  1104. "用户关系模块"
  1105. ],
  1106. "summary": "根据关系id删除关系",
  1107. "parameters": [
  1108. {
  1109. "type": "integer",
  1110. "description": "关系id",
  1111. "name": "id",
  1112. "in": "path",
  1113. "required": true
  1114. }
  1115. ],
  1116. "responses": {
  1117. "200": {
  1118. "description": "OK",
  1119. "schema": {
  1120. "$ref": "#/definitions/response.Response"
  1121. }
  1122. }
  1123. }
  1124. }
  1125. },
  1126. "/relation/friend": {
  1127. "get": {
  1128. "produces": [
  1129. "application/json"
  1130. ],
  1131. "tags": [
  1132. "用户关系模块"
  1133. ],
  1134. "summary": "传入用户id获取用户好友列表",
  1135. "parameters": [
  1136. {
  1137. "type": "integer",
  1138. "description": "用户id",
  1139. "name": "uid",
  1140. "in": "query",
  1141. "required": true
  1142. }
  1143. ],
  1144. "responses": {
  1145. "200": {
  1146. "description": "OK",
  1147. "schema": {
  1148. "$ref": "#/definitions/response.Response"
  1149. }
  1150. }
  1151. }
  1152. }
  1153. },
  1154. "/relation/{page}/{pageSize}": {
  1155. "get": {
  1156. "produces": [
  1157. "application/json"
  1158. ],
  1159. "tags": [
  1160. "用户关系模块"
  1161. ],
  1162. "summary": "分页用户关系",
  1163. "parameters": [
  1164. {
  1165. "type": "integer",
  1166. "description": "页数",
  1167. "name": "page",
  1168. "in": "path",
  1169. "required": true
  1170. },
  1171. {
  1172. "type": "integer",
  1173. "description": "一页的大小",
  1174. "name": "pageSize",
  1175. "in": "path",
  1176. "required": true
  1177. }
  1178. ],
  1179. "responses": {
  1180. "200": {
  1181. "description": "OK",
  1182. "schema": {
  1183. "$ref": "#/definitions/response.Response"
  1184. }
  1185. }
  1186. }
  1187. }
  1188. },
  1189. "/user/info": {
  1190. "get": {
  1191. "produces": [
  1192. "application/json"
  1193. ],
  1194. "tags": [
  1195. "用户模块"
  1196. ],
  1197. "summary": "获取用户信息",
  1198. "responses": {
  1199. "200": {
  1200. "description": "OK",
  1201. "schema": {
  1202. "$ref": "#/definitions/response.Response"
  1203. }
  1204. }
  1205. }
  1206. }
  1207. },
  1208. "/user/list": {
  1209. "post": {
  1210. "produces": [
  1211. "application/json"
  1212. ],
  1213. "tags": [
  1214. "用户模块"
  1215. ],
  1216. "summary": "批量获取用户信息",
  1217. "parameters": [
  1218. {
  1219. "description": "用户id列表",
  1220. "name": "uid",
  1221. "in": "body",
  1222. "required": true,
  1223. "schema": {
  1224. "type": "array",
  1225. "items": {
  1226. "type": "string"
  1227. }
  1228. }
  1229. }
  1230. ],
  1231. "responses": {
  1232. "200": {
  1233. "description": "OK",
  1234. "schema": {
  1235. "$ref": "#/definitions/response.Response"
  1236. }
  1237. }
  1238. }
  1239. }
  1240. },
  1241. "/user/login": {
  1242. "post": {
  1243. "produces": [
  1244. "application/json"
  1245. ],
  1246. "tags": [
  1247. "用户模块"
  1248. ],
  1249. "summary": "登录",
  1250. "parameters": [
  1251. {
  1252. "type": "string",
  1253. "description": "微信ID",
  1254. "name": "vid",
  1255. "in": "formData"
  1256. }
  1257. ],
  1258. "responses": {
  1259. "200": {
  1260. "description": "OK",
  1261. "schema": {
  1262. "$ref": "#/definitions/response.Response"
  1263. }
  1264. }
  1265. }
  1266. }
  1267. },
  1268. "/user/modify": {
  1269. "post": {
  1270. "consumes": [
  1271. "application/json"
  1272. ],
  1273. "produces": [
  1274. "application/json"
  1275. ],
  1276. "tags": [
  1277. "用户模块"
  1278. ],
  1279. "summary": "修改用户信息",
  1280. "parameters": [
  1281. {
  1282. "description": "用户信息",
  1283. "name": "json",
  1284. "in": "body",
  1285. "required": true,
  1286. "schema": {
  1287. "$ref": "#/definitions/model.User"
  1288. }
  1289. }
  1290. ],
  1291. "responses": {
  1292. "200": {
  1293. "description": "OK",
  1294. "schema": {
  1295. "$ref": "#/definitions/response.Response"
  1296. }
  1297. }
  1298. }
  1299. }
  1300. },
  1301. "/user/rec/new": {
  1302. "post": {
  1303. "produces": [
  1304. "application/json"
  1305. ],
  1306. "tags": [
  1307. "用户模块"
  1308. ],
  1309. "summary": "初始化用户推荐数据",
  1310. "parameters": [
  1311. {
  1312. "description": "推荐信息",
  1313. "name": "data",
  1314. "in": "body",
  1315. "schema": {
  1316. "$ref": "#/definitions/controller.NewRec"
  1317. }
  1318. }
  1319. ],
  1320. "responses": {
  1321. "200": {
  1322. "description": "OK",
  1323. "schema": {
  1324. "$ref": "#/definitions/response.Response"
  1325. }
  1326. }
  1327. }
  1328. }
  1329. },
  1330. "/user/register": {
  1331. "post": {
  1332. "consumes": [
  1333. "application/json"
  1334. ],
  1335. "produces": [
  1336. "application/json"
  1337. ],
  1338. "tags": [
  1339. "用户模块"
  1340. ],
  1341. "summary": "创建用户",
  1342. "parameters": [
  1343. {
  1344. "description": "用户信息",
  1345. "name": "json",
  1346. "in": "body",
  1347. "required": true,
  1348. "schema": {
  1349. "$ref": "#/definitions/model.UserJson"
  1350. }
  1351. }
  1352. ],
  1353. "responses": {
  1354. "200": {
  1355. "description": "OK",
  1356. "schema": {
  1357. "$ref": "#/definitions/response.Response"
  1358. }
  1359. }
  1360. }
  1361. }
  1362. },
  1363. "/user/{page}/{pageSize}": {
  1364. "get": {
  1365. "produces": [
  1366. "application/json"
  1367. ],
  1368. "tags": [
  1369. "用户模块"
  1370. ],
  1371. "summary": "分页用户信息",
  1372. "parameters": [
  1373. {
  1374. "type": "integer",
  1375. "description": "页数",
  1376. "name": "page",
  1377. "in": "path",
  1378. "required": true
  1379. },
  1380. {
  1381. "type": "integer",
  1382. "description": "一页的大小",
  1383. "name": "pageSize",
  1384. "in": "path",
  1385. "required": true
  1386. }
  1387. ],
  1388. "responses": {
  1389. "200": {
  1390. "description": "OK",
  1391. "schema": {
  1392. "$ref": "#/definitions/response.Response"
  1393. }
  1394. }
  1395. }
  1396. }
  1397. }
  1398. },
  1399. "definitions": {
  1400. "controller.NewRec": {
  1401. "type": "object",
  1402. "properties": {
  1403. "cIds": {
  1404. "type": "array",
  1405. "items": {
  1406. "type": "integer"
  1407. }
  1408. },
  1409. "uid": {
  1410. "type": "integer"
  1411. }
  1412. }
  1413. },
  1414. "model.Appraise": {
  1415. "type": "object",
  1416. "properties": {
  1417. "buyerId": {
  1418. "type": "integer"
  1419. },
  1420. "content": {
  1421. "type": "string"
  1422. },
  1423. "goodsId": {
  1424. "type": "integer"
  1425. },
  1426. "id": {
  1427. "type": "integer"
  1428. },
  1429. "star": {
  1430. "type": "integer"
  1431. },
  1432. "time": {
  1433. "type": "integer"
  1434. }
  1435. }
  1436. },
  1437. "model.AppraiseJson": {
  1438. "type": "object",
  1439. "properties": {
  1440. "buyerId": {
  1441. "type": "integer"
  1442. },
  1443. "content": {
  1444. "type": "string"
  1445. },
  1446. "goodsId": {
  1447. "type": "integer"
  1448. },
  1449. "star": {
  1450. "type": "integer"
  1451. },
  1452. "time": {
  1453. "type": "integer"
  1454. }
  1455. }
  1456. },
  1457. "model.CategoryJson": {
  1458. "type": "object",
  1459. "properties": {
  1460. "name": {
  1461. "type": "string"
  1462. },
  1463. "pic": {
  1464. "type": "string"
  1465. }
  1466. }
  1467. },
  1468. "model.Goods": {
  1469. "type": "object",
  1470. "properties": {
  1471. "desc": {
  1472. "type": "string"
  1473. },
  1474. "id": {
  1475. "type": "integer"
  1476. },
  1477. "ownerId": {
  1478. "type": "string",
  1479. "example": "0"
  1480. },
  1481. "pic": {
  1482. "type": "array",
  1483. "items": {
  1484. "type": "string"
  1485. }
  1486. },
  1487. "place": {
  1488. "type": "string"
  1489. },
  1490. "price": {
  1491. "type": "integer"
  1492. },
  1493. "state": {
  1494. "type": "integer"
  1495. },
  1496. "title": {
  1497. "type": "string"
  1498. }
  1499. }
  1500. },
  1501. "model.GoodsJson": {
  1502. "type": "object",
  1503. "properties": {
  1504. "categories": {
  1505. "type": "array",
  1506. "items": {
  1507. "type": "integer"
  1508. }
  1509. },
  1510. "desc": {
  1511. "type": "string"
  1512. },
  1513. "ownerId": {
  1514. "type": "string",
  1515. "example": "0"
  1516. },
  1517. "pic": {
  1518. "type": "array",
  1519. "items": {
  1520. "type": "string"
  1521. }
  1522. },
  1523. "place": {
  1524. "type": "string"
  1525. },
  1526. "price": {
  1527. "type": "integer"
  1528. },
  1529. "state": {
  1530. "type": "integer"
  1531. },
  1532. "title": {
  1533. "type": "string"
  1534. }
  1535. }
  1536. },
  1537. "model.OrderJson": {
  1538. "type": "object",
  1539. "properties": {
  1540. "buyerId": {
  1541. "type": "string",
  1542. "example": "0"
  1543. },
  1544. "goodsId": {
  1545. "type": "integer"
  1546. },
  1547. "phone": {
  1548. "type": "string"
  1549. },
  1550. "place": {
  1551. "type": "string"
  1552. },
  1553. "state": {
  1554. "type": "integer"
  1555. },
  1556. "time": {
  1557. "type": "integer"
  1558. }
  1559. }
  1560. },
  1561. "model.RelationJson": {
  1562. "type": "object",
  1563. "properties": {
  1564. "goodsId": {
  1565. "type": "integer"
  1566. },
  1567. "owner": {
  1568. "type": "string",
  1569. "example": "0"
  1570. },
  1571. "target": {
  1572. "type": "string",
  1573. "example": "0"
  1574. },
  1575. "type": {
  1576. "type": "integer"
  1577. }
  1578. }
  1579. },
  1580. "model.User": {
  1581. "type": "object",
  1582. "properties": {
  1583. "avatar": {
  1584. "type": "string"
  1585. },
  1586. "name": {
  1587. "type": "string"
  1588. },
  1589. "phone": {
  1590. "type": "string"
  1591. },
  1592. "sign": {
  1593. "type": "string"
  1594. },
  1595. "uid": {
  1596. "type": "string",
  1597. "example": "0"
  1598. },
  1599. "vid": {
  1600. "type": "string"
  1601. }
  1602. }
  1603. },
  1604. "model.UserJson": {
  1605. "type": "object",
  1606. "properties": {
  1607. "avatar": {
  1608. "type": "string"
  1609. },
  1610. "name": {
  1611. "type": "string"
  1612. },
  1613. "phone": {
  1614. "type": "string"
  1615. },
  1616. "sign": {
  1617. "type": "string"
  1618. },
  1619. "uid": {
  1620. "type": "string",
  1621. "example": ""
  1622. },
  1623. "vid": {
  1624. "type": "string"
  1625. }
  1626. }
  1627. },
  1628. "response.Response": {
  1629. "type": "object",
  1630. "properties": {
  1631. "code": {
  1632. "type": "integer"
  1633. },
  1634. "data": {},
  1635. "message": {
  1636. "type": "string"
  1637. }
  1638. }
  1639. }
  1640. }
  1641. }