平安校园
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/limit/[controller]")]
  8. [SuperAdmin]
  9. public class ModuleController : BaseController
  10. {
  11. private readonly IModuleService _moduleService;
  12. public ModuleController(IModuleService moduleService)
  13. {
  14. _moduleService = moduleService;
  15. }
  16. /// <summary>
  17. /// 模块分页查询
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. [HttpGet("page")]
  22. public async Task<dynamic> Page([FromQuery] ModulePageInput input)
  23. {
  24. return await _moduleService.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] ModuleAddInput input)
  34. {
  35. await _moduleService.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] ModuleEditInput input)
  45. {
  46. await _moduleService.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 _moduleService.Delete(input);
  58. }
  59. /// <summary>
  60. /// 获取模块详情
  61. /// </summary>
  62. /// <param name="input"></param>
  63. /// <returns></returns>
  64. [HttpGet("detail")]
  65. public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
  66. {
  67. return await _moduleService.Detail(input);
  68. }
  69. }