forked from anjoy8/Blog.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApbController.cs
More file actions
29 lines (23 loc) · 901 Bytes
/
ApbController.cs
File metadata and controls
29 lines (23 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Collections.Generic;
using Blog.Core.SwaggerHelper;
using Microsoft.AspNetCore.Mvc;
using static Blog.Core.SwaggerHelper.CustomApiVersion;
namespace Blog.Core.Controllers.v1
{
[Route("api/[controller]")]
[ApiController]
public class ApbController : ControllerBase
{
/************************************************/
// 如果不需要使用Http协议带名称的,比如这种 [HttpGet]
// 就可以按照下边的写法去写,在方法上直接加特性 [CustomRoute(ApiVersions.v1, "apbs")]
// 反之,如果你需要http协议带名称,请看 V2 文件夹的方法
/************************************************/
[HttpGet]
[CustomRoute(ApiVersions.V1, "apbs")]
public IEnumerable<string> Get()
{
return new string[] { "第一版的 apbs" };
}
}
}