swagger.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. basePath: /api
  2. definitions:
  3. e.R:
  4. properties:
  5. code:
  6. $ref: '#/definitions/e.Rescode'
  7. data: {}
  8. message: {}
  9. type: object
  10. e.Rescode:
  11. enum:
  12. - 200
  13. - 201
  14. - 1001
  15. - 1002
  16. - 1003
  17. - 1004
  18. - 1005
  19. - 1006
  20. - 1007
  21. - 1008
  22. - 1009
  23. - 1010
  24. - 1011
  25. - 1012
  26. - 1013
  27. - 1014
  28. - 1015
  29. - 1016
  30. - 1017
  31. - 1018
  32. - 1019
  33. - 1020
  34. type: integer
  35. x-enum-varnames:
  36. - SUCCESS
  37. - ERROR
  38. - TokenIsInvalid
  39. - TokenIsExpired
  40. - DELETEFAIL
  41. - UPDATEFAIL
  42. - FINDFAIL
  43. - DeleteFail
  44. - PaginationFailed
  45. - JSONParsingFailed
  46. - TheUserAlreadyExists
  47. - AlreadyExists
  48. - TheSystemIsAbnormal
  49. - CodeIsError
  50. - Theuseralreadyexists
  51. - ThePhoneNumberIsWrong
  52. - AnExceptionOccursWhenSendingAnSMSVerificationCode
  53. - TokenIsFaild
  54. - ThePasswordIsWrongOrThePhoneNumberIsIncorrect
  55. - HasSend
  56. - TheUserIsEmpty
  57. - TheParameterCannotBeEmpty
  58. gorm.DeletedAt:
  59. properties:
  60. time:
  61. type: string
  62. valid:
  63. description: Valid is true if Time is not NULL
  64. type: boolean
  65. type: object
  66. models.ProductDto:
  67. properties:
  68. product_type:
  69. type: string
  70. required:
  71. - product_type
  72. type: object
  73. models.ServiceNodes:
  74. properties:
  75. address:
  76. description: 节点地址
  77. type: string
  78. create_by:
  79. type: integer
  80. createdAt:
  81. type: string
  82. deletedAt:
  83. $ref: '#/definitions/gorm.DeletedAt'
  84. id:
  85. type: integer
  86. node_name:
  87. description: 节点名称
  88. type: string
  89. state:
  90. description: '0: 离线 1: 在线'
  91. type: boolean
  92. tokey:
  93. description: 节点token
  94. type: string
  95. updatedAt:
  96. type: string
  97. type: object
  98. models.ServiceNodesDto:
  99. properties:
  100. address:
  101. description: 节点地址
  102. type: string
  103. node_name:
  104. description: 节点名称
  105. type: string
  106. state:
  107. description: '0: 离线 1: 在线'
  108. type: boolean
  109. tokey:
  110. description: 节点token
  111. type: string
  112. type: object
  113. models.ShopDto:
  114. properties:
  115. product_avatar:
  116. description: 产品图片
  117. type: string
  118. product_description:
  119. description: 产品描述
  120. type: string
  121. product_name:
  122. description: 产品名称
  123. type: string
  124. product_price:
  125. description: 产品价格
  126. type: number
  127. product_type:
  128. description: 产品类型
  129. type: string
  130. required:
  131. - product_avatar
  132. - product_description
  133. - product_name
  134. - product_price
  135. - product_type
  136. type: object
  137. unity.PageParams:
  138. properties:
  139. desc:
  140. type: string
  141. page:
  142. type: integer
  143. size:
  144. type: integer
  145. type: object
  146. host: 127.0.0.1:8081
  147. info:
  148. contact: {}
  149. description: 物联智控平台
  150. title: 物联智控平台
  151. version: "1.0"
  152. paths:
  153. /admin/auditState:
  154. put:
  155. consumes:
  156. - application/json
  157. parameters:
  158. - description: id
  159. in: query
  160. name: id
  161. required: true
  162. type: string
  163. - description: 状态
  164. in: query
  165. name: state
  166. required: true
  167. type: string
  168. responses:
  169. "200":
  170. description: OK
  171. schema:
  172. $ref: '#/definitions/e.R'
  173. summary: 管理员审核状态
  174. tags:
  175. - 管理员
  176. /admin/product:
  177. delete:
  178. consumes:
  179. - application/json
  180. parameters:
  181. - description: id
  182. in: query
  183. name: id
  184. required: true
  185. type: string
  186. responses:
  187. "200":
  188. description: OK
  189. schema:
  190. $ref: '#/definitions/e.R'
  191. summary: 根据ID删除产品类型
  192. tags:
  193. - 管理员
  194. post:
  195. consumes:
  196. - application/json
  197. parameters:
  198. - description: 请求参数
  199. in: body
  200. name: req
  201. required: true
  202. schema:
  203. $ref: '#/definitions/models.ProductDto'
  204. responses:
  205. "200":
  206. description: OK
  207. schema:
  208. $ref: '#/definitions/e.R'
  209. summary: 添加产品类型
  210. tags:
  211. - 管理员
  212. put:
  213. consumes:
  214. - application/json
  215. parameters:
  216. - description: 请求参数
  217. in: body
  218. name: req
  219. required: true
  220. schema:
  221. $ref: '#/definitions/models.ProductDto'
  222. - description: id
  223. in: query
  224. name: id
  225. required: true
  226. type: string
  227. responses:
  228. "200":
  229. description: OK
  230. schema:
  231. $ref: '#/definitions/e.R'
  232. summary: 修改产品类型
  233. tags:
  234. - 管理员
  235. /admin/serviceNode:
  236. post:
  237. consumes:
  238. - application/json
  239. parameters:
  240. - description: 分页数据
  241. in: body
  242. name: req
  243. required: true
  244. schema:
  245. $ref: '#/definitions/unity.PageParams'
  246. responses:
  247. "200":
  248. description: OK
  249. schema:
  250. $ref: '#/definitions/e.R'
  251. summary: 管理员查询所有节点
  252. tags:
  253. - 管理员
  254. /admin/shop:
  255. get:
  256. consumes:
  257. - application/json
  258. parameters:
  259. - description: 分页数据
  260. in: body
  261. name: req
  262. required: true
  263. schema:
  264. $ref: '#/definitions/unity.PageParams'
  265. responses:
  266. "200":
  267. description: OK
  268. schema:
  269. $ref: '#/definitions/e.R'
  270. summary: 管理员查询所有店铺
  271. tags:
  272. - 管理员
  273. /getNode:
  274. get:
  275. consumes:
  276. - application/json
  277. responses:
  278. "200":
  279. description: OK
  280. schema:
  281. items:
  282. $ref: '#/definitions/models.ServiceNodes'
  283. type: array
  284. summary: 获取自己节点以及公开节点
  285. tags:
  286. - 节点管理
  287. /productall:
  288. post:
  289. consumes:
  290. - application/json
  291. parameters:
  292. - description: 分页数据
  293. in: body
  294. name: req
  295. required: true
  296. schema:
  297. $ref: '#/definitions/unity.PageParams'
  298. responses:
  299. "200":
  300. description: OK
  301. schema:
  302. $ref: '#/definitions/e.R'
  303. summary: 查询所有类型
  304. tags:
  305. - 店铺管理
  306. /serviceNode:
  307. delete:
  308. consumes:
  309. - application/json
  310. parameters:
  311. - description: id
  312. in: query
  313. name: id
  314. required: true
  315. type: string
  316. responses:
  317. "200":
  318. description: OK
  319. schema:
  320. $ref: '#/definitions/e.R'
  321. summary: 根据Id删除节点
  322. tags:
  323. - 节点管理
  324. get:
  325. consumes:
  326. - application/json
  327. parameters:
  328. - description: 分页数据
  329. in: body
  330. name: req
  331. required: true
  332. schema:
  333. $ref: '#/definitions/unity.PageParams'
  334. responses:
  335. "200":
  336. description: OK
  337. schema:
  338. $ref: '#/definitions/e.R'
  339. summary: 查询自己的所有节点
  340. tags:
  341. - 节点管理
  342. post:
  343. consumes:
  344. - application/json
  345. parameters:
  346. - description: 节点数据
  347. in: body
  348. name: req
  349. required: true
  350. schema:
  351. $ref: '#/definitions/models.ServiceNodesDto'
  352. responses:
  353. "200":
  354. description: OK
  355. schema:
  356. $ref: '#/definitions/e.R'
  357. summary: 添加节点
  358. tags:
  359. - 节点管理
  360. put:
  361. consumes:
  362. - application/json
  363. parameters:
  364. - description: id
  365. in: query
  366. name: id
  367. required: true
  368. type: string
  369. - description: 节点数据
  370. in: body
  371. name: req
  372. required: true
  373. schema:
  374. $ref: '#/definitions/models.ServiceNodesDto'
  375. responses:
  376. "200":
  377. description: OK
  378. schema:
  379. $ref: '#/definitions/e.R'
  380. summary: 修改节点
  381. tags:
  382. - 节点管理
  383. /shop:
  384. delete:
  385. consumes:
  386. - application/json
  387. parameters:
  388. - description: id
  389. in: query
  390. name: id
  391. required: true
  392. type: string
  393. responses:
  394. "200":
  395. description: OK
  396. schema:
  397. $ref: '#/definitions/e.R'
  398. summary: 根据Id删除节点
  399. tags:
  400. - 店铺管理
  401. get:
  402. consumes:
  403. - application/json
  404. parameters:
  405. - description: 分页数据
  406. in: body
  407. name: req
  408. required: true
  409. schema:
  410. $ref: '#/definitions/unity.PageParams'
  411. responses:
  412. "200":
  413. description: OK
  414. schema:
  415. $ref: '#/definitions/e.R'
  416. summary: 获取自己的商品信息
  417. tags:
  418. - 店铺管理
  419. post:
  420. consumes:
  421. - application/json
  422. parameters:
  423. - description: 店铺数据
  424. in: body
  425. name: req
  426. required: true
  427. schema:
  428. $ref: '#/definitions/models.ShopDto'
  429. responses:
  430. "200":
  431. description: OK
  432. schema:
  433. $ref: '#/definitions/e.R'
  434. summary: 添加节点
  435. tags:
  436. - 店铺管理
  437. put:
  438. consumes:
  439. - application/json
  440. parameters:
  441. - description: id
  442. in: query
  443. name: id
  444. required: true
  445. type: string
  446. - description: 店铺数据
  447. in: body
  448. name: req
  449. required: true
  450. schema:
  451. $ref: '#/definitions/models.ShopDto'
  452. responses:
  453. "200":
  454. description: OK
  455. schema:
  456. $ref: '#/definitions/e.R'
  457. summary: 修改节点
  458. tags:
  459. - 店铺管理
  460. /shopByName:
  461. get:
  462. consumes:
  463. - application/json
  464. parameters:
  465. - description: 分页数据
  466. in: body
  467. name: req
  468. required: true
  469. schema:
  470. $ref: '#/definitions/unity.PageParams'
  471. - description: product_name
  472. in: query
  473. name: product_name
  474. required: true
  475. type: string
  476. responses:
  477. "200":
  478. description: OK
  479. schema:
  480. $ref: '#/definitions/e.R'
  481. summary: 根据商品名称模糊查询
  482. tags:
  483. - 店铺管理
  484. securityDefinitions:
  485. "":
  486. in: header
  487. name: Authorization
  488. type: apiKey
  489. swagger: "2.0"