EnumsController.cs 783 B

1234567891011121314151617181920212223242526272829
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Mvc;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using XYY.Core.Standard.Mvc;
  8. namespace XYY.Api.Finance.Controllers
  9. {
  10. [Route("api/[controller]/[action]")]
  11. [ApiController]
  12. public class EnumsController : ApiControllerBase
  13. {
  14. [AllowAnonymous]
  15. public async Task<IActionResult> Get(string enumName)
  16. {
  17. var enumList= EnumsHelper.GetEnumItems(enumName);
  18. return Ok(enumList);
  19. }
  20. [AllowAnonymous]
  21. public async Task<IActionResult> GetDes(string enumName)
  22. {
  23. var enumList = EnumsHelper.GetEnumItemsDes(enumName);
  24. return Ok(enumList);
  25. }
  26. }
  27. }