Files
license-manager/backend/docs/swagger/docs.go
T

355 lines
11 KiB
Go

// Package swagger Code generated by swaggo/swag. DO NOT EDIT
package swagger
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "[email protected]"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/admin/system/info": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "获取详细的系统信息(需要管理员权限)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"系统"
],
"summary": "获取系统信息",
"responses": {
"200": {
"description": "系统信息",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
},
"401": {
"description": "未认证",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
},
"403": {
"description": "权限不足",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
}
}
}
},
"/api/v1/auth/refresh": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "刷新用户Token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"认证"
],
"summary": "刷新Token",
"responses": {
"200": {
"description": "刷新成功",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
},
"401": {
"description": "未认证",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
},
"500": {
"description": "服务器内部错误",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
}
}
}
},
"/api/v1/login": {
"post": {
"description": "管理员用户登录接口",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"认证"
],
"summary": "用户登录",
"parameters": [
{
"description": "登录请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "登录成功",
"schema": {
"$ref": "#/definitions/models.LoginResponse"
}
},
"400": {
"description": "请求参数无效",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
},
"401": {
"description": "用户名或密码错误",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
},
"500": {
"description": "服务器内部错误",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
}
}
}
},
"/api/v1/logout": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "用户登出接口",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"认证"
],
"summary": "用户登出",
"responses": {
"200": {
"description": "登出成功",
"schema": {
"$ref": "#/definitions/models.APIResponse"
}
},
"401": {
"description": "未认证",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
}
}
}
},
"/health": {
"get": {
"description": "系统健康状态检查",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"系统"
],
"summary": "健康检测",
"responses": {
"200": {
"description": "健康状态",
"schema": {
"$ref": "#/definitions/models.HealthResponse"
}
}
}
}
}
},
"definitions": {
"models.APIResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"message": {
"type": "string"
},
"timestamp": {
"type": "string"
}
}
},
"models.ErrorResponse": {
"type": "object",
"properties": {
"code": {
"description": "HTTP状态码,如 401, 500",
"type": "integer"
},
"error": {
"description": "业务错误码,如 AUTH_001, LOGIN_FAILED",
"type": "string"
},
"message": {
"description": "错误描述信息",
"type": "string"
},
"timestamp": {
"description": "错误发生时间",
"type": "string"
}
}
},
"models.HealthResponse": {
"type": "object",
"properties": {
"services": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"status": {
"type": "string"
},
"system": {
"$ref": "#/definitions/models.SystemInfo"
},
"timestamp": {
"type": "string"
},
"uptime": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"models.LoginRequest": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.LoginResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"message": {
"type": "string"
}
}
},
"models.SystemInfo": {
"type": "object",
"properties": {
"arch": {
"type": "string"
},
"num_cpu": {
"type": "integer"
},
"num_goroutine": {
"type": "integer"
},
"os": {
"type": "string"
},
"version": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "Bearer token for authentication",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:18888",
BasePath: "/",
Schemes: []string{},
Title: "License Manager API",
Description: "软件授权管理平台API文档",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}