SysOrgAppService.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 机构信息服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "sys-org")]
  7. [Route("sys/org")]
  8. public class SysOrgAppService : IDynamicApiController
  9. {
  10. private readonly ISysOrgService _sysOrgService;
  11. public SysOrgAppService(ISysOrgService sysOrgService)
  12. {
  13. _sysOrgService = sysOrgService;
  14. }
  15. /// <summary>
  16. /// 添加机构
  17. /// </summary>
  18. /// <param name="input"></param>
  19. /// <returns></returns>
  20. public async Task Add(AddSysOrgInput input)
  21. {
  22. await _sysOrgService.Add(input);
  23. }
  24. /// <summary>
  25. /// 更新机构
  26. /// </summary>
  27. /// <param name="input"></param>
  28. /// <returns></returns>
  29. public async Task Update(UpdateSysOrgInput input)
  30. {
  31. await _sysOrgService.Update(input);
  32. }
  33. /// <summary>
  34. /// 删除机构
  35. /// </summary>
  36. /// <param name="input"></param>
  37. /// <returns></returns>
  38. public async Task Del(BaseId<short> input)
  39. {
  40. await _sysOrgService.Del(input);
  41. }
  42. /// <summary>
  43. /// 启用禁用机构
  44. /// </summary>
  45. /// <param name="input"></param>
  46. /// <returns></returns>
  47. public async Task ChangeStatus(BaseId<short> input)
  48. {
  49. await _sysOrgService.ChangeStatus(input);
  50. }
  51. /// <summary>
  52. /// 根据ID获取机构
  53. /// </summary>
  54. /// <param name="id"></param>
  55. /// <returns></returns>
  56. public async Task<SysOrgOutput> GetById([FromQuery][Required] short id)
  57. {
  58. return await _sysOrgService.GetById(id);
  59. }
  60. /// <summary>
  61. /// 查询机构列表
  62. /// </summary>
  63. /// <param name="input"></param>
  64. /// <returns></returns>
  65. public async Task<List<SysOrgLiteOutput>> QueryList(QuerySysOrgInput input)
  66. {
  67. return await _sysOrgService.QueryList(input);
  68. }
  69. /// <summary>
  70. /// 分页查询机构列表
  71. /// </summary>
  72. /// <param name="input"></param>
  73. /// <returns></returns>
  74. public async Task<PageResult<SysOrgOutput>> QueryPageList(SysOrgPageInput input)
  75. {
  76. return await _sysOrgService.QueryPageList(input);
  77. }
  78. /// <summary>
  79. /// 获取全部机构列表
  80. /// </summary>
  81. /// <returns></returns>
  82. public async Task<List<SysOrgLiteOutput>> GetAllList()
  83. {
  84. return await _sysOrgService.GetAllList();
  85. }
  86. /// <summary>
  87. /// 根据学校ID获取校区列表
  88. /// </summary>
  89. /// <param name="orgId"></param>
  90. /// <returns></returns>
  91. public async Task<List<SysOrgLiteOutput>> GetOrgBranchByOrgId([FromQuery][Required] short orgId)
  92. {
  93. return await _sysOrgService.GetOrgBranchByOrgId(orgId);
  94. }
  95. }