提供文件上传及静态服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
3.8 KiB

// 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}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/base/file": {
"get": {
"security": [
{
"Bearer": []
}
],
"tags": [
"file"
],
"summary": "获取文件临时地址(可不用)",
"parameters": [
{
"type": "string",
"name": "fileName",
"in": "query"
}
],
"responses": {
"200": {
"description": "{\"code\": 0, \"data\": \"\",\"msg\": \"ok\"}",
"schema": {
"type": "string"
}
},
"3000": {
"description": "{\"code\": 1, \"msg\": \"\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/base/upload": {
"post": {
"security": [
{
"Bearer": []
}
],
"consumes": [
"multipart/form-data"
],
"tags": [
"file"
],
"summary": "上传文件",
"parameters": [
{
"type": "string",
"description": "file文件",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "{\"code\": 0, \"data\": \"\",\"msg\": \"Transaction complete\"}",
"schema": {
"type": "string"
}
},
"3000": {
"description": "{\"code\": 1, \"msg\": \"\"}",
"schema": {
"type": "string"
}
}
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "x-token",
"in": "header"
}
}
}`
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: "/minio",
Schemes: []string{},
Title: "Swagger Example API",
Description: "nft",
}
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{})
}