This commit is contained in:
wood911010 committed 2025-08-12 18:31:37 +08:00
1 parent 7cc8c8d63f
commit 3f6910a9c2
5 files changed
+14 -21

No files matched your search

-1
View File
@@ -26,7 +26,6 @@ import (
// @license.name MIT
// @license.url https://opensource.org/licenses/MIT
// @host localhost:18888
// @BasePath /
// @schemes http https
+3 -7
View File
@@ -234,11 +234,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"code": {
"description": "HTTP状态码,如 401, 500",
"type": "integer"
},
"error": {
"description": "业务错误码,如 AUTH_001, LOGIN_FAILED",
"description": "业务错误码,如 \"100001\", \"900001\"",
"type": "string"
},
"message": {
@@ -338,9 +334,9 @@ const docTemplate = `{
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:18888",
Host: "",
BasePath: "/",
Schemes: []string{},
Schemes: []string{"http", "https"},
Title: "License Manager API",
Description: "软件授权管理平台API文档",
InfoInstanceName: "swagger",
+5 -6
View File
@@ -1,4 +1,8 @@
{
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"info": {
"description": "软件授权管理平台API文档",
@@ -15,7 +19,6 @@
},
"version": "1.0"
},
"host": "localhost:18888",
"basePath": "/",
"paths": {
"/api/v1/admin/system/info": {
@@ -228,11 +231,7 @@
"type": "object",
"properties": {
"code": {
"description": "HTTP状态码,如 401, 500",
"type": "integer"
},
"error": {
"description": "业务错误码,如 AUTH_001, LOGIN_FAILED",
"description": "业务错误码,如 \"100001\", \"900001\"",
"type": "string"
},
"message": {
+4 -5
View File
@@ -13,10 +13,7 @@ definitions:
models.ErrorResponse:
properties:
code:
description: HTTP状态码,如 401, 500
type: integer
error:
description: 业务错误码,如 AUTH_001, LOGIN_FAILED
description: 业务错误码,如 "100001", "900001"
type: string
message:
description: 错误描述信息
@@ -73,7 +70,6 @@ definitions:
version:
type: string
type: object
host: localhost:18888
info:
contact:
email: support@swagger.io
@@ -207,6 +203,9 @@ paths:
summary: 健康检测
tags:
- 系统
schemes:
- http
- https
securityDefinitions:
BearerAuth:
description: Bearer token for authentication
+2 -2
View File
@@ -19,7 +19,7 @@ func SetupRouter() *gin.Engine {
router.Use(middleware.CustomLoggerMiddleware())
router.Use(gin.Recovery())
router.Use(middleware.CORSMiddleware())
// 多语言中间件
cfg := config.GetConfig()
if cfg.I18n.Enable {
@@ -43,7 +43,7 @@ func SetupRouter() *gin.Engine {
router.GET("/health", systemHandler.HealthCheck)
// Swagger文档路由
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL("/swagger/doc.json")))
// API v1 路由组
v1 := router.Group("/api/v1")