docs.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. "termsOfService": "http://muchinfo.cn",
  18. "contact": {},
  19. "license": {},
  20. "version": "{{.Version}}"
  21. },
  22. "host": "{{.Host}}",
  23. "basePath": "{{.BasePath}}",
  24. "paths": {
  25. "/CPTrade/QueryPreasleApply": {
  26. "get": {
  27. "produces": [
  28. "application/json"
  29. ],
  30. "tags": [
  31. "产能预售"
  32. ],
  33. "summary": "查询产能预售申请表信息",
  34. "parameters": [
  35. {
  36. "type": "integer",
  37. "description": "账户ID",
  38. "name": "userid",
  39. "in": "query",
  40. "required": true
  41. },
  42. {
  43. "type": "integer",
  44. "description": "申请ID",
  45. "name": "applyid",
  46. "in": "query"
  47. },
  48. {
  49. "type": "integer",
  50. "description": "资金账户ID",
  51. "name": "accountid",
  52. "in": "query"
  53. }
  54. ],
  55. "responses": {
  56. "0": {
  57. "schema": {
  58. "type": "array",
  59. "items": {
  60. "$ref": "#/definitions/app.Response"
  61. }
  62. }
  63. },
  64. "500": {
  65. "description": "Internal Server Error",
  66. "schema": {
  67. "$ref": "#/definitions/app.Response"
  68. }
  69. }
  70. }
  71. }
  72. }
  73. },
  74. "definitions": {
  75. "app.Response": {
  76. "type": "object",
  77. "properties": {
  78. "code": {
  79. "type": "integer"
  80. },
  81. "data": {
  82. "type": "object"
  83. },
  84. "msg": {
  85. "type": "string"
  86. }
  87. }
  88. }
  89. }
  90. }`
  91. type swaggerInfo struct {
  92. Version string
  93. Host string
  94. BasePath string
  95. Schemes []string
  96. Title string
  97. Description string
  98. }
  99. // SwaggerInfo holds exported Swagger Info so clients can modify it
  100. var SwaggerInfo = swaggerInfo{
  101. Version: "1.0",
  102. Host: "",
  103. BasePath: "/api",
  104. Schemes: []string{},
  105. Title: "MTP2.0 查询服务 API",
  106. Description: "新的查询服务,替代原通用查询服务。",
  107. }
  108. type s struct{}
  109. func (s *s) ReadDoc() string {
  110. sInfo := SwaggerInfo
  111. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  112. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  113. "marshal": func(v interface{}) string {
  114. a, _ := json.Marshal(v)
  115. return string(a)
  116. },
  117. }).Parse(doc)
  118. if err != nil {
  119. return doc
  120. }
  121. var tpl bytes.Buffer
  122. if err := t.Execute(&tpl, sInfo); err != nil {
  123. return doc
  124. }
  125. return tpl.String()
  126. }
  127. func init() {
  128. swag.Register(swag.Name, &s{})
  129. }