NewGaoKaoApi/New_College.Api/Controllers/v1/ApbController.cs

30 lines
904 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.Collections.Generic;
using New_College.SwaggerHelper;
using Microsoft.AspNetCore.Mvc;
using static New_College.Extensions.CustomApiVersion;
namespace New_College.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" };
}
}
}