mirror of
https://github.com/kwinH/fastApi.git
synced 2025-12-24 13:07:58 +08:00
213 lines
6.5 KiB
Go
213 lines
6.5 KiB
Go
// Package docs GENERATED BY SWAG; DO NOT EDIT
|
|
// This file was generated by swaggo/swag
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/user/login": {
|
|
"post": {
|
|
"description": "用户登录接口2",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"用户相关接口"
|
|
],
|
|
"summary": "用户登录接口1",
|
|
"parameters": [
|
|
{
|
|
"maxLength": 40,
|
|
"minLength": 8,
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 5,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "user_name",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user/register": {
|
|
"post": {
|
|
"description": "用户注册接口",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"用户相关接口"
|
|
],
|
|
"summary": "用户注册接口",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户令牌",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 2,
|
|
"type": "string",
|
|
"description": "昵称",
|
|
"name": "nickname",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 40,
|
|
"minLength": 8,
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 40,
|
|
"minLength": 8,
|
|
"type": "string",
|
|
"description": "确认密码",
|
|
"name": "password_confirm",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 5,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "user_name",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"response.Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"description": "Code 0正确",
|
|
"type": "integer"
|
|
},
|
|
"data": {},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"msg": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"response.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"avatar": {
|
|
"description": "头像",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "注册时间",
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"description": "ID",
|
|
"type": "integer"
|
|
},
|
|
"nickname": {
|
|
"description": "昵称",
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"description": "状态",
|
|
"type": "string"
|
|
},
|
|
"user_name": {
|
|
"description": "用户名",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"response.UserResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"description": "Code 0正确",
|
|
"type": "integer"
|
|
},
|
|
"data": {
|
|
"$ref": "#/definitions/response.User"
|
|
},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"msg": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "http://localhost:3000",
|
|
BasePath: "/api/v1",
|
|
Schemes: []string{},
|
|
Title: "fastApi接口文档",
|
|
Description: "这里写描述信息",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|