swagger.json 49 KB

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