docs.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag
  3. package docs
  4. import (
  5. "bytes"
  6. "encoding/json"
  7. "strings"
  8. "github.com/alecthomas/template"
  9. "github.com/swaggo/swag"
  10. )
  11. var doc = `{
  12. "schemes": {{ marshal .Schemes }},
  13. "swagger": "2.0",
  14. "info": {
  15. "description": "{{.Description}}",
  16. "title": "{{.Title}}",
  17. "contact": {},
  18. "license": {},
  19. "version": "{{.Version}}"
  20. },
  21. "host": "{{.Host}}",
  22. "basePath": "{{.BasePath}}",
  23. "paths": {
  24. "/api/CheckCode": {
  25. "post": {
  26. "description": "设备上传数据",
  27. "consumes": [
  28. "application/json"
  29. ],
  30. "produces": [
  31. "application/json"
  32. ],
  33. "tags": [
  34. "二维码门禁"
  35. ],
  36. "summary": "设备上传数据",
  37. "parameters": [
  38. {
  39. "description": " ",
  40. "name": "body",
  41. "in": "body",
  42. "required": true,
  43. "schema": {
  44. "$ref": "#/definitions/v1.CodeGateCheckCodeBody"
  45. }
  46. }
  47. ],
  48. "responses": {
  49. "200": {
  50. "description": "OK",
  51. "schema": {
  52. "$ref": "#/definitions/v1.CodeGateCheckCodeResponse"
  53. }
  54. },
  55. "500": {
  56. "description": "Internal Server Error",
  57. "schema": {
  58. "$ref": "#/definitions/base.HTTPError"
  59. }
  60. }
  61. }
  62. }
  63. },
  64. "/api/IsConnect": {
  65. "post": {
  66. "description": "心跳",
  67. "consumes": [
  68. "application/json"
  69. ],
  70. "produces": [
  71. "application/json"
  72. ],
  73. "tags": [
  74. "二维码门禁"
  75. ],
  76. "summary": "心跳",
  77. "parameters": [
  78. {
  79. "description": " ",
  80. "name": "body",
  81. "in": "body",
  82. "required": true,
  83. "schema": {
  84. "$ref": "#/definitions/v1.CodeGateIsConnectBody"
  85. }
  86. }
  87. ],
  88. "responses": {
  89. "200": {
  90. "description": "OK",
  91. "schema": {
  92. "$ref": "#/definitions/v1.CodeGateIsConnectResponse"
  93. }
  94. },
  95. "500": {
  96. "description": "Internal Server Error",
  97. "schema": {
  98. "$ref": "#/definitions/base.HTTPError"
  99. }
  100. }
  101. }
  102. }
  103. },
  104. "/api/QueryCmd": {
  105. "post": {
  106. "description": "轮询是否有命令",
  107. "consumes": [
  108. "application/json"
  109. ],
  110. "produces": [
  111. "application/json"
  112. ],
  113. "tags": [
  114. "二维码门禁"
  115. ],
  116. "summary": "轮询是否有命令",
  117. "parameters": [
  118. {
  119. "description": " ",
  120. "name": "body",
  121. "in": "body",
  122. "required": true,
  123. "schema": {
  124. "$ref": "#/definitions/v1.CodeGateQueryCmdBody"
  125. }
  126. }
  127. ],
  128. "responses": {
  129. "200": {
  130. "description": "OK",
  131. "schema": {
  132. "$ref": "#/definitions/v1.CodeGateQueryCmdResponse"
  133. }
  134. },
  135. "500": {
  136. "description": "Internal Server Error",
  137. "schema": {
  138. "$ref": "#/definitions/base.HTTPError"
  139. }
  140. }
  141. }
  142. }
  143. },
  144. "/api/QueryCmdPostData": {
  145. "post": {
  146. "description": "命令执行结果",
  147. "consumes": [
  148. "application/json"
  149. ],
  150. "produces": [
  151. "application/json"
  152. ],
  153. "tags": [
  154. "二维码门禁"
  155. ],
  156. "summary": "命令执行结果",
  157. "parameters": [
  158. {
  159. "description": " ",
  160. "name": "body",
  161. "in": "body",
  162. "required": true,
  163. "schema": {
  164. "$ref": "#/definitions/v1.CodeGateQueryCmdPostDataBody"
  165. }
  166. }
  167. ],
  168. "responses": {
  169. "200": {
  170. "description": "OK",
  171. "schema": {
  172. "$ref": "#/definitions/v1.CodeGateQueryCmdPostDataResponse"
  173. }
  174. },
  175. "500": {
  176. "description": "Internal Server Error",
  177. "schema": {
  178. "$ref": "#/definitions/base.HTTPError"
  179. }
  180. }
  181. }
  182. }
  183. }
  184. },
  185. "definitions": {
  186. "base.HTTPError": {
  187. "type": "object",
  188. "properties": {
  189. "code": {
  190. "type": "integer",
  191. "format": "int",
  192. "example": 500
  193. },
  194. "message": {
  195. "type": "string",
  196. "example": "status bad request"
  197. }
  198. }
  199. },
  200. "v1.CodeGateCheckCodeBody": {
  201. "type": "object",
  202. "properties": {
  203. "BrushTime": {
  204. "type": "string"
  205. },
  206. "CodeType": {
  207. "type": "string"
  208. },
  209. "CodeVal": {
  210. "type": "string"
  211. },
  212. "IsOnline": {
  213. "type": "string"
  214. },
  215. "Property": {
  216. "type": "string"
  217. },
  218. "SN": {
  219. "type": "string"
  220. },
  221. "UID": {
  222. "type": "string"
  223. },
  224. "UKey": {
  225. "type": "string"
  226. },
  227. "ViewId": {
  228. "type": "string"
  229. }
  230. }
  231. },
  232. "v1.CodeGateCheckCodeResponse": {
  233. "type": "object",
  234. "properties": {
  235. "Status": {
  236. "type": "integer"
  237. },
  238. "UID": {
  239. "type": "string"
  240. }
  241. }
  242. },
  243. "v1.CodeGateIsConnectBody": {
  244. "type": "object",
  245. "properties": {
  246. "SN": {
  247. "type": "string"
  248. },
  249. "UID": {
  250. "type": "string"
  251. },
  252. "UKey": {
  253. "type": "string"
  254. },
  255. "ViewId": {
  256. "type": "string"
  257. }
  258. }
  259. },
  260. "v1.CodeGateIsConnectResponse": {
  261. "type": "object",
  262. "properties": {
  263. "DateTime": {
  264. "type": "string"
  265. }
  266. }
  267. },
  268. "v1.CodeGateQueryCmdBody": {
  269. "type": "object",
  270. "properties": {
  271. "DoorMagnetic": {
  272. "type": "string"
  273. },
  274. "SN": {
  275. "type": "string"
  276. },
  277. "TamperAlarm": {
  278. "type": "string"
  279. },
  280. "UID": {
  281. "type": "string"
  282. },
  283. "UKey": {
  284. "type": "string"
  285. },
  286. "ViewId": {
  287. "type": "string"
  288. }
  289. }
  290. },
  291. "v1.CodeGateQueryCmdPostDataBody": {
  292. "type": "object",
  293. "properties": {
  294. "CmdCode": {
  295. "type": "integer"
  296. },
  297. "CmdID": {
  298. "type": "string"
  299. },
  300. "CmdParams": {
  301. "type": "object",
  302. "additionalProperties": {
  303. "type": "array",
  304. "items": {
  305. "type": "object",
  306. "additionalProperties": {
  307. "type": "string"
  308. }
  309. }
  310. }
  311. },
  312. "CmdStatus": {
  313. "type": "integer"
  314. },
  315. "SN": {
  316. "type": "string"
  317. },
  318. "UID": {
  319. "type": "string"
  320. },
  321. "UKey": {
  322. "type": "string"
  323. },
  324. "ViewId": {
  325. "type": "string"
  326. }
  327. }
  328. },
  329. "v1.CodeGateQueryCmdPostDataResponse": {
  330. "type": "object",
  331. "properties": {
  332. "CmdStatus": {
  333. "type": "integer"
  334. },
  335. "CmdStatusDesc": {
  336. "type": "integer"
  337. }
  338. }
  339. },
  340. "v1.CodeGateQueryCmdResponse": {
  341. "type": "object",
  342. "properties": {
  343. "CmdCode": {
  344. "type": "integer"
  345. },
  346. "CmdID": {
  347. "type": "string"
  348. },
  349. "CmdParams": {
  350. "description": "CmdParams string ` + "`" + `json:\"CmdParams\"` + "`" + `",
  351. "type": "array",
  352. "items": {
  353. "type": "object",
  354. "additionalProperties": {
  355. "type": "string"
  356. }
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }`
  363. type swaggerInfo struct {
  364. Version string
  365. Host string
  366. BasePath string
  367. Schemes []string
  368. Title string
  369. Description string
  370. }
  371. // SwaggerInfo holds exported Swagger Info so clients can modify it
  372. var SwaggerInfo = swaggerInfo{
  373. Version: "1.1",
  374. Host: "",
  375. BasePath: "",
  376. Schemes: []string{},
  377. Title: "Project property-device-gateway's APIs",
  378. Description: "This is a gateway server. On the page, you can go to do testing for every API.",
  379. }
  380. type s struct{}
  381. func (s *s) ReadDoc() string {
  382. sInfo := SwaggerInfo
  383. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  384. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  385. "marshal": func(v interface{}) string {
  386. a, _ := json.Marshal(v)
  387. return string(a)
  388. },
  389. }).Parse(doc)
  390. if err != nil {
  391. return doc
  392. }
  393. var tpl bytes.Buffer
  394. if err := t.Execute(&tpl, sInfo); err != nil {
  395. return doc
  396. }
  397. return tpl.String()
  398. }
  399. func init() {
  400. swag.Register(swag.Name, &s{})
  401. }