docs.go 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620
  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. "responses": {
  358. "200": {
  359. "description": "OK",
  360. "schema": {
  361. "$ref": "#/definitions/response.Response"
  362. }
  363. }
  364. }
  365. }
  366. },
  367. "/chat/to/{page}/{pageSize}": {
  368. "get": {
  369. "tags": [
  370. "聊天模块"
  371. ],
  372. "summary": "获取未过期且目标为特定用户的聊天记录",
  373. "parameters": [
  374. {
  375. "type": "integer",
  376. "description": "页数",
  377. "name": "page",
  378. "in": "path",
  379. "required": true
  380. },
  381. {
  382. "type": "integer",
  383. "description": "一页的大小",
  384. "name": "pageSize",
  385. "in": "path",
  386. "required": true
  387. },
  388. {
  389. "type": "string",
  390. "description": "用户id",
  391. "name": "uid",
  392. "in": "query",
  393. "required": true
  394. }
  395. ],
  396. "responses": {
  397. "200": {
  398. "description": "OK",
  399. "schema": {
  400. "$ref": "#/definitions/response.Response"
  401. }
  402. }
  403. }
  404. }
  405. },
  406. "/goods/category/{page}/{pageSize}": {
  407. "get": {
  408. "produces": [
  409. "application/json"
  410. ],
  411. "tags": [
  412. "商品模块"
  413. ],
  414. "summary": "按分类查找商品并分页显示",
  415. "parameters": [
  416. {
  417. "type": "integer",
  418. "description": "页数",
  419. "name": "page",
  420. "in": "path",
  421. "required": true
  422. },
  423. {
  424. "type": "integer",
  425. "description": "一页的大小",
  426. "name": "pageSize",
  427. "in": "path",
  428. "required": true
  429. },
  430. {
  431. "type": "integer",
  432. "description": "商品分类id",
  433. "name": "category",
  434. "in": "query",
  435. "required": true
  436. }
  437. ],
  438. "responses": {
  439. "200": {
  440. "description": "OK",
  441. "schema": {
  442. "$ref": "#/definitions/response.Response"
  443. }
  444. }
  445. }
  446. }
  447. },
  448. "/goods/create": {
  449. "post": {
  450. "consumes": [
  451. "application/json"
  452. ],
  453. "produces": [
  454. "application/json"
  455. ],
  456. "tags": [
  457. "商品模块"
  458. ],
  459. "summary": "创建商品",
  460. "parameters": [
  461. {
  462. "description": "商品信息",
  463. "name": "json",
  464. "in": "body",
  465. "required": true,
  466. "schema": {
  467. "$ref": "#/definitions/model.GoodsJson"
  468. }
  469. }
  470. ],
  471. "responses": {
  472. "200": {
  473. "description": "OK",
  474. "schema": {
  475. "$ref": "#/definitions/response.Response"
  476. }
  477. }
  478. }
  479. }
  480. },
  481. "/goods/delete/{id}": {
  482. "delete": {
  483. "produces": [
  484. "application/json"
  485. ],
  486. "tags": [
  487. "商品模块"
  488. ],
  489. "summary": "删除商品",
  490. "parameters": [
  491. {
  492. "type": "integer",
  493. "description": "商品id",
  494. "name": "id",
  495. "in": "path",
  496. "required": true
  497. }
  498. ],
  499. "responses": {
  500. "200": {
  501. "description": "OK",
  502. "schema": {
  503. "$ref": "#/definitions/response.Response"
  504. }
  505. }
  506. }
  507. }
  508. },
  509. "/goods/detail/{id}": {
  510. "get": {
  511. "produces": [
  512. "application/json"
  513. ],
  514. "tags": [
  515. "商品模块"
  516. ],
  517. "summary": "获取商品详细信息",
  518. "parameters": [
  519. {
  520. "type": "integer",
  521. "description": "商品id",
  522. "name": "id",
  523. "in": "path",
  524. "required": true
  525. },
  526. {
  527. "type": "integer",
  528. "description": "访问的用户id",
  529. "name": "uid",
  530. "in": "query",
  531. "required": true
  532. },
  533. {
  534. "type": "integer",
  535. "description": "访问时间的时间戳",
  536. "name": "date",
  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": "integer",
  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/register": {
  1307. "post": {
  1308. "consumes": [
  1309. "application/json"
  1310. ],
  1311. "produces": [
  1312. "application/json"
  1313. ],
  1314. "tags": [
  1315. "用户模块"
  1316. ],
  1317. "summary": "创建用户",
  1318. "parameters": [
  1319. {
  1320. "description": "用户信息",
  1321. "name": "json",
  1322. "in": "body",
  1323. "required": true,
  1324. "schema": {
  1325. "$ref": "#/definitions/model.UserJson"
  1326. }
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "OK",
  1332. "schema": {
  1333. "$ref": "#/definitions/response.Response"
  1334. }
  1335. }
  1336. }
  1337. }
  1338. },
  1339. "/user/{page}/{pageSize}": {
  1340. "get": {
  1341. "produces": [
  1342. "application/json"
  1343. ],
  1344. "tags": [
  1345. "用户模块"
  1346. ],
  1347. "summary": "分页用户信息",
  1348. "parameters": [
  1349. {
  1350. "type": "integer",
  1351. "description": "页数",
  1352. "name": "page",
  1353. "in": "path",
  1354. "required": true
  1355. },
  1356. {
  1357. "type": "integer",
  1358. "description": "一页的大小",
  1359. "name": "pageSize",
  1360. "in": "path",
  1361. "required": true
  1362. }
  1363. ],
  1364. "responses": {
  1365. "200": {
  1366. "description": "OK",
  1367. "schema": {
  1368. "$ref": "#/definitions/response.Response"
  1369. }
  1370. }
  1371. }
  1372. }
  1373. }
  1374. },
  1375. "definitions": {
  1376. "model.Appraise": {
  1377. "type": "object",
  1378. "properties": {
  1379. "buyerId": {
  1380. "type": "integer"
  1381. },
  1382. "content": {
  1383. "type": "string"
  1384. },
  1385. "goodsId": {
  1386. "type": "integer"
  1387. },
  1388. "id": {
  1389. "type": "integer"
  1390. },
  1391. "star": {
  1392. "type": "integer"
  1393. },
  1394. "time": {
  1395. "type": "integer"
  1396. }
  1397. }
  1398. },
  1399. "model.AppraiseJson": {
  1400. "type": "object",
  1401. "properties": {
  1402. "buyerId": {
  1403. "type": "integer"
  1404. },
  1405. "content": {
  1406. "type": "string"
  1407. },
  1408. "goodsId": {
  1409. "type": "integer"
  1410. },
  1411. "star": {
  1412. "type": "integer"
  1413. },
  1414. "time": {
  1415. "type": "integer"
  1416. }
  1417. }
  1418. },
  1419. "model.CategoryJson": {
  1420. "type": "object",
  1421. "properties": {
  1422. "name": {
  1423. "type": "string"
  1424. },
  1425. "pic": {
  1426. "type": "string"
  1427. }
  1428. }
  1429. },
  1430. "model.Goods": {
  1431. "type": "object",
  1432. "properties": {
  1433. "desc": {
  1434. "type": "string"
  1435. },
  1436. "id": {
  1437. "type": "integer"
  1438. },
  1439. "ownerId": {
  1440. "type": "integer"
  1441. },
  1442. "pic": {
  1443. "type": "array",
  1444. "items": {
  1445. "type": "string"
  1446. }
  1447. },
  1448. "place": {
  1449. "type": "string"
  1450. },
  1451. "price": {
  1452. "type": "integer"
  1453. },
  1454. "state": {
  1455. "type": "integer"
  1456. },
  1457. "title": {
  1458. "type": "string"
  1459. }
  1460. }
  1461. },
  1462. "model.GoodsJson": {
  1463. "type": "object",
  1464. "properties": {
  1465. "categories": {
  1466. "type": "array",
  1467. "items": {
  1468. "type": "integer"
  1469. }
  1470. },
  1471. "desc": {
  1472. "type": "string"
  1473. },
  1474. "ownerId": {
  1475. "type": "integer"
  1476. },
  1477. "pic": {
  1478. "type": "array",
  1479. "items": {
  1480. "type": "string"
  1481. }
  1482. },
  1483. "place": {
  1484. "type": "string"
  1485. },
  1486. "price": {
  1487. "type": "integer"
  1488. },
  1489. "state": {
  1490. "type": "integer"
  1491. },
  1492. "title": {
  1493. "type": "string"
  1494. }
  1495. }
  1496. },
  1497. "model.OrderJson": {
  1498. "type": "object",
  1499. "properties": {
  1500. "buyerId": {
  1501. "type": "integer"
  1502. },
  1503. "goodsId": {
  1504. "type": "integer"
  1505. },
  1506. "phone": {
  1507. "type": "string"
  1508. },
  1509. "place": {
  1510. "type": "string"
  1511. },
  1512. "state": {
  1513. "type": "integer"
  1514. },
  1515. "time": {
  1516. "type": "integer"
  1517. }
  1518. }
  1519. },
  1520. "model.RelationJson": {
  1521. "type": "object",
  1522. "properties": {
  1523. "goodsId": {
  1524. "type": "integer"
  1525. },
  1526. "owner": {
  1527. "type": "string",
  1528. "example": "0"
  1529. },
  1530. "target": {
  1531. "type": "string",
  1532. "example": "0"
  1533. },
  1534. "type": {
  1535. "type": "integer"
  1536. }
  1537. }
  1538. },
  1539. "model.User": {
  1540. "type": "object",
  1541. "properties": {
  1542. "avatar": {
  1543. "type": "string"
  1544. },
  1545. "name": {
  1546. "type": "string"
  1547. },
  1548. "phone": {
  1549. "type": "string"
  1550. },
  1551. "sign": {
  1552. "type": "string"
  1553. },
  1554. "uid": {
  1555. "type": "string",
  1556. "example": "0"
  1557. },
  1558. "vid": {
  1559. "type": "string"
  1560. }
  1561. }
  1562. },
  1563. "model.UserJson": {
  1564. "type": "object",
  1565. "properties": {
  1566. "avatar": {
  1567. "type": "string"
  1568. },
  1569. "name": {
  1570. "type": "string"
  1571. },
  1572. "phone": {
  1573. "type": "string"
  1574. },
  1575. "sign": {
  1576. "type": "string"
  1577. },
  1578. "uid": {
  1579. "type": "string"
  1580. },
  1581. "vid": {
  1582. "type": "string"
  1583. }
  1584. }
  1585. },
  1586. "response.Response": {
  1587. "type": "object",
  1588. "properties": {
  1589. "code": {
  1590. "type": "integer"
  1591. },
  1592. "data": {},
  1593. "message": {
  1594. "type": "string"
  1595. }
  1596. }
  1597. }
  1598. }
  1599. }`
  1600. // SwaggerInfo holds exported Swagger Info so clients can modify it
  1601. var SwaggerInfo = &swag.Spec{
  1602. Version: "1.0",
  1603. Host: "192.168.31.30:8084",
  1604. BasePath: "/WeChatTrading/trading-go",
  1605. Schemes: []string{},
  1606. Title: "二手交易",
  1607. Description: "一个基于微信小程序的校园二手交易平台的api文档",
  1608. InfoInstanceName: "swagger",
  1609. SwaggerTemplate: docTemplate,
  1610. LeftDelim: "{{",
  1611. RightDelim: "}}",
  1612. }
  1613. func init() {
  1614. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  1615. }