代码拉取完成,页面将自动刷新
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import (
"bytes"
"encoding/json"
"strings"
"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"title": "{{.Title}}",
"termsOfService": "https://github.com/swaggo/gin-swagger",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/student": {
"get": {
"description": "根据姓名查询学生",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"学生"
],
"summary": "根据姓名查询学生",
"parameters": [
{
"type": "string",
"description": "姓名",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Student"
}
}
}
},
"post": {
"description": "新增学生信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"学生"
],
"summary": "新增学生信息",
"parameters": [
{
"description": "学生信息",
"name": "studentRequest",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.Student"
}
}
],
"responses": {
"200": {
"description": "创建成功",
"schema": {
"type": "string"
}
}
}
}
},
"/students": {
"get": {
"description": "查询所有学生",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"学生"
],
"summary": "查询所有学生",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Student"
}
}
}
}
}
}
},
"definitions": {
"models.Student": {
"type": "object",
"properties": {
"grade": {
"type": "number"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"student_id": {
"type": "string"
}
}
},
"request.Student": {
"type": "object",
"required": [
"grade",
"name",
"student_id"
],
"properties": {
"grade": {
"type": "number"
},
"name": {
"type": "string"
},
"student_id": {
"type": "string"
}
}
}
}
}`
type swaggerInfo struct {
Version string
Host string
BasePath string
Schemes []string
Title string
Description string
}
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "容器化Student",
Description: "容器化Student",
}
type s struct{}
func (s *s) ReadDoc() string {
sInfo := SwaggerInfo
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
t, err := template.New("swagger_info").Funcs(template.FuncMap{
"marshal": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}).Parse(doc)
if err != nil {
return doc
}
var tpl bytes.Buffer
if err := t.Execute(&tpl, sInfo); err != nil {
return doc
}
return tpl.String()
}
func init() {
swag.Register(swag.Name, &s{})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。