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

98 lines
2.1 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 权限按钮控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "权限按钮")]
  7. [Route("sys/limit/[controller]")]
  8. [SuperAdmin]
  9. public class ButtonController : BaseController
  10. {
  11. private readonly IButtonService _buttonService;
  12. public ButtonController(IButtonService buttonService)
  13. {
  14. _buttonService = buttonService;
  15. }
  16. /// <summary>
  17. /// 按钮分页查询
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. [HttpGet("page")]
  22. public async Task<dynamic> Page([FromQuery] ButtonPageInput input)
  23. {
  24. return await _buttonService.Page(input);
  25. }
  26. /// <summary>
  27. /// 添加按钮
  28. /// </summary>
  29. /// <param name="input"></param>
  30. /// <returns></returns>
  31. [HttpPost("add")]
  32. [DisplayName("添加按钮")]
  33. public async Task Add([FromBody] ButtonAddInput input)
  34. {
  35. await _buttonService.Add(input);
  36. }
  37. /// <summary>
  38. /// 修改按钮
  39. /// </summary>
  40. /// <param name="input"></param>
  41. /// <returns></returns>
  42. [HttpPost("edit")]
  43. [DisplayName("修改按钮")]
  44. public async Task Edit([FromBody] ButtonEditInput input)
  45. {
  46. await _buttonService.Edit(input);
  47. }
  48. /// <summary>
  49. /// 删除按钮
  50. /// </summary>
  51. /// <param name="input"></param>
  52. /// <returns></returns>
  53. [HttpPost("delete")]
  54. [DisplayName("删除按钮")]
  55. public async Task Delete([FromBody] BaseIdListInput input)
  56. {
  57. await _buttonService.Delete(input);
  58. }
  59. /// <summary>
  60. /// 批量新增
  61. /// </summary>
  62. /// <param name="input"></param>
  63. /// <returns></returns>
  64. [HttpPost("batch")]
  65. [DisplayName("新增按钮")]
  66. public async Task Batch([FromBody] ButtonAddInput input)
  67. {
  68. await _buttonService.AddBatch(input);
  69. }
  70. /// <summary>
  71. /// 获取按钮详情
  72. /// </summary>
  73. /// <param name="input"></param>
  74. /// <returns></returns>
  75. [HttpGet("detail")]
  76. public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
  77. {
  78. return await _buttonService.Detail(input);
  79. }
  80. }