Skip to content

Commit 16c7c8d

Browse files
committed
Modifying the naming specification(3 🍎 )
1 parent 47a354a commit 16c7c8d

5 files changed

Lines changed: 10 additions & 15 deletions

File tree

Blog.Core/Blog.Core.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Blog.Core/Controllers/BlogController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public async Task<object> DetailNuxtNoPer(int id)
153153
//[Route("/api/v2/blog/Blogtest")]
154154

155155
//和上边的版本控制以及路由地址都是一样的
156-
[CustomRoute(ApiVersions.v2, "Blogtest")]
156+
[CustomRoute(ApiVersions.V2, "Blogtest")]
157157
public async Task<object> V2_Blogtest()
158158
{
159159
return Ok(new { status = 220, data = "我是第二版的博客信息" });

Blog.Core/Controllers/v1/ApbController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ApbController : ControllerBase
1818
/************************************************/
1919

2020
[HttpGet]
21-
[CustomRoute(ApiVersions.v1, "apbs")]
21+
[CustomRoute(ApiVersions.V1, "apbs")]
2222
public IEnumerable<string> Get()
2323
{
2424
return new string[] { "第一版的 apbs" };

Blog.Core/Controllers/v2/ApbController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Blog.Core.Controllers.v2
1212
{
13-
[CustomRoute(ApiVersions.v2)]
13+
[CustomRoute(ApiVersions.V2)]
1414
//[Route("api/[controller]")]
1515
[ApiController]
1616
[Authorize("Permission")]
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
6-
namespace Blog.Core.SwaggerHelper
1+
namespace Blog.Core.SwaggerHelper
72
{
83
/// <summary>
94
/// 自定义版本
@@ -16,13 +11,13 @@ public class CustomApiVersion
1611
public enum ApiVersions
1712
{
1813
/// <summary>
19-
/// v1 版本
14+
/// V1 版本
2015
/// </summary>
21-
v1 = 1,
16+
V1 = 1,
2217
/// <summary>
23-
/// v2 版本
18+
/// V2 版本
2419
/// </summary>
25-
v2 = 2,
20+
V2 = 2,
2621
}
2722
}
2823
}

0 commit comments

Comments
 (0)