✨ feat(server): 添加浏览器内 OpenAPI 调试页及诊断入口
* 新增 DebugConsoleController,提供 /debug 纯内嵌调试页 - 零外部依赖,基于 Swagger JSON 自动生成各端点表单 - 与 Swagger:Enabled 同步开关,避免生产环境误暴露 * 启用 <GenerateDocumentationFile>,将 XML 注释注入 OpenAPI - 调试页与 Swagger UI 共用同一份端点标题和说明 * 为 Health/Status/LegacyHttpApi 控制器添加 Tags 分组 * 补充 VS Code launch.json 与 tasks.json,支持现场调试 * 新增 DebugConsoleEndpointTests 覆盖调试页基础响应 * 同步更新 README 进度与待办清单
This commit is contained in:
67
.vscode/launch.json
vendored
Normal file
67
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
// VS Code 启动与调试配置
|
||||
// 依赖 C# 扩展(OmniSharp 或 C# Dev Kit)提供 coreclr 调试器。
|
||||
// 文档:https://code.visualstudio.com/docs/csharp/debugger-settings
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// 标准调试启动:编译并启动 Host,命中断点,浏览器自动打开首页
|
||||
"name": ".NET Core Launch (Host)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
|
||||
"--no-launch-profile"
|
||||
],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_URLS": "http://localhost:5190"
|
||||
},
|
||||
"stopAtEntry": false,
|
||||
"console": "internalConsole",
|
||||
"preLaunchTask": "build",
|
||||
"serverReadyAction": {
|
||||
"action": "openExternally",
|
||||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
|
||||
"uriFormat": "%s"
|
||||
}
|
||||
},
|
||||
{
|
||||
// 热重载调试启动:自动编译、自动重启、断点保留;迭代 Web / 控制器层时首选
|
||||
"name": ".NET Core Watch (Host)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"program": "dotnet",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
|
||||
"--no-launch-profile"
|
||||
],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_URLS": "http://localhost:5190"
|
||||
},
|
||||
"stopAtEntry": false,
|
||||
"console": "integratedTerminal",
|
||||
"serverReadyAction": {
|
||||
"action": "openExternally",
|
||||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
|
||||
"uriFormat": "%s"
|
||||
}
|
||||
},
|
||||
{
|
||||
// 附加到正在运行的 dotnet 进程(如已手动 `dotnet run` 或 Windows Service 模式)
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
||||
160
.vscode/tasks.json
vendored
Normal file
160
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
{
|
||||
// VS Code 任务配置
|
||||
// 文档:https://code.visualstudio.com/docs/editor/tasks
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
// 构建整个解决方案,是 launch.json 启动前的默认 preLaunchTask
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/FlyshotReplacement.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary",
|
||||
"-v",
|
||||
"minimal"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": "$msCompile",
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
// 仅构建宿主项目,迭代 Web 层时比整解决方案快
|
||||
"label": "build-host",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary",
|
||||
"-v",
|
||||
"minimal"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
// 还原 NuGet 包,新增引用或克隆后第一次打开时使用
|
||||
"label": "restore",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"restore",
|
||||
"${workspaceFolder}/FlyshotReplacement.sln"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
// 清理所有项目的 bin/obj
|
||||
"label": "clean",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"clean",
|
||||
"${workspaceFolder}/FlyshotReplacement.sln"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
// 跑全部测试(领域 + 集成)
|
||||
"label": "test",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"test",
|
||||
"${workspaceFolder}/FlyshotReplacement.sln",
|
||||
"--no-restore",
|
||||
"-v",
|
||||
"minimal"
|
||||
],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
// 仅跑领域 / 算法层测试,迭代规划逻辑时使用
|
||||
"label": "test-core",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"test",
|
||||
"${workspaceFolder}/tests/Flyshot.Core.Tests/Flyshot.Core.Tests.csproj",
|
||||
"-v",
|
||||
"minimal"
|
||||
],
|
||||
"group": "test",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
// 仅跑宿主集成测试,迭代 HTTP / 控制器层时使用
|
||||
"label": "test-integration",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"test",
|
||||
"${workspaceFolder}/tests/Flyshot.Server.IntegrationTests/Flyshot.Server.IntegrationTests.csproj",
|
||||
"-v",
|
||||
"minimal"
|
||||
],
|
||||
"group": "test",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
// 启动宿主,供 launch.json 的 watch 配置作为前置任务
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
|
||||
"--launch-profile",
|
||||
"http"
|
||||
],
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "dotnet-watch",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^.*$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"message": 3
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": "^.*Watch run started.*$",
|
||||
"endsPattern": "^.*Application started.*$"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Release 配置发布到 publish/,用于现场部署包打包
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
|
||||
"-c",
|
||||
"Release",
|
||||
"-o",
|
||||
"${workspaceFolder}/publish"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user