调整swag为最新包

This commit is contained in:
piexlMax
2023-05-23 00:08:53 +08:00
parent 4fc90c0168
commit 0e39f3ad05
5 changed files with 879 additions and 795 deletions

View File

@@ -1,22 +1,14 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
// Code generated by swaggo/swag. DO NOT EDIT.
package docs
import (
"bytes"
"encoding/json"
"strings"
import "github.com/swaggo/swag"
"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
var doc = `{
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
@@ -1475,7 +1467,7 @@ var doc = `{
"summary": "生成验证码",
"responses": {
"200": {
"description": "生成验证码,返回包括随机数id,base64,验证码长度",
"description": "生成验证码,返回包括随机数id,base64,验证码长度,是否开启验证码",
"schema": {
"allOf": [
{
@@ -1997,161 +1989,6 @@ var doc = `{
}
}
},
"/excel/downloadTemplate": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"excel"
],
"summary": "下载模板",
"parameters": [
{
"type": "string",
"description": "模板名称",
"name": "fileName",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/excel/exportExcel": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/octet-stream"
],
"tags": [
"excel"
],
"summary": "导出Excel",
"parameters": [
{
"description": "导出Excel文件信息",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/example.ExcelInfo"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/excel/importExcel": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"excel"
],
"summary": "导入Excel文件",
"parameters": [
{
"type": "file",
"description": "导入Excel文件",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "导入Excel文件",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.Response"
},
{
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
]
}
}
}
}
},
"/excel/loadExcel": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"excel"
],
"summary": "加载Excel数据",
"responses": {
"200": {
"description": "加载Excel数据,返回包括列表,总数,页码,每页数量",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/response.PageResult"
},
"msg": {
"type": "string"
}
}
}
]
}
}
}
}
},
"/fileUploadAndDownload/breakpointContinue": {
"post": {
"security": [
@@ -4940,6 +4777,14 @@ var doc = `{
"key-long": {
"description": "验证码长度",
"type": "integer"
},
"open-captcha": {
"description": "防爆破验证码开启此数0代表每次登录都需要验证码其他数字代表错误密码此数如3代表错误三次后出现验证码",
"type": "integer"
},
"open-captcha-timeout": {
"description": "防爆破验证码超时时间单位s(秒)",
"type": "integer"
}
}
},
@@ -4960,39 +4805,6 @@ var doc = `{
}
}
},
"config.Email": {
"type": "object",
"properties": {
"from": {
"description": "收件人",
"type": "string"
},
"host": {
"description": "服务器地址",
"type": "string"
},
"is-ssl": {
"description": "是否SSL",
"type": "boolean"
},
"nickname": {
"description": "昵称",
"type": "string"
},
"port": {
"description": "端口",
"type": "integer"
},
"secret": {
"description": "密钥",
"type": "string"
},
"to": {
"description": "收件人:多个以英文逗号分隔",
"type": "string"
}
}
},
"config.Excel": {
"type": "object",
"properties": {
@@ -5055,7 +4867,7 @@ var doc = `{
}
}
},
"config.Mysql": {
"config.Mssql": {
"type": "object",
"properties": {
"config": {
@@ -5066,6 +4878,11 @@ var doc = `{
"description": "数据库名",
"type": "string"
},
"engine": {
"description": "数据库引擎默认InnoDB",
"type": "string",
"default": "InnoDB"
},
"log-mode": {
"description": "是否开启Gorm全局日志",
"type": "string"
@@ -5094,6 +4911,130 @@ var doc = `{
"description": ":端口",
"type": "string"
},
"prefix": {
"description": "全局表前缀单独定义TableName则不生效",
"type": "string"
},
"singular": {
"description": "是否开启全局禁用复数true表示开启",
"type": "boolean"
},
"username": {
"description": "数据库用户名",
"type": "string"
}
}
},
"config.Mysql": {
"type": "object",
"properties": {
"config": {
"description": "高级配置",
"type": "string"
},
"db-name": {
"description": "数据库名",
"type": "string"
},
"engine": {
"description": "数据库引擎默认InnoDB",
"type": "string",
"default": "InnoDB"
},
"log-mode": {
"description": "是否开启Gorm全局日志",
"type": "string"
},
"log-zap": {
"description": "是否通过zap写入日志文件",
"type": "boolean"
},
"max-idle-conns": {
"description": "空闲中的最大连接数",
"type": "integer"
},
"max-open-conns": {
"description": "打开到数据库的最大连接数",
"type": "integer"
},
"password": {
"description": "数据库密码",
"type": "string"
},
"path": {
"description": "服务器地址:端口",
"type": "string"
},
"port": {
"description": ":端口",
"type": "string"
},
"prefix": {
"description": "全局表前缀单独定义TableName则不生效",
"type": "string"
},
"singular": {
"description": "是否开启全局禁用复数true表示开启",
"type": "boolean"
},
"username": {
"description": "数据库用户名",
"type": "string"
}
}
},
"config.Oracle": {
"type": "object",
"properties": {
"config": {
"description": "高级配置",
"type": "string"
},
"db-name": {
"description": "数据库名",
"type": "string"
},
"engine": {
"description": "数据库引擎默认InnoDB",
"type": "string",
"default": "InnoDB"
},
"log-mode": {
"description": "是否开启Gorm全局日志",
"type": "string"
},
"log-zap": {
"description": "是否通过zap写入日志文件",
"type": "boolean"
},
"max-idle-conns": {
"description": "空闲中的最大连接数",
"type": "integer"
},
"max-open-conns": {
"description": "打开到数据库的最大连接数",
"type": "integer"
},
"password": {
"description": "数据库密码",
"type": "string"
},
"path": {
"description": "服务器地址:端口",
"type": "string"
},
"port": {
"description": ":端口",
"type": "string"
},
"prefix": {
"description": "全局表前缀单独定义TableName则不生效",
"type": "string"
},
"singular": {
"description": "是否开启全局禁用复数true表示开启",
"type": "boolean"
},
"username": {
"description": "数据库用户名",
"type": "string"
@@ -5111,6 +5052,11 @@ var doc = `{
"description": "数据库名",
"type": "string"
},
"engine": {
"description": "数据库引擎默认InnoDB",
"type": "string",
"default": "InnoDB"
},
"log-mode": {
"description": "是否开启Gorm全局日志",
"type": "string"
@@ -5139,6 +5085,14 @@ var doc = `{
"description": ":端口",
"type": "string"
},
"prefix": {
"description": "全局表前缀单独定义TableName则不生效",
"type": "string"
},
"singular": {
"description": "是否开启全局禁用复数true表示开启",
"type": "boolean"
},
"username": {
"description": "数据库用户名",
"type": "string"
@@ -5203,7 +5157,11 @@ var doc = `{
},
"autocode": {
"description": "auto",
"$ref": "#/definitions/config.Autocode"
"allOf": [
{
"$ref": "#/definitions/config.Autocode"
}
]
},
"aws-s3": {
"$ref": "#/definitions/config.AwsS3"
@@ -5213,7 +5171,11 @@ var doc = `{
},
"cors": {
"description": "跨域配置",
"$ref": "#/definitions/config.CORS"
"allOf": [
{
"$ref": "#/definitions/config.CORS"
}
]
},
"db-list": {
"type": "array",
@@ -5222,7 +5184,7 @@ var doc = `{
}
},
"email": {
"$ref": "#/definitions/config.Email"
"$ref": "#/definitions/github_com_flipped-aurora_gin-vue-admin_server_config.Email"
},
"excel": {
"$ref": "#/definitions/config.Excel"
@@ -5235,11 +5197,25 @@ var doc = `{
},
"local": {
"description": "oss",
"$ref": "#/definitions/config.Local"
"allOf": [
{
"$ref": "#/definitions/config.Local"
}
]
},
"mssql": {
"$ref": "#/definitions/config.Mssql"
},
"mysql": {
"description": "gorm",
"$ref": "#/definitions/config.Mysql"
"allOf": [
{
"$ref": "#/definitions/config.Mysql"
}
]
},
"oracle": {
"$ref": "#/definitions/config.Oracle"
},
"pgsql": {
"$ref": "#/definitions/config.Pgsql"
@@ -5281,6 +5257,11 @@ var doc = `{
"disable": {
"type": "boolean"
},
"engine": {
"description": "数据库引擎默认InnoDB",
"type": "string",
"default": "InnoDB"
},
"log-mode": {
"description": "是否开启Gorm全局日志",
"type": "string"
@@ -5309,6 +5290,14 @@ var doc = `{
"description": ":端口",
"type": "string"
},
"prefix": {
"description": "全局表前缀单独定义TableName则不生效",
"type": "string"
},
"singular": {
"description": "是否开启全局禁用复数true表示开启",
"type": "boolean"
},
"type": {
"type": "string"
},
@@ -5343,6 +5332,9 @@ var doc = `{
"description": "Oss类型",
"type": "string"
},
"router-prefix": {
"type": "string"
},
"use-multipoint": {
"description": "多点登录拦截",
"type": "boolean"
@@ -5461,7 +5453,11 @@ var doc = `{
},
"sysUser": {
"description": "管理详情",
"$ref": "#/definitions/system.SysUser"
"allOf": [
{
"$ref": "#/definitions/system.SysUser"
}
]
},
"sysUserAuthorityID": {
"description": "管理角色ID",
@@ -5574,18 +5570,36 @@ var doc = `{
}
}
},
"example.ExcelInfo": {
"github_com_flipped-aurora_gin-vue-admin_server_config.Email": {
"type": "object",
"properties": {
"fileName": {
"description": "文件名",
"from": {
"description": "收件人",
"type": "string"
},
"infoList": {
"type": "array",
"items": {
"$ref": "#/definitions/system.SysBaseMenu"
}
"host": {
"description": "服务器地址",
"type": "string"
},
"is-ssl": {
"description": "是否SSL",
"type": "boolean"
},
"nickname": {
"description": "昵称",
"type": "string"
},
"port": {
"description": "端口",
"type": "integer"
},
"secret": {
"description": "密钥",
"type": "string"
},
"to": {
"description": "收件人:多个以英文逗号分隔",
"type": "string"
}
}
},
@@ -5752,28 +5766,40 @@ var doc = `{
"type": "object",
"properties": {
"authorityId": {
"type": "integer"
"type": "string",
"example": "int 角色id"
},
"authorityIds": {
"type": "array",
"items": {
"type": "integer"
}
"type": "string",
"example": "[]uint 角色id"
},
"email": {
"type": "string",
"example": "电子邮箱"
},
"enable": {
"type": "integer"
"type": "string",
"example": "int 是否启用"
},
"headerImg": {
"type": "string"
"type": "string",
"example": "头像链接"
},
"nickName": {
"type": "string"
"type": "string",
"example": "昵称"
},
"passWord": {
"type": "string"
"type": "string",
"example": "密码"
},
"phone": {
"type": "string",
"example": "电话号码"
},
"userName": {
"type": "string"
"type": "string",
"example": "用户名"
}
}
},
@@ -5967,9 +5993,7 @@ var doc = `{
"response.PageResult": {
"type": "object",
"properties": {
"list": {
"type": "object"
},
"list": {},
"page": {
"type": "integer"
},
@@ -5998,9 +6022,7 @@ var doc = `{
"code": {
"type": "integer"
},
"data": {
"type": "object"
},
"data": {},
"msg": {
"type": "string"
}
@@ -6084,6 +6106,9 @@ var doc = `{
"captchaLength": {
"type": "integer"
},
"openCaptcha": {
"type": "boolean"
},
"picPath": {
"type": "string"
}
@@ -6135,6 +6160,10 @@ var doc = `{
"description": "是否自动移动文件",
"type": "boolean"
},
"businessDB": {
"description": "业务数据库",
"type": "string"
},
"description": {
"description": "Struct中文名称",
"type": "string"
@@ -6219,6 +6248,38 @@ var doc = `{
"require": {
"description": "是否必填",
"type": "boolean"
},
"sort": {
"description": "是否增加排序",
"type": "boolean"
}
}
},
"system.Meta": {
"type": "object",
"properties": {
"activeName": {
"type": "string"
},
"closeTab": {
"description": "自动关闭tab",
"type": "boolean"
},
"defaultMenu": {
"description": "是否是基础路由(开发中)",
"type": "boolean"
},
"icon": {
"description": "菜单图标",
"type": "string"
},
"keepAlive": {
"description": "是否缓存",
"type": "boolean"
},
"title": {
"description": "菜单名",
"type": "string"
}
}
},
@@ -6346,10 +6407,6 @@ var doc = `{
"$ref": "#/definitions/system.SysBaseMenu"
}
},
"closeTab": {
"description": "自动关闭tab",
"type": "boolean"
},
"component": {
"description": "对应前端文件路径",
"type": "string"
@@ -6358,32 +6415,28 @@ var doc = `{
"description": "创建时间",
"type": "string"
},
"defaultMenu": {
"description": "是否是基础路由(开发中)",
"type": "boolean"
},
"hidden": {
"description": "是否在列表隐藏",
"type": "boolean"
},
"icon": {
"description": "菜单图标",
"type": "string"
},
"id": {
"description": "主键ID",
"type": "integer"
},
"keepAlive": {
"description": "是否缓存",
"type": "boolean"
},
"menuBtn": {
"type": "array",
"items": {
"$ref": "#/definitions/system.SysBaseMenuBtn"
}
},
"meta": {
"description": "附加属性",
"allOf": [
{
"$ref": "#/definitions/system.Meta"
}
]
},
"name": {
"description": "路由name",
"type": "string"
@@ -6406,10 +6459,6 @@ var doc = `{
"description": "排序标记",
"type": "integer"
},
"title": {
"description": "菜单名",
"type": "string"
},
"updatedAt": {
"description": "更新时间",
"type": "string"
@@ -6571,10 +6620,6 @@ var doc = `{
"$ref": "#/definitions/system.SysMenu"
}
},
"closeTab": {
"description": "自动关闭tab",
"type": "boolean"
},
"component": {
"description": "对应前端文件路径",
"type": "string"
@@ -6583,26 +6628,14 @@ var doc = `{
"description": "创建时间",
"type": "string"
},
"defaultMenu": {
"description": "是否是基础路由(开发中)",
"type": "boolean"
},
"hidden": {
"description": "是否在列表隐藏",
"type": "boolean"
},
"icon": {
"description": "菜单图标",
"type": "string"
},
"id": {
"description": "主键ID",
"type": "integer"
},
"keepAlive": {
"description": "是否缓存",
"type": "boolean"
},
"menuBtn": {
"type": "array",
"items": {
@@ -6612,6 +6645,14 @@ var doc = `{
"menuId": {
"type": "string"
},
"meta": {
"description": "附加属性",
"allOf": [
{
"$ref": "#/definitions/system.Meta"
}
]
},
"name": {
"description": "路由name",
"type": "string"
@@ -6634,10 +6675,6 @@ var doc = `{
"description": "排序标记",
"type": "integer"
},
"title": {
"description": "菜单名",
"type": "string"
},
"updatedAt": {
"description": "更新时间",
"type": "string"
@@ -6792,49 +6829,20 @@ var doc = `{
}
}`
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: "0.0.1",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "Swagger Example API",
Description: "This is a sample Server pets",
}
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()
var SwaggerInfo = &swag.Spec{
Version: "0.0.1",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Swagger Example API",
Description: "This is a sample Server pets",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(swag.Name, &s{})
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}