docs.go 50 KB

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