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

133 lines
3.1 KiB

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