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

125 lines
2.7 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 批量控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "批量修改")]
  7. [Route("/sys/batch")]
  8. public class BatchEditController : BaseController
  9. {
  10. private readonly IBatchEditService _batchEditService;
  11. public BatchEditController(IBatchEditService updateBatchService)
  12. {
  13. _batchEditService = updateBatchService;
  14. }
  15. #region Get请求
  16. /// <summary>
  17. /// 批量分页查询
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. [HttpGet("page")]
  22. public async Task<dynamic> Page([FromQuery] BatchEditPageInput input)
  23. {
  24. return await _batchEditService.Page(input);
  25. }
  26. /// <summary>
  27. /// 获取表信息
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet("tables")]
  31. public dynamic Tables()
  32. {
  33. return _batchEditService.GetTables();
  34. }
  35. /// <summary>
  36. /// 获取批量配置信息
  37. /// </summary>
  38. /// <returns></returns>
  39. [HttpGet("configs")]
  40. public async Task<dynamic> ConfigList([FromQuery] BaseIdInput input)
  41. {
  42. return await _batchEditService.ConfigList(input);
  43. }
  44. /// <summary>
  45. /// 获取批量配置信息
  46. /// </summary>
  47. /// <returns></returns>
  48. [HttpGet("columns")]
  49. [IgnoreSuperAdmin]
  50. public async Task<dynamic> Columns([FromQuery] string code)
  51. {
  52. return await _batchEditService.Columns(code);
  53. }
  54. #endregion Get请求
  55. #region Post请求
  56. /// <summary>
  57. /// 添加批量
  58. /// </summary>
  59. /// <param name="input"></param>
  60. /// <returns></returns>
  61. [HttpPost("add")]
  62. [DisplayName("添加批量更新")]
  63. public async Task Add([FromBody] BatchEditAddInput input)
  64. {
  65. await _batchEditService.Add(input);
  66. }
  67. /// <summary>
  68. /// 配置修改批量
  69. /// </summary>
  70. /// <param name="input"></param>
  71. /// <returns></returns>
  72. [HttpPost("config")]
  73. [DisplayName("配置批量更新")]
  74. public async Task Config([FromBody] List<BatchEditConfigInput> input)
  75. {
  76. await _batchEditService.Config(input);
  77. }
  78. /// <summary>
  79. /// 删除批量
  80. /// </summary>
  81. /// <param name="input"></param>
  82. /// <returns></returns>
  83. [HttpPost("delete")]
  84. [DisplayName("删除批量更新")]
  85. public async Task Delete([FromBody] BaseIdListInput input)
  86. {
  87. await _batchEditService.Delete(input);
  88. }
  89. /// <summary>
  90. /// 批量更新同步
  91. /// </summary>
  92. /// <param name="input"></param>
  93. /// <returns></returns>
  94. [HttpPost("sync")]
  95. [DisplayName("批量更新同步")]
  96. public async Task Sync([FromBody] BaseIdInput input)
  97. {
  98. await _batchEditService.SyncColumns(input);
  99. }
  100. #endregion Post请求
  101. }