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

OrgController.cs 3.0 KiB

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