BootstrapAdmin/Bootstrap.Admin/Controllers/Api/CategoryController.cs

27 lines
651 B
C#

using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 数据字典分类
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class CategoryController : ControllerBase
{
/// <summary>
/// 获取字典表中所有Category数据
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public IEnumerable<string> Get()
{
return DictHelper.RetrieveCategories();
}
}
}