IDepartmentUserRepository.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using Datory;
  4. using GxPress.Request.Department;
  5. namespace GxPress.Repository.Interface.DepartmentUser
  6. {
  7. public interface IDepartmentUserRepository : IRepository
  8. {
  9. /// <summary>
  10. /// 根据部门ID获取用户
  11. /// </summary>
  12. /// <param name="departmentId"></param>
  13. /// <returns></returns>
  14. Task<IEnumerable<int>> GetUserIdsAsync(int departmentId);
  15. /// <summary>
  16. /// 添加部门成员
  17. /// </summary>
  18. /// <param name="request"></param>
  19. /// <returns></returns>
  20. Task<bool> AddDepartmentUserAsync(DepartmentUserInRequest request);
  21. /// <summary>
  22. /// 添加部门成员
  23. /// </summary>
  24. /// <param name="request"></param>
  25. /// <returns></returns>
  26. Task<bool> AddDepartmentUserAsync(IEnumerable<int> departmentIds, int userId);
  27. /// <summary>
  28. /// 根据用户D获取部门ID
  29. /// </summary>
  30. /// <param name="departmentId"></param>
  31. /// <returns></returns>
  32. Task<IEnumerable<int>> GetDepartmentIdsAsync(int userId);
  33. /// <summary>
  34. /// 获取部门下面的所有用户
  35. /// </summary>
  36. /// <param name="departmentId"></param>
  37. /// <returns></returns>
  38. Task<IEnumerable<int>> GetUserIdsAsync();
  39. /// <summary>
  40. /// 判断是否有部门
  41. /// </summary>
  42. /// <param name="userId"></param>
  43. /// <returns></returns>
  44. Task<bool> IsExistsAsync(int userId);
  45. /// <summary>
  46. /// 根据部门ID集合获取用户
  47. /// </summary>
  48. /// <param name="departmentId"></param>
  49. /// <returns></returns>
  50. Task<IEnumerable<int>> GetUserIdsAsync(IEnumerable<int> departmentIds);
  51. /// <summary>
  52. /// 根据部门ID获取部门下面的所有用户
  53. /// </summary>
  54. /// <param name="departmentIds"></param>
  55. /// <returns></returns>
  56. Task<IEnumerable<int>> GetUserIdsByDepartmentIdsAsync(IEnumerable<int> departmentIds);
  57. /// <summary>
  58. /// 根据用户id获取所在部门
  59. /// </summary>
  60. /// <param name="userIds"></param>
  61. /// <returns></returns>
  62. Task<IEnumerable<Entity.DepartmentUser>> GetDepartmentUsersByUserIdsAsync(IEnumerable<int> userIds);
  63. /// <summary>
  64. /// 根据用户ID获取部门下面的用户
  65. /// </summary>
  66. /// <param name="departmentId"></param>
  67. /// <returns></returns>
  68. Task<IEnumerable<int>> GetUserIdsByUserIdAsync(int userId);
  69. }
  70. }