基础服务api
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.
 
 

109 lines
3.3 KiB

  1. using BPA.SAAS.Manage.Application.Org.Dtos.Users;
  2. using BPA.SAAS.Manage.Application.Org.Interface;
  3. using BPA.SAAS.Manage.Core.Base;
  4. using BPA.SAAS.Manage.Core.Org;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPA.SAAS.Manage.Application.Org
  11. {
  12. [ApiDescriptionSettings("Org", Tag = "用户账号信息")]
  13. public class UserServices: IDynamicApiController
  14. {
  15. IUserService _userService;
  16. public UserServices(IUserService userService)
  17. {
  18. _userService=userService;
  19. }
  20. [HttpPost("/api/user/userpage")]
  21. public async Task<PageUtil> UserPage(UserDtoPageInput input)
  22. {
  23. return await _userService.UserPage(input);
  24. }
  25. [HttpPost("/api/user/add")]
  26. public async Task<bool> AddUser(UserDtoInput input)
  27. {
  28. return await _userService.AddUser(input);
  29. }
  30. [HttpPost("/api/user/update")]
  31. public async Task<bool> UpdateUser(UserDtoInput input)
  32. {
  33. return await _userService.UpdateUser(input);
  34. }
  35. /// <summary>
  36. /// 删除
  37. /// </summary>
  38. /// <param name="input"></param>
  39. /// <returns></returns>
  40. [HttpPost("/api/user/delete")]
  41. public async Task<bool> DeleteUser(List<string> input)
  42. {
  43. return await _userService.DeleteUser(input);
  44. }
  45. /// <summary>
  46. /// 启用
  47. /// </summary>
  48. /// <param name="Id"></param>
  49. /// <returns></returns>
  50. [HttpGet("/api/user/enable")]
  51. public async Task<bool> Enable(string Id)
  52. {
  53. return await _userService.Enable(Id);
  54. }
  55. /// <summary>
  56. /// 禁用
  57. /// </summary>
  58. /// <param name="Id"></param>
  59. /// <returns></returns>
  60. [HttpGet("/api/user/disable")]
  61. public async Task<bool> Disable(string Id)
  62. {
  63. return await _userService.Disable(Id);
  64. }
  65. /// <summary>
  66. /// 重置密码
  67. /// </summary>
  68. /// <param name="Id"></param>
  69. /// <returns></returns>
  70. [HttpGet("/api/user/resetuserpwd")]
  71. public async Task<bool> ResetPwd(string Id)
  72. {
  73. return await _userService.ResetPwd(Id);
  74. }
  75. /// <summary>
  76. /// 变更密码
  77. /// </summary>
  78. /// <param name="input"></param>
  79. /// <returns></returns>
  80. [HttpPost("/api/user/updatepwd")]
  81. public async Task<bool> UpdatePwd(UserPwdDtoInput input)
  82. {
  83. return await _userService.UpdatePwd(input);
  84. }
  85. /// <summary>
  86. /// 获取当前用户的角色
  87. /// </summary>
  88. /// <param name="UserId"></param>
  89. /// <returns></returns>
  90. [HttpGet("/api/user/getuserrole")]
  91. public async Task<UserRoleDtoInput> GetUserRole(string UserId)
  92. {
  93. return await _userService.GetUserRole(UserId);
  94. }
  95. /// <summary>
  96. /// 新增用户角色
  97. /// </summary>
  98. /// <param name="input"></param>
  99. /// <returns></returns>
  100. [HttpPost("/api/user/adduserrole")]
  101. public async Task<bool> AddUserRole(UserRoleDtoInput input)
  102. {
  103. return await _userService.AddUserRole(input);
  104. }
  105. }
  106. }