docs.go 51 KB

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