平安校园
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

138 lines
3.0 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 组织管理控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "组织管理")]
  7. [Route("sys/organization/[controller]")]
  8. [SuperAdmin]
  9. public class OrgController : BaseController
  10. {
  11. private readonly ISysOrgService _sysOrgService;
  12. private readonly ISysUserService _sysUserService;
  13. public OrgController(ISysOrgService sysOrgService, ISysUserService sysUserService)
  14. {
  15. _sysOrgService = sysOrgService;
  16. _sysUserService = sysUserService;
  17. }
  18. #region Get
  19. /// <summary>
  20. /// 获取组织树
  21. /// </summary>
  22. /// <returns></returns>
  23. [HttpGet("tree")]
  24. public async Task<dynamic> Tree()
  25. {
  26. return await _sysOrgService.Tree();
  27. }
  28. /// <summary>
  29. /// 获取组织树选择器
  30. /// </summary>
  31. /// <returns></returns>
  32. [HttpGet("orgTreeSelector")]
  33. public async Task<dynamic> OrgTreeSelector()
  34. {
  35. return await _sysOrgService.Tree();
  36. }
  37. /// <summary>
  38. /// 组织分页查询
  39. /// </summary>
  40. /// <param name="input"></param>
  41. /// <returns></returns>
  42. [HttpGet("page")]
  43. public async Task<dynamic> Page([FromQuery] SysOrgPageInput input)
  44. {
  45. return await _sysOrgService.Page(input);
  46. }
  47. /// <summary>
  48. /// 获取用户选择器
  49. /// </summary>
  50. /// <returns></returns>
  51. [HttpGet("selector")]
  52. public async Task<dynamic> UserSelector([FromQuery] UserSelectorInput input)
  53. {
  54. return await _sysUserService.Selector(input);
  55. }
  56. /// <summary>
  57. /// 获取组织详情
  58. /// </summary>
  59. /// <param name="input"></param>
  60. /// <returns></returns>
  61. [HttpGet("detail")]
  62. public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
  63. {
  64. return await _sysOrgService.Detail(input);
  65. }
  66. #endregion Get
  67. #region Post
  68. /// <summary>
  69. /// 复制组织
  70. /// </summary>
  71. /// <param name="input"></param>
  72. /// <returns></returns>
  73. [HttpPost("copy")]
  74. [DisplayName("复制组织")]
  75. public async Task Copy([FromBody] SysOrgCopyInput input)
  76. {
  77. await _sysOrgService.Copy(input);
  78. }
  79. /// <summary>
  80. /// 添加组织
  81. /// </summary>
  82. /// <param name="input"></param>
  83. /// <returns></returns>
  84. [HttpPost("add")]
  85. [DisplayName("添加组织")]
  86. public async Task Add([FromBody] SysOrgAddInput input)
  87. {
  88. await _sysOrgService.Add(input);
  89. }
  90. /// <summary>
  91. /// 修改组织
  92. /// </summary>
  93. /// <param name="input"></param>
  94. /// <returns></returns>
  95. [HttpPost("edit")]
  96. [DisplayName("修改组织")]
  97. public async Task Edit([FromBody] SysOrgEditInput input)
  98. {
  99. await _sysOrgService.Edit(input);
  100. }
  101. /// <summary>
  102. /// 删除组织
  103. /// </summary>
  104. /// <param name="input"></param>
  105. /// <returns></returns>
  106. [HttpPost("delete")]
  107. [DisplayName("删除组织")]
  108. public async Task Delete([FromBody] BaseIdListInput input)
  109. {
  110. await _sysOrgService.Delete(input);
  111. }
  112. #endregion Post
  113. }