docs.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. "/dust_excessive_img": {
  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": "sn",
  40. "name": "body",
  41. "in": "body",
  42. "required": true,
  43. "schema": {
  44. "$ref": "#/definitions/v1.ExcessiveImgBody"
  45. }
  46. }
  47. ],
  48. "responses": {
  49. "200": {
  50. "description": "OK",
  51. "schema": {
  52. "$ref": "#/definitions/v1.ExcessiveImgResponse"
  53. }
  54. },
  55. "500": {
  56. "description": "Internal Server Error",
  57. "schema": {
  58. "$ref": "#/definitions/base.HTTPError"
  59. }
  60. }
  61. }
  62. }
  63. }
  64. },
  65. "definitions": {
  66. "base.HTTPError": {
  67. "type": "object",
  68. "properties": {
  69. "code": {
  70. "type": "integer",
  71. "format": "int",
  72. "example": 500
  73. },
  74. "message": {
  75. "type": "string",
  76. "example": "status bad request"
  77. }
  78. }
  79. },
  80. "v1.ExcessiveImgBody": {
  81. "type": "object",
  82. "required": [
  83. "mn"
  84. ],
  85. "properties": {
  86. "ecode": {
  87. "description": "超标数据编号",
  88. "type": "string"
  89. },
  90. "imageBase64": {
  91. "description": "图片",
  92. "type": "string"
  93. },
  94. "mn": {
  95. "type": "string"
  96. }
  97. }
  98. },
  99. "v1.ExcessiveImgResponse": {
  100. "type": "object",
  101. "properties": {
  102. "code": {
  103. "description": "返回码",
  104. "type": "integer",
  105. "format": "int",
  106. "default": 0
  107. },
  108. "message": {
  109. "description": "消息",
  110. "type": "string",
  111. "default": "success"
  112. }
  113. }
  114. }
  115. }
  116. }`
  117. type swaggerInfo struct {
  118. Version string
  119. Host string
  120. BasePath string
  121. Schemes []string
  122. Title string
  123. Description string
  124. }
  125. // SwaggerInfo holds exported Swagger Info so clients can modify it
  126. var SwaggerInfo = swaggerInfo{
  127. Version: "",
  128. Host: "",
  129. BasePath: "",
  130. Schemes: []string{},
  131. Title: "",
  132. Description: "",
  133. }
  134. type s struct{}
  135. func (s *s) ReadDoc() string {
  136. sInfo := SwaggerInfo
  137. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  138. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  139. "marshal": func(v interface{}) string {
  140. a, _ := json.Marshal(v)
  141. return string(a)
  142. },
  143. }).Parse(doc)
  144. if err != nil {
  145. return doc
  146. }
  147. var tpl bytes.Buffer
  148. if err := t.Execute(&tpl, sInfo); err != nil {
  149. return doc
  150. }
  151. return tpl.String()
  152. }
  153. func init() {
  154. swag.Register(swag.Name, &s{})
  155. }