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

ButtonController.cs 2.1 KiB

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