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
33 lines (27 loc) · 997 Bytes
/
ApbController.cs
File metadata and controls
33 lines (27 loc) · 997 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
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Blog.Core.SwaggerHelper;
using Microsoft.AspNetCore.Http;
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" };
}
}
}