EnumsController.cs 808 B

123456789101112131415161718192021222324252627282930
  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.Reflection;
  7. using System.Threading.Tasks;
  8. using XYY.Core.Standard.Mvc;
  9. namespace XYY.Api.Order.Controllers
  10. {
  11. [Route("api/[controller]/[action]")]
  12. [ApiController]
  13. public class EnumsController : ApiControllerBase
  14. {
  15. [AllowAnonymous]
  16. public async Task<IActionResult> Get(string enumName)
  17. {
  18. var enumList = EnumsHelper.GetEnumItems(enumName);
  19. return Ok(enumList);
  20. }
  21. [AllowAnonymous]
  22. public async Task<IActionResult> GetDes(string enumName)
  23. {
  24. var enumList = EnumsHelper.GetEnumItemsDes(enumName);
  25. return Ok(enumList);
  26. }
  27. }
  28. }