平安校园
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.

DictController.cs 1.8 KiB

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