feat: opt router path redirect

This commit is contained in:
engigu
2026-03-10 11:38:49 +08:00
parent 1584528bdf
commit c3aed2b8df
9 changed files with 832 additions and 408 deletions
+141
View File
@@ -24,6 +24,147 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/app-logs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"应用日志"
],
"summary": "获取应用日志列表",
"parameters": [
{
"type": "string",
"description": "日志分类",
"name": "category",
"in": "query"
},
{
"type": "string",
"description": "状态",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "级别",
"name": "level",
"in": "query"
},
{
"type": "string",
"description": "搜索关键词",
"name": "keyword",
"in": "query"
},
{
"type": "integer",
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_engigu_baihu-panel_internal_utils.Response"
}
}
}
}
},
"/app-logs/clear": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"应用日志"
],
"summary": "清理日志",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_engigu_baihu-panel_internal_utils.Response"
}
}
}
}
},
"/app-logs/read": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"应用日志"
],
"summary": "标记已读",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_engigu_baihu-panel_internal_utils.Response"
}
}
}
}
},
"/env": {
"get": {
"security": [
+141
View File
@@ -18,6 +18,147 @@
"host": "localhost:8052",
"basePath": "/open2api/v1",
"paths": {
"/app-logs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"应用日志"
],
"summary": "获取应用日志列表",
"parameters": [
{
"type": "string",
"description": "日志分类",
"name": "category",
"in": "query"
},
{
"type": "string",
"description": "状态",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "级别",
"name": "level",
"in": "query"
},
{
"type": "string",
"description": "搜索关键词",
"name": "keyword",
"in": "query"
},
{
"type": "integer",
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_engigu_baihu-panel_internal_utils.Response"
}
}
}
}
},
"/app-logs/clear": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"应用日志"
],
"summary": "清理日志",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_engigu_baihu-panel_internal_utils.Response"
}
}
}
}
},
"/app-logs/read": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"应用日志"
],
"summary": "标记已读",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_engigu_baihu-panel_internal_utils.Response"
}
}
}
}
},
"/env": {
"get": {
"security": [
+87
View File
@@ -154,6 +154,93 @@ info:
title: Baihu Panel API
version: "1.0"
paths:
/app-logs:
get:
consumes:
- application/json
parameters:
- description: 日志分类
in: query
name: category
type: string
- description: 状态
in: query
name: status
type: string
- description: 级别
in: query
name: level
type: string
- description: 搜索关键词
in: query
name: keyword
type: string
- description: 页码
in: query
name: page
type: integer
- description: 每页数量
in: query
name: page_size
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_engigu_baihu-panel_internal_utils.Response'
security:
- BearerAuth: []
summary: 获取应用日志列表
tags:
- 应用日志
/app-logs/clear:
post:
consumes:
- application/json
parameters:
- description: 请求体
in: body
name: body
required: true
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_engigu_baihu-panel_internal_utils.Response'
security:
- BearerAuth: []
summary: 清理日志
tags:
- 应用日志
/app-logs/read:
post:
consumes:
- application/json
parameters:
- description: 请求体
in: body
name: body
required: true
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_engigu_baihu-panel_internal_utils.Response'
security:
- BearerAuth: []
summary: 标记已读
tags:
- 应用日志
/env:
get:
consumes: