1 Star 0 Fork 1

chenjp / Container

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
docs.go 5.22 KB
一键复制 编辑 原始数据 按行查看 历史
// 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{})
}
Go
1
https://gitee.com/chensyf/container.git
git@gitee.com:chensyf/container.git
chensyf
container
Container
252bcb0f3368

搜索帮助