DictListController.cs 883 B

1234567891011121314151617181920212223242526272829303132
  1. using Microsoft.AspNetCore.Mvc;
  2. using Microsoft.Extensions.Logging;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using XYY.Core.Standard.Mvc;
  8. using XYY.Service.Standard.KnowledgeBase;
  9. namespace KnowledgeBase.Controllers
  10. {
  11. [ApiController]
  12. [Route("[controller]")]
  13. public class DictListController : ControllerBase
  14. {
  15. IKnowledgeSevice knowledgeSevice;
  16. public DictListController(IKnowledgeSevice knowledgeSevice)
  17. {
  18. this.knowledgeSevice = knowledgeSevice;
  19. }
  20. /// <summary>
  21. /// 获取部门列表
  22. /// </summary>
  23. /// <returns>部门列表</returns>
  24. [HttpGet]
  25. public async Task<ApiJsonModel<List<string>>> Get()
  26. {
  27. return ApiJsonModel<List<string>>.OK(await this.knowledgeSevice.GetDicts());
  28. }
  29. }
  30. }