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

BatchEditController.cs 2.7 KiB

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