namespace SafeCampus.Web.Core; /// /// 人员管理控制器 /// [ApiDescriptionSettings("Application", Tag = "人员管理")] [Route("biz/organization/user")] [RolePermission] public class BizUserController : IDynamicApiController { private readonly IUserService _userService; private readonly IOrgService _orgService; private readonly IPositionService _positionService; public BizUserController(IUserService userService, IOrgService orgService, IPositionService positionService) { _userService = userService; _orgService = orgService; _positionService = positionService; } #region Get请求 /// /// 导入预览 /// /// /// [HttpPost("preview")] [DisableRequestSizeLimit] [SuppressMonitor] [DisplayName("导入预览")] public async Task Preview([FromForm] ImportPreviewInput input) { return await _userService.Preview(input); } /// /// 模板下载 /// /// [HttpGet(template: "template")] [SuppressMonitor] public async Task Template() { return await _userService.Template(); } /// /// 人员分页查询 /// /// /// [HttpGet("page")] [DisplayName("人员分页查询")] public async Task Page([FromQuery] UserPageInput input) { return await _userService.Page(input); } /// /// 获取人员选择器 /// /// [HttpGet("selector")] [DisplayName("人员选择器")] public async Task Selector([FromQuery] UserSelectorInput input) { return await _userService.Selector(input); } /// /// 获取人员拥有角色 /// /// /// [HttpGet("ownRole")] [DisplayName("获取人员拥有角色")] public async Task OwnRole([FromQuery] BaseIdInput input) { return await _userService.OwnRole(input); } /// /// 人员详情 /// /// /// [HttpGet("detail")] [DisplayName("人员详情")] public async Task Detail([FromQuery] BaseIdInput input) { return await _userService.Detail(input); } #endregion Get请求 #region Post请求 /// /// 添加人员 /// /// /// [HttpPost("add")] [DisplayName("添加人员")] public async Task Add([FromBody] UserAddInput input) { await _userService.Add(input); } /// /// 修改人员 /// /// /// [HttpPost("edit")] [DisplayName("修改人员")] public async Task Edit([FromBody] UserEditInput input) { await _userService.Edit(input); } /// /// 批量修改人员 /// /// /// [HttpPost("edits")] [DisplayName("批量修改人员")] public async Task Edits([FromBody] BatchEditInput input) { await _userService.Edits(input); } /// /// 删除人员 /// /// /// [HttpPost("delete")] [DisplayName("删除人员")] public async Task Delete([FromBody] BaseIdListInput input) { await _userService.Delete(input); } /// /// 禁用人员 /// /// /// [HttpPost("disableUser")] [DisplayName("禁用人员")] public async Task DisableUser([FromBody] BaseIdInput input) { await _userService.DisableUser(input); } /// /// 启用人员 /// /// /// [HttpPost("enableUser")] [DisplayName("启用人员")] public async Task EnableUser([FromBody] BaseIdInput input) { await _userService.EnableUser(input); } /// /// 重置密码 /// /// /// [HttpPost("resetPassword")] [DisplayName("重置密码")] public async Task ResetPassword([FromBody] BaseIdInput input) { await _userService.ResetPassword(input); } /// /// 给人员授权角色 /// /// /// [HttpPost("grantRole")] [DisplayName("授权角色")] public async Task GrantRole([FromBody] UserGrantRoleInput input) { await _userService.GrantRole(input); } /// /// 人员导入 /// /// /// [HttpPost("import")] [DisplayName("人员导入")] public async Task Import([SuppressMonitor][FromBody] ImportResultInput input) { return await _userService.Import(input); } /// /// 人员导出 /// /// /// [HttpPost("export")] [DisplayName("人员导出")] public async Task Export([FromBody] UserPageInput input) { return await _userService.Export(input); } #endregion Post请求 }