平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

86 lines
1.8 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 系统字典控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "系统字典")]
  7. [Route("sys/ops/[controller]")]
  8. [SuperAdmin]
  9. public class DictController : BaseController
  10. {
  11. private readonly IDictService _dictService;
  12. public DictController(IDictService dictService)
  13. {
  14. _dictService = dictService;
  15. }
  16. /// <summary>
  17. /// 获取字典树
  18. /// </summary>
  19. /// <returns></returns>
  20. [HttpGet("tree")]
  21. [IgnoreSuperAdmin]
  22. public async Task<dynamic> Tree([FromQuery] DictTreeInput input)
  23. {
  24. return await _dictService.Tree(input);
  25. }
  26. /// <summary>
  27. /// 字典分页查询
  28. /// </summary>
  29. /// <param name="input"></param>
  30. /// <returns></returns>
  31. [HttpGet("page")]
  32. public async Task<dynamic> Page([FromQuery] DictPageInput input)
  33. {
  34. return await _dictService.Page(input);
  35. }
  36. /// <summary>
  37. /// 添加字典
  38. /// </summary>
  39. /// <param name="input"></param>
  40. /// <returns></returns>
  41. [HttpPost("add")]
  42. [DisplayName("添加字典")]
  43. public async Task Add([FromBody] DictAddInput input)
  44. {
  45. await _dictService.Add(input);
  46. }
  47. /// <summary>
  48. /// 修改字典
  49. /// </summary>
  50. /// <param name="input"></param>
  51. /// <returns></returns>
  52. [HttpPost("edit")]
  53. [DisplayName("修改字典")]
  54. public async Task Edit([FromBody] DictEditInput input)
  55. {
  56. await _dictService.Edit(input);
  57. }
  58. /// <summary>
  59. /// 删除字典
  60. /// </summary>
  61. /// <param name="input"></param>
  62. /// <returns></returns>
  63. [HttpPost("delete")]
  64. [DisplayName("删除字典")]
  65. public async Task Delete([FromBody] DictDeleteInput input)
  66. {
  67. await _dictService.Delete(input);
  68. }
  69. }