docs.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  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. "contact": {},
  11. "version": "{{.Version}}"
  12. },
  13. "host": "{{.Host}}",
  14. "basePath": "{{.BasePath}}",
  15. "paths": {
  16. "/admin/auditState": {
  17. "put": {
  18. "consumes": [
  19. "application/json"
  20. ],
  21. "tags": [
  22. "管理员"
  23. ],
  24. "summary": "管理员审核状态",
  25. "parameters": [
  26. {
  27. "type": "string",
  28. "description": "id",
  29. "name": "id",
  30. "in": "query",
  31. "required": true
  32. },
  33. {
  34. "type": "string",
  35. "description": "状态",
  36. "name": "state",
  37. "in": "query",
  38. "required": true
  39. }
  40. ],
  41. "responses": {
  42. "200": {
  43. "description": "OK",
  44. "schema": {
  45. "$ref": "#/definitions/e.R"
  46. }
  47. }
  48. }
  49. }
  50. },
  51. "/admin/product": {
  52. "put": {
  53. "consumes": [
  54. "application/json"
  55. ],
  56. "tags": [
  57. "管理员"
  58. ],
  59. "summary": "修改产品类型",
  60. "parameters": [
  61. {
  62. "description": "请求参数",
  63. "name": "req",
  64. "in": "body",
  65. "required": true,
  66. "schema": {
  67. "$ref": "#/definitions/models.ProductDto"
  68. }
  69. },
  70. {
  71. "type": "string",
  72. "description": "id",
  73. "name": "id",
  74. "in": "query",
  75. "required": true
  76. }
  77. ],
  78. "responses": {
  79. "200": {
  80. "description": "OK",
  81. "schema": {
  82. "$ref": "#/definitions/e.R"
  83. }
  84. }
  85. }
  86. },
  87. "post": {
  88. "consumes": [
  89. "application/json"
  90. ],
  91. "tags": [
  92. "管理员"
  93. ],
  94. "summary": "添加产品类型",
  95. "parameters": [
  96. {
  97. "description": "请求参数",
  98. "name": "req",
  99. "in": "body",
  100. "required": true,
  101. "schema": {
  102. "$ref": "#/definitions/models.ProductDto"
  103. }
  104. }
  105. ],
  106. "responses": {
  107. "200": {
  108. "description": "OK",
  109. "schema": {
  110. "$ref": "#/definitions/e.R"
  111. }
  112. }
  113. }
  114. },
  115. "delete": {
  116. "consumes": [
  117. "application/json"
  118. ],
  119. "tags": [
  120. "管理员"
  121. ],
  122. "summary": "根据ID删除产品类型",
  123. "parameters": [
  124. {
  125. "type": "string",
  126. "description": "id",
  127. "name": "id",
  128. "in": "query",
  129. "required": true
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "OK",
  135. "schema": {
  136. "$ref": "#/definitions/e.R"
  137. }
  138. }
  139. }
  140. }
  141. },
  142. "/admin/serviceNode": {
  143. "post": {
  144. "consumes": [
  145. "application/json"
  146. ],
  147. "tags": [
  148. "管理员"
  149. ],
  150. "summary": "管理员查询所有节点",
  151. "parameters": [
  152. {
  153. "description": "分页数据",
  154. "name": "req",
  155. "in": "body",
  156. "required": true,
  157. "schema": {
  158. "$ref": "#/definitions/unity.PageParams"
  159. }
  160. }
  161. ],
  162. "responses": {
  163. "200": {
  164. "description": "OK",
  165. "schema": {
  166. "$ref": "#/definitions/e.R"
  167. }
  168. }
  169. }
  170. }
  171. },
  172. "/admin/shop": {
  173. "get": {
  174. "consumes": [
  175. "application/json"
  176. ],
  177. "tags": [
  178. "管理员"
  179. ],
  180. "summary": "管理员查询所有店铺",
  181. "parameters": [
  182. {
  183. "description": "分页数据",
  184. "name": "req",
  185. "in": "body",
  186. "required": true,
  187. "schema": {
  188. "$ref": "#/definitions/unity.PageParams"
  189. }
  190. }
  191. ],
  192. "responses": {
  193. "200": {
  194. "description": "OK",
  195. "schema": {
  196. "$ref": "#/definitions/e.R"
  197. }
  198. }
  199. }
  200. }
  201. },
  202. "/getNode": {
  203. "get": {
  204. "consumes": [
  205. "application/json"
  206. ],
  207. "tags": [
  208. "节点管理"
  209. ],
  210. "summary": "获取自己节点以及公开节点",
  211. "responses": {
  212. "200": {
  213. "description": "OK",
  214. "schema": {
  215. "type": "array",
  216. "items": {
  217. "$ref": "#/definitions/models.ServiceNodes"
  218. }
  219. }
  220. }
  221. }
  222. }
  223. },
  224. "/productall": {
  225. "post": {
  226. "consumes": [
  227. "application/json"
  228. ],
  229. "tags": [
  230. "店铺管理"
  231. ],
  232. "summary": "查询所有类型",
  233. "parameters": [
  234. {
  235. "description": "分页数据",
  236. "name": "req",
  237. "in": "body",
  238. "required": true,
  239. "schema": {
  240. "$ref": "#/definitions/unity.PageParams"
  241. }
  242. }
  243. ],
  244. "responses": {
  245. "200": {
  246. "description": "OK",
  247. "schema": {
  248. "$ref": "#/definitions/e.R"
  249. }
  250. }
  251. }
  252. }
  253. },
  254. "/serviceNode": {
  255. "get": {
  256. "consumes": [
  257. "application/json"
  258. ],
  259. "tags": [
  260. "节点管理"
  261. ],
  262. "summary": "查询自己的所有节点",
  263. "parameters": [
  264. {
  265. "description": "分页数据",
  266. "name": "req",
  267. "in": "body",
  268. "required": true,
  269. "schema": {
  270. "$ref": "#/definitions/unity.PageParams"
  271. }
  272. }
  273. ],
  274. "responses": {
  275. "200": {
  276. "description": "OK",
  277. "schema": {
  278. "$ref": "#/definitions/e.R"
  279. }
  280. }
  281. }
  282. },
  283. "put": {
  284. "consumes": [
  285. "application/json"
  286. ],
  287. "tags": [
  288. "节点管理"
  289. ],
  290. "summary": "修改节点",
  291. "parameters": [
  292. {
  293. "type": "string",
  294. "description": "id",
  295. "name": "id",
  296. "in": "query",
  297. "required": true
  298. },
  299. {
  300. "description": "节点数据",
  301. "name": "req",
  302. "in": "body",
  303. "required": true,
  304. "schema": {
  305. "$ref": "#/definitions/models.ServiceNodesDto"
  306. }
  307. }
  308. ],
  309. "responses": {
  310. "200": {
  311. "description": "OK",
  312. "schema": {
  313. "$ref": "#/definitions/e.R"
  314. }
  315. }
  316. }
  317. },
  318. "post": {
  319. "consumes": [
  320. "application/json"
  321. ],
  322. "tags": [
  323. "节点管理"
  324. ],
  325. "summary": "添加节点",
  326. "parameters": [
  327. {
  328. "description": "节点数据",
  329. "name": "req",
  330. "in": "body",
  331. "required": true,
  332. "schema": {
  333. "$ref": "#/definitions/models.ServiceNodesDto"
  334. }
  335. }
  336. ],
  337. "responses": {
  338. "200": {
  339. "description": "OK",
  340. "schema": {
  341. "$ref": "#/definitions/e.R"
  342. }
  343. }
  344. }
  345. },
  346. "delete": {
  347. "consumes": [
  348. "application/json"
  349. ],
  350. "tags": [
  351. "节点管理"
  352. ],
  353. "summary": "根据Id删除节点",
  354. "parameters": [
  355. {
  356. "type": "string",
  357. "description": "id",
  358. "name": "id",
  359. "in": "query",
  360. "required": true
  361. }
  362. ],
  363. "responses": {
  364. "200": {
  365. "description": "OK",
  366. "schema": {
  367. "$ref": "#/definitions/e.R"
  368. }
  369. }
  370. }
  371. }
  372. },
  373. "/shop": {
  374. "get": {
  375. "consumes": [
  376. "application/json"
  377. ],
  378. "tags": [
  379. "店铺管理"
  380. ],
  381. "summary": "获取自己的商品信息",
  382. "parameters": [
  383. {
  384. "description": "分页数据",
  385. "name": "req",
  386. "in": "body",
  387. "required": true,
  388. "schema": {
  389. "$ref": "#/definitions/unity.PageParams"
  390. }
  391. }
  392. ],
  393. "responses": {
  394. "200": {
  395. "description": "OK",
  396. "schema": {
  397. "$ref": "#/definitions/e.R"
  398. }
  399. }
  400. }
  401. },
  402. "put": {
  403. "consumes": [
  404. "application/json"
  405. ],
  406. "tags": [
  407. "店铺管理"
  408. ],
  409. "summary": "修改节点",
  410. "parameters": [
  411. {
  412. "type": "string",
  413. "description": "id",
  414. "name": "id",
  415. "in": "query",
  416. "required": true
  417. },
  418. {
  419. "description": "店铺数据",
  420. "name": "req",
  421. "in": "body",
  422. "required": true,
  423. "schema": {
  424. "$ref": "#/definitions/models.ShopDto"
  425. }
  426. }
  427. ],
  428. "responses": {
  429. "200": {
  430. "description": "OK",
  431. "schema": {
  432. "$ref": "#/definitions/e.R"
  433. }
  434. }
  435. }
  436. },
  437. "post": {
  438. "consumes": [
  439. "application/json"
  440. ],
  441. "tags": [
  442. "店铺管理"
  443. ],
  444. "summary": "添加节点",
  445. "parameters": [
  446. {
  447. "description": "店铺数据",
  448. "name": "req",
  449. "in": "body",
  450. "required": true,
  451. "schema": {
  452. "$ref": "#/definitions/models.ShopDto"
  453. }
  454. }
  455. ],
  456. "responses": {
  457. "200": {
  458. "description": "OK",
  459. "schema": {
  460. "$ref": "#/definitions/e.R"
  461. }
  462. }
  463. }
  464. },
  465. "delete": {
  466. "consumes": [
  467. "application/json"
  468. ],
  469. "tags": [
  470. "店铺管理"
  471. ],
  472. "summary": "根据Id删除节点",
  473. "parameters": [
  474. {
  475. "type": "string",
  476. "description": "id",
  477. "name": "id",
  478. "in": "query",
  479. "required": true
  480. }
  481. ],
  482. "responses": {
  483. "200": {
  484. "description": "OK",
  485. "schema": {
  486. "$ref": "#/definitions/e.R"
  487. }
  488. }
  489. }
  490. }
  491. },
  492. "/shopByName": {
  493. "get": {
  494. "consumes": [
  495. "application/json"
  496. ],
  497. "tags": [
  498. "店铺管理"
  499. ],
  500. "summary": "根据商品名称模糊查询",
  501. "parameters": [
  502. {
  503. "description": "分页数据",
  504. "name": "req",
  505. "in": "body",
  506. "required": true,
  507. "schema": {
  508. "$ref": "#/definitions/unity.PageParams"
  509. }
  510. },
  511. {
  512. "type": "string",
  513. "description": "product_name",
  514. "name": "product_name",
  515. "in": "query",
  516. "required": true
  517. }
  518. ],
  519. "responses": {
  520. "200": {
  521. "description": "OK",
  522. "schema": {
  523. "$ref": "#/definitions/e.R"
  524. }
  525. }
  526. }
  527. }
  528. }
  529. },
  530. "definitions": {
  531. "e.R": {
  532. "type": "object",
  533. "properties": {
  534. "code": {
  535. "$ref": "#/definitions/e.Rescode"
  536. },
  537. "data": {},
  538. "message": {}
  539. }
  540. },
  541. "e.Rescode": {
  542. "type": "integer",
  543. "enum": [
  544. 200,
  545. 201,
  546. 1001,
  547. 1002,
  548. 1003,
  549. 1004,
  550. 1005,
  551. 1006,
  552. 1007,
  553. 1008,
  554. 1009,
  555. 1010,
  556. 1011,
  557. 1012,
  558. 1013,
  559. 1014,
  560. 1015,
  561. 1016,
  562. 1017,
  563. 1018,
  564. 1019,
  565. 1020
  566. ],
  567. "x-enum-varnames": [
  568. "SUCCESS",
  569. "ERROR",
  570. "TokenIsInvalid",
  571. "TokenIsExpired",
  572. "DELETEFAIL",
  573. "UPDATEFAIL",
  574. "FINDFAIL",
  575. "DeleteFail",
  576. "PaginationFailed",
  577. "JSONParsingFailed",
  578. "TheUserAlreadyExists",
  579. "AlreadyExists",
  580. "TheSystemIsAbnormal",
  581. "CodeIsError",
  582. "Theuseralreadyexists",
  583. "ThePhoneNumberIsWrong",
  584. "AnExceptionOccursWhenSendingAnSMSVerificationCode",
  585. "TokenIsFaild",
  586. "ThePasswordIsWrongOrThePhoneNumberIsIncorrect",
  587. "HasSend",
  588. "TheUserIsEmpty",
  589. "TheParameterCannotBeEmpty"
  590. ]
  591. },
  592. "gorm.DeletedAt": {
  593. "type": "object",
  594. "properties": {
  595. "time": {
  596. "type": "string"
  597. },
  598. "valid": {
  599. "description": "Valid is true if Time is not NULL",
  600. "type": "boolean"
  601. }
  602. }
  603. },
  604. "models.ProductDto": {
  605. "type": "object",
  606. "required": [
  607. "product_type"
  608. ],
  609. "properties": {
  610. "product_type": {
  611. "type": "string"
  612. }
  613. }
  614. },
  615. "models.ServiceNodes": {
  616. "type": "object",
  617. "properties": {
  618. "address": {
  619. "description": "节点地址",
  620. "type": "string"
  621. },
  622. "create_by": {
  623. "type": "integer"
  624. },
  625. "createdAt": {
  626. "type": "string"
  627. },
  628. "deletedAt": {
  629. "$ref": "#/definitions/gorm.DeletedAt"
  630. },
  631. "id": {
  632. "type": "integer"
  633. },
  634. "node_name": {
  635. "description": "节点名称",
  636. "type": "string"
  637. },
  638. "state": {
  639. "description": "0: 离线 1: 在线",
  640. "type": "boolean"
  641. },
  642. "tokey": {
  643. "description": "节点token",
  644. "type": "string"
  645. },
  646. "updatedAt": {
  647. "type": "string"
  648. }
  649. }
  650. },
  651. "models.ServiceNodesDto": {
  652. "type": "object",
  653. "properties": {
  654. "address": {
  655. "description": "节点地址",
  656. "type": "string"
  657. },
  658. "node_name": {
  659. "description": "节点名称",
  660. "type": "string"
  661. },
  662. "state": {
  663. "description": "0: 离线 1: 在线",
  664. "type": "boolean"
  665. },
  666. "tokey": {
  667. "description": "节点token",
  668. "type": "string"
  669. }
  670. }
  671. },
  672. "models.ShopDto": {
  673. "type": "object",
  674. "required": [
  675. "product_avatar",
  676. "product_description",
  677. "product_name",
  678. "product_price",
  679. "product_type"
  680. ],
  681. "properties": {
  682. "product_avatar": {
  683. "description": "产品图片",
  684. "type": "string"
  685. },
  686. "product_description": {
  687. "description": "产品描述",
  688. "type": "string"
  689. },
  690. "product_name": {
  691. "description": "产品名称",
  692. "type": "string"
  693. },
  694. "product_price": {
  695. "description": "产品价格",
  696. "type": "number"
  697. },
  698. "product_type": {
  699. "description": "产品类型",
  700. "type": "string"
  701. }
  702. }
  703. },
  704. "unity.PageParams": {
  705. "type": "object",
  706. "properties": {
  707. "desc": {
  708. "type": "string"
  709. },
  710. "page": {
  711. "type": "integer"
  712. },
  713. "size": {
  714. "type": "integer"
  715. }
  716. }
  717. }
  718. },
  719. "securityDefinitions": {
  720. "": {
  721. "type": "apiKey",
  722. "name": "Authorization",
  723. "in": "header"
  724. }
  725. }
  726. }`
  727. // SwaggerInfo holds exported Swagger Info so clients can modify it
  728. var SwaggerInfo = &swag.Spec{
  729. Version: "1.0",
  730. Host: "127.0.0.1:8081",
  731. BasePath: "/api",
  732. Schemes: []string{},
  733. Title: "物联智控平台",
  734. Description: "物联智控平台",
  735. InfoInstanceName: "swagger",
  736. SwaggerTemplate: docTemplate,
  737. }
  738. func init() {
  739. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  740. }