平安校园
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 SpaController : BaseController
  10. {
  11. private readonly ISpaService _spaService;
  12. public SpaController(ISpaService spaService)
  13. {
  14. _spaService = spaService;
  15. }
  16. /// <summary>
  17. /// 单页分页查询
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. [HttpGet("page")]
  22. public async Task<dynamic> Page([FromQuery] SpaPageInput input)
  23. {
  24. return await _spaService.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] SpaAddInput input)
  34. {
  35. await _spaService.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] SpaEditInput input)
  45. {
  46. await _spaService.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 _spaService.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 _spaService.Detail(input);
  68. }
  69. }