swagger.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "This is a gateway server. On the page, you can go to do testing for every API.",
  5. "title": "Project property-device-gateway's APIs",
  6. "contact": {},
  7. "license": {},
  8. "version": "1.1"
  9. },
  10. "paths": {
  11. "/api/CheckCode": {
  12. "post": {
  13. "description": "设备上传数据",
  14. "consumes": [
  15. "application/json"
  16. ],
  17. "produces": [
  18. "application/json"
  19. ],
  20. "tags": [
  21. "二维码门禁"
  22. ],
  23. "summary": "设备上传数据",
  24. "parameters": [
  25. {
  26. "description": " ",
  27. "name": "body",
  28. "in": "body",
  29. "required": true,
  30. "schema": {
  31. "$ref": "#/definitions/v1.CodeGateCheckCodeBody"
  32. }
  33. }
  34. ],
  35. "responses": {
  36. "200": {
  37. "description": "OK",
  38. "schema": {
  39. "$ref": "#/definitions/v1.CodeGateCheckCodeResponse"
  40. }
  41. },
  42. "500": {
  43. "description": "Internal Server Error",
  44. "schema": {
  45. "$ref": "#/definitions/base.HTTPError"
  46. }
  47. }
  48. }
  49. }
  50. },
  51. "/api/IsConnect": {
  52. "post": {
  53. "description": "心跳",
  54. "consumes": [
  55. "application/json"
  56. ],
  57. "produces": [
  58. "application/json"
  59. ],
  60. "tags": [
  61. "二维码门禁"
  62. ],
  63. "summary": "心跳",
  64. "parameters": [
  65. {
  66. "description": " ",
  67. "name": "body",
  68. "in": "body",
  69. "required": true,
  70. "schema": {
  71. "$ref": "#/definitions/v1.CodeGateIsConnectBody"
  72. }
  73. }
  74. ],
  75. "responses": {
  76. "200": {
  77. "description": "OK",
  78. "schema": {
  79. "$ref": "#/definitions/v1.CodeGateIsConnectResponse"
  80. }
  81. },
  82. "500": {
  83. "description": "Internal Server Error",
  84. "schema": {
  85. "$ref": "#/definitions/base.HTTPError"
  86. }
  87. }
  88. }
  89. }
  90. },
  91. "/api/QueryCmd": {
  92. "post": {
  93. "description": "轮询是否有命令",
  94. "consumes": [
  95. "application/json"
  96. ],
  97. "produces": [
  98. "application/json"
  99. ],
  100. "tags": [
  101. "二维码门禁"
  102. ],
  103. "summary": "轮询是否有命令",
  104. "parameters": [
  105. {
  106. "description": " ",
  107. "name": "body",
  108. "in": "body",
  109. "required": true,
  110. "schema": {
  111. "$ref": "#/definitions/v1.CodeGateQueryCmdBody"
  112. }
  113. }
  114. ],
  115. "responses": {
  116. "200": {
  117. "description": "OK",
  118. "schema": {
  119. "$ref": "#/definitions/v1.CodeGateQueryCmdResponse"
  120. }
  121. },
  122. "500": {
  123. "description": "Internal Server Error",
  124. "schema": {
  125. "$ref": "#/definitions/base.HTTPError"
  126. }
  127. }
  128. }
  129. }
  130. },
  131. "/api/QueryCmdPostData": {
  132. "post": {
  133. "description": "命令执行结果",
  134. "consumes": [
  135. "application/json"
  136. ],
  137. "produces": [
  138. "application/json"
  139. ],
  140. "tags": [
  141. "二维码门禁"
  142. ],
  143. "summary": "命令执行结果",
  144. "parameters": [
  145. {
  146. "description": " ",
  147. "name": "body",
  148. "in": "body",
  149. "required": true,
  150. "schema": {
  151. "$ref": "#/definitions/v1.CodeGateQueryCmdPostDataBody"
  152. }
  153. }
  154. ],
  155. "responses": {
  156. "200": {
  157. "description": "OK",
  158. "schema": {
  159. "$ref": "#/definitions/v1.CodeGateQueryCmdPostDataResponse"
  160. }
  161. },
  162. "500": {
  163. "description": "Internal Server Error",
  164. "schema": {
  165. "$ref": "#/definitions/base.HTTPError"
  166. }
  167. }
  168. }
  169. }
  170. }
  171. },
  172. "definitions": {
  173. "base.HTTPError": {
  174. "type": "object",
  175. "properties": {
  176. "code": {
  177. "type": "integer",
  178. "format": "int",
  179. "example": 500
  180. },
  181. "message": {
  182. "type": "string",
  183. "example": "status bad request"
  184. }
  185. }
  186. },
  187. "v1.CodeGateCheckCodeBody": {
  188. "type": "object",
  189. "properties": {
  190. "BrushTime": {
  191. "type": "string"
  192. },
  193. "CodeType": {
  194. "type": "string"
  195. },
  196. "CodeVal": {
  197. "type": "string"
  198. },
  199. "IsOnline": {
  200. "type": "string"
  201. },
  202. "Property": {
  203. "type": "string"
  204. },
  205. "SN": {
  206. "type": "string"
  207. },
  208. "UID": {
  209. "type": "string"
  210. },
  211. "UKey": {
  212. "type": "string"
  213. },
  214. "ViewId": {
  215. "type": "string"
  216. }
  217. }
  218. },
  219. "v1.CodeGateCheckCodeResponse": {
  220. "type": "object",
  221. "properties": {
  222. "Status": {
  223. "type": "integer"
  224. },
  225. "UID": {
  226. "type": "string"
  227. }
  228. }
  229. },
  230. "v1.CodeGateIsConnectBody": {
  231. "type": "object",
  232. "properties": {
  233. "SN": {
  234. "type": "string"
  235. },
  236. "UID": {
  237. "type": "string"
  238. },
  239. "UKey": {
  240. "type": "string"
  241. },
  242. "ViewId": {
  243. "type": "string"
  244. }
  245. }
  246. },
  247. "v1.CodeGateIsConnectResponse": {
  248. "type": "object",
  249. "properties": {
  250. "DateTime": {
  251. "type": "string"
  252. }
  253. }
  254. },
  255. "v1.CodeGateQueryCmdBody": {
  256. "type": "object",
  257. "properties": {
  258. "DoorMagnetic": {
  259. "type": "string"
  260. },
  261. "SN": {
  262. "type": "string"
  263. },
  264. "TamperAlarm": {
  265. "type": "string"
  266. },
  267. "UID": {
  268. "type": "string"
  269. },
  270. "UKey": {
  271. "type": "string"
  272. },
  273. "ViewId": {
  274. "type": "string"
  275. }
  276. }
  277. },
  278. "v1.CodeGateQueryCmdPostDataBody": {
  279. "type": "object",
  280. "properties": {
  281. "CmdCode": {
  282. "type": "integer"
  283. },
  284. "CmdID": {
  285. "type": "string"
  286. },
  287. "CmdParams": {
  288. "type": "object",
  289. "additionalProperties": {
  290. "type": "array",
  291. "items": {
  292. "type": "object",
  293. "additionalProperties": {
  294. "type": "string"
  295. }
  296. }
  297. }
  298. },
  299. "CmdStatus": {
  300. "type": "integer"
  301. },
  302. "SN": {
  303. "type": "string"
  304. },
  305. "UID": {
  306. "type": "string"
  307. },
  308. "UKey": {
  309. "type": "string"
  310. },
  311. "ViewId": {
  312. "type": "string"
  313. }
  314. }
  315. },
  316. "v1.CodeGateQueryCmdPostDataResponse": {
  317. "type": "object",
  318. "properties": {
  319. "CmdStatus": {
  320. "type": "integer"
  321. },
  322. "CmdStatusDesc": {
  323. "type": "integer"
  324. }
  325. }
  326. },
  327. "v1.CodeGateQueryCmdResponse": {
  328. "type": "object",
  329. "properties": {
  330. "CmdCode": {
  331. "type": "integer"
  332. },
  333. "CmdID": {
  334. "type": "string"
  335. },
  336. "CmdParams": {
  337. "description": "CmdParams string `json:\"CmdParams\"`",
  338. "type": "array",
  339. "items": {
  340. "type": "object",
  341. "additionalProperties": {
  342. "type": "string"
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. }