Files
YG_FT_Platform/request/static/doc.html
DESKTOP-72TV0V4\caoxiaozhu bda8f13446 1. 增加了请求框架
2. 增加了删除虚拟环境的脚本
2026-01-12 14:20:44 +08:00

799 lines
21 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>X-Request API Framework - 接口文档</title>
<!-- 本地Swagger UI资源 -->
<link rel="stylesheet" href="/vendor/swagger-ui.css">
<script src="/vendor/swagger-ui-bundle.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #f8fafc;
}
.nav {
background: white;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
height: 64px;
display: flex;
align-items: center;
padding: 0 24px;
position: sticky;
top: 0;
z-index: 100;
}
.nav-brand {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 600;
color: #1f2937;
}
.nav-brand i {
color: #3b82f6;
margin-right: 8px;
}
.nav-links {
display: flex;
margin-left: 24px;
gap: 8px;
}
.nav-link {
padding: 8px 12px;
border-radius: 6px;
text-decoration: none;
font-size: 14px;
color: #6b7280;
transition: all 0.2s;
}
.nav-link:hover {
background: rgba(59, 130, 246, 0.1);
color: #3b82f6;
}
.nav-link.active {
background: rgba(59, 130, 246, 0.1);
color: #3b82f6;
border-bottom: 2px solid #3b82f6;
}
.nav-right {
margin-left: auto;
display: flex;
align-items: center;
gap: 16px;
}
.api-version {
font-size: 14px;
color: #6b7280;
}
.api-version span {
font-weight: 500;
color: #1f2937;
}
.main {
padding: 16px 24px;
}
.doc-container {
background: white;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
min-height: calc(100vh - 120px);
}
/* Swagger UI 样式覆盖 */
.swagger-ui .topbar {
display: none;
}
.swagger-ui .info {
margin: 20px 0;
}
.swagger-ui .scheme-container {
background: #f8fafc;
padding: 15px;
box-shadow: none;
}
/* Font Awesome 图标 (内联) */
.fa {
display: inline-block;
font-style: normal;
}
.fa-file-text-o:before { content: "📄"; }
.fa-file-text:before { content: "📝"; }
.fa-book:before { content: "📖"; }
.fa-home:before { content: "🏠"; }
</style>
</head>
<body>
<nav class="nav">
<div class="nav-brand">
<i class="fa fa-file-text-o"></i>
X-Request 管理系统
</div>
<div class="nav-links">
<a href="/log.html" class="nav-link">
<i class="fa fa-file-text"></i> 日志管理
</a>
<a href="/doc.html" class="nav-link active">
<i class="fa fa-book"></i> 接口文档
</a>
<a href="/" class="nav-link">
<i class="fa fa-home"></i> 首页
</a>
</div>
<div class="nav-right">
<div class="api-version">
API版本: <span>1.0.0</span>
</div>
</div>
</nav>
<main class="main">
<div class="doc-container">
<div id="swagger-ui"></div>
</div>
</main>
<script>
// 内嵌的OpenAPI规范
const spec = {
"openapi": "3.1.0",
"info": {
"title": "X-Request API Framework",
"description": "高性能、高并发的请求框架",
"version": "1.0.0"
},
"paths": {
"/": {
"get": {
"summary": "Root",
"description": "根路径 - 重定向到前端监控界面",
"operationId": "root__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/dashboard": {
"get": {
"summary": "Dashboard",
"description": "前端监控界面",
"operationId": "dashboard_dashboard_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/health": {
"get": {
"summary": "Health Check",
"description": "健康检查",
"operationId": "health_check_health_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/info": {
"get": {
"summary": "App Info",
"description": "应用信息",
"operationId": "app_info_info_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/routes": {
"get": {
"summary": "Get Routes Info",
"description": "获取所有路由信息",
"operationId": "get_routes_info_routes_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/monitoring/logs/batch/delete": {
"post": {
"tags": [
"Monitoring"
],
"summary": "批量删除日志文件",
"description": "批量删除日志文件\n\nArgs:\n request: 批量删除请求,包含日志文件路径列表",
"operationId": "batch_delete_logs_monitoring_logs_batch_delete_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BatchDeleteRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/logs/download": {
"post": {
"tags": [
"Monitoring"
],
"summary": "批量下载日志文件",
"description": "批量下载日志文件\n\nArgs:\n request: 批量下载请求,包含日志文件路径列表",
"operationId": "batch_download_logs_monitoring_logs_download_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BatchDownloadRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/logs/{log_name}": {
"delete": {
"tags": [
"Monitoring"
],
"summary": "删除单个日志文件",
"description": "删除单个日志文件\n\nArgs:\n log_name: 日志文件名支持带日期路径如YYYY-MM-DD/filename.log",
"operationId": "delete_log_monitoring_logs__log_name__delete",
"parameters": [
{
"name": "log_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Log Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"get": {
"tags": [
"Monitoring"
],
"summary": "获取日志内容",
"description": "获取日志文件内容\n\nArgs:\n log_name: 日志文件名\n lines: 返回的行数默认100行",
"operationId": "get_log_content_monitoring_logs__log_name__get",
"parameters": [
{
"name": "log_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Log Name"
}
},
{
"name": "lines",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 100,
"title": "Lines"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/logs/{date}/{log_name}": {
"delete": {
"tags": [
"Monitoring"
],
"summary": "删除指定日期的单个日志文件",
"description": "删除指定日期的单个日志文件\n\nArgs:\n date: 日期格式为YYYY-MM-DD\n log_name: 日志文件名",
"operationId": "delete_log_by_date_monitoring_logs__date___log_name__delete",
"parameters": [
{
"name": "date",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Date"
}
},
{
"name": "log_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Log Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"get": {
"tags": [
"Monitoring"
],
"summary": "获取指定日期的日志内容",
"description": "获取指定日期的日志内容\n\nArgs:\n date: 日期格式为YYYY-MM-DD\n log_name: 日志文件名\n entries: 返回的日志条目数量默认10个\n mode: 显示模式latest表示最新的N个条目显示在顶部oldest表示最早的N个条目显示在顶部默认latest",
"operationId": "get_log_content_by_date_monitoring_logs__date___log_name__get",
"parameters": [
{
"name": "date",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Date"
}
},
{
"name": "log_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Log Name"
}
},
{
"name": "entries",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 10,
"title": "Entries"
}
},
{
"name": "mode",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "latest",
"title": "Mode"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/logs/{log_name}/download": {
"get": {
"tags": [
"Monitoring"
],
"summary": "下载日志文件",
"description": "下载日志文件\n\nArgs:\n log_name: 日志文件名支持带日期路径如YYYY-MM-DD/filename.log",
"operationId": "download_log_monitoring_logs__log_name__download_get",
"parameters": [
{
"name": "log_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Log Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/logs/{date}/{log_name}/download": {
"get": {
"tags": [
"Monitoring"
],
"summary": "下载指定日期的日志文件",
"description": "下载指定日期的日志文件\n\nArgs:\n date: 日期格式为YYYY-MM-DD\n log_name: 日志文件名",
"operationId": "download_log_by_date_monitoring_logs__date___log_name__download_get",
"parameters": [
{
"name": "date",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Date"
}
},
{
"name": "log_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Log Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/logs": {
"get": {
"tags": [
"Monitoring"
],
"summary": "获取日志列表",
"description": "获取日志列表,支持按时间分类\n\nArgs:\n date: 日期格式为YYYY-MM-DD如不提供则返回所有日期文件夹",
"operationId": "get_logs_list_monitoring_logs_get",
"parameters": [
{
"name": "date",
"in": "query",
"required": false,
"schema": {
"type": "string",
"title": "Date"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/monitoring/status": {
"get": {
"tags": [
"Monitoring"
],
"summary": "获取服务器状态",
"description": "获取服务器基本状态信息",
"operationId": "get_server_status_monitoring_status_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
}
},
"components": {
"schemas": {
"BatchDeleteRequest": {
"properties": {
"files": {
"items": {
"type": "string"
},
"type": "array",
"title": "Files"
}
},
"type": "object",
"required": [
"files"
],
"title": "BatchDeleteRequest",
"description": "批量删除请求模型"
},
"BatchDownloadRequest": {
"properties": {
"files": {
"items": {
"type": "string"
},
"type": "array",
"title": "Files"
}
},
"type": "object",
"required": [
"files"
],
"title": "BatchDownloadRequest",
"description": "批量下载请求模型"
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
};
window.onload = function() {
SwaggerUIBundle({
spec: spec,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: "BaseLayout",
defaultModelsExpandDepth: 1,
defaultModelExpandDepth: 1,
docExpansion: "list",
filter: true,
showExtensions: true,
showCommonExtensions: true
});
};
</script>
</body>
</html>