docs.go 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag
  3. package swagger
  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. "/system/dept/addDept": {
  25. "post": {
  26. "security": [
  27. {
  28. "Bearer": []
  29. }
  30. ],
  31. "description": "获取JSON",
  32. "consumes": [
  33. "application/json"
  34. ],
  35. "tags": [
  36. "部门"
  37. ],
  38. "summary": "添加部门",
  39. "parameters": [
  40. {
  41. "description": "data",
  42. "name": "data",
  43. "in": "body",
  44. "required": true,
  45. "schema": {
  46. "$ref": "#/definitions/sys_dept.AddParams"
  47. }
  48. }
  49. ],
  50. "responses": {
  51. "200": {
  52. "description": "{\"code\": 0, \"message\": \"添加成功\"}",
  53. "schema": {
  54. "$ref": "#/definitions/response.Response"
  55. }
  56. }
  57. }
  58. }
  59. },
  60. "/system/dept/delDept/{id}": {
  61. "delete": {
  62. "description": "删除数据",
  63. "tags": [
  64. "部门"
  65. ],
  66. "summary": "删除部门",
  67. "parameters": [
  68. {
  69. "type": "integer",
  70. "description": "id",
  71. "name": "id",
  72. "in": "path",
  73. "required": true
  74. }
  75. ],
  76. "responses": {
  77. "200": {
  78. "description": "{\"code\": 0, \"message\": \"删除成功\"}",
  79. "schema": {
  80. "$ref": "#/definitions/response.Response"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "/system/dept/editDept": {
  87. "post": {
  88. "security": [
  89. {
  90. "Bearer": []
  91. }
  92. ],
  93. "description": "获取JSON",
  94. "consumes": [
  95. "application/json"
  96. ],
  97. "tags": [
  98. "部门"
  99. ],
  100. "summary": "修改部门",
  101. "parameters": [
  102. {
  103. "description": "data",
  104. "name": "data",
  105. "in": "body",
  106. "required": true,
  107. "schema": {
  108. "$ref": "#/definitions/sys_dept.EditParams"
  109. }
  110. }
  111. ],
  112. "responses": {
  113. "200": {
  114. "description": "{\"code\": 0, \"message\": \"修改成功\"}",
  115. "schema": {
  116. "$ref": "#/definitions/response.Response"
  117. }
  118. }
  119. }
  120. }
  121. },
  122. "/system/dept/list": {
  123. "get": {
  124. "security": [
  125. {
  126. "": []
  127. }
  128. ],
  129. "description": "分页列表",
  130. "tags": [
  131. "部门"
  132. ],
  133. "summary": "分页部门列表数据",
  134. "parameters": [
  135. {
  136. "type": "string",
  137. "description": "deptName",
  138. "name": "deptName",
  139. "in": "query"
  140. },
  141. {
  142. "type": "string",
  143. "description": "status",
  144. "name": "status",
  145. "in": "query"
  146. }
  147. ],
  148. "responses": {
  149. "0": {
  150. "description": "{\"code\": 200, \"data\": [...]}",
  151. "schema": {
  152. "$ref": "#/definitions/response.Response"
  153. }
  154. }
  155. }
  156. }
  157. }
  158. },
  159. "definitions": {
  160. "response.Response": {
  161. "type": "object",
  162. "properties": {
  163. "code": {
  164. "description": "代码",
  165. "type": "integer",
  166. "example": 200
  167. },
  168. "data": {
  169. "description": "数据集",
  170. "type": "object"
  171. },
  172. "msg": {
  173. "description": "消息",
  174. "type": "string"
  175. }
  176. }
  177. },
  178. "sys_dept.AddParams": {
  179. "type": "object",
  180. "properties": {
  181. "ancestors": {
  182. "type": "string"
  183. },
  184. "createBy": {
  185. "type": "string"
  186. },
  187. "createTime": {
  188. "type": "string"
  189. },
  190. "delFlag": {
  191. "type": "string"
  192. },
  193. "deptName": {
  194. "type": "string"
  195. },
  196. "email": {
  197. "type": "string"
  198. },
  199. "leader": {
  200. "type": "string"
  201. },
  202. "orderNum": {
  203. "type": "integer"
  204. },
  205. "parentId": {
  206. "type": "integer"
  207. },
  208. "phone": {
  209. "type": "string"
  210. },
  211. "status": {
  212. "type": "string"
  213. },
  214. "updateBy": {
  215. "type": "string"
  216. },
  217. "updateTime": {
  218. "type": "string"
  219. }
  220. }
  221. },
  222. "sys_dept.EditParams": {
  223. "type": "object",
  224. "properties": {
  225. "ancestors": {
  226. "type": "string"
  227. },
  228. "createBy": {
  229. "type": "string"
  230. },
  231. "createTime": {
  232. "type": "string"
  233. },
  234. "delFlag": {
  235. "type": "string"
  236. },
  237. "deptId": {
  238. "type": "integer"
  239. },
  240. "deptName": {
  241. "type": "string"
  242. },
  243. "email": {
  244. "type": "string"
  245. },
  246. "leader": {
  247. "type": "string"
  248. },
  249. "orderNum": {
  250. "type": "integer"
  251. },
  252. "parentId": {
  253. "type": "integer"
  254. },
  255. "phone": {
  256. "type": "string"
  257. },
  258. "status": {
  259. "type": "string"
  260. },
  261. "updateBy": {
  262. "type": "string"
  263. },
  264. "updateTime": {
  265. "type": "string"
  266. }
  267. }
  268. }
  269. }
  270. }`
  271. type swaggerInfo struct {
  272. Version string
  273. Host string
  274. BasePath string
  275. Schemes []string
  276. Title string
  277. Description string
  278. }
  279. // SwaggerInfo holds exported Swagger Info so clients can modify it
  280. var SwaggerInfo = swaggerInfo{
  281. Version: "1.0",
  282. Host: "localhost",
  283. BasePath: "/system",
  284. Schemes: []string{},
  285. Title: "gfast API文档",
  286. Description: "gfast 在线API文档",
  287. }
  288. type s struct{}
  289. func (s *s) ReadDoc() string {
  290. sInfo := SwaggerInfo
  291. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  292. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  293. "marshal": func(v interface{}) string {
  294. a, _ := json.Marshal(v)
  295. return string(a)
  296. },
  297. }).Parse(doc)
  298. if err != nil {
  299. return doc
  300. }
  301. var tpl bytes.Buffer
  302. if err := t.Execute(&tpl, sInfo); err != nil {
  303. return doc
  304. }
  305. return tpl.String()
  306. }
  307. func init() {
  308. swag.Register(swag.Name, &s{})
  309. }