swagger.json 22 KB

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