Skip to content

Commit

Permalink
chore(dev): vscode debug config
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 1, 2023
1 parent 16074c2 commit 4f9455c
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
36 changes: 36 additions & 0 deletions src/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "GZCTF Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/GZCTF/bin/Debug/net7.0/GZCTF.dll",
"args": [],
"cwd": "${workspaceFolder}/GZCTF",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "Program: GZ::CTF",
"uriFormat": "http://localhost:55000",
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views",
},
"checkForDevCert": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
41 changes: 41 additions & 0 deletions src/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/GZCTF.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/GZCTF.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/GZCTF.sln"
],
"problemMatcher": "$msCompile"
}
]
}
5 changes: 3 additions & 2 deletions src/GZCTF/Controllers/InfoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class InfoController(IPostRepository postRepository,
/// 获取最新文章
/// </remarks>
/// <param name="token"></param>
/// <response code="200">成功获取公告</response>
/// <response code="200">成功获取文章</response>
[HttpGet("Posts/Latest")]
[ProducesResponseType(typeof(PostInfoModel[]), StatusCodes.Status200OK)]
public async Task<IActionResult> GetLatestPosts(CancellationToken token)
Expand All @@ -39,7 +39,7 @@ public async Task<IActionResult> GetLatestPosts(CancellationToken token)
/// 获取全部文章
/// </remarks>
/// <param name="token"></param>
/// <response code="200">成功获取公告</response>
/// <response code="200">成功获取文章</response>
[HttpGet("Posts")]
[ProducesResponseType(typeof(PostInfoModel[]), StatusCodes.Status200OK)]
public async Task<IActionResult> GetPosts(CancellationToken token)
Expand All @@ -54,6 +54,7 @@ public async Task<IActionResult> GetPosts(CancellationToken token)
/// <param name="id"></param>
/// <param name="token"></param>
/// <response code="200">成功获取文章详情</response>
/// <response code="404">文章未找到</response>
[HttpGet("Posts/{id}")]
[ProducesResponseType(typeof(PostDetailModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(RequestResponse), StatusCodes.Status404NotFound)]
Expand Down

0 comments on commit 4f9455c

Please sign in to comment.