IUserRepository.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Common.Page;
  4. using GxPress.Entity;
  5. using GxPress.Request.User;
  6. using GxPress.Result.User;
  7. using Datory;
  8. using GxPress.Result.App.User;
  9. using GxPress.Result.Job;
  10. namespace GxPress.Repository.Interface
  11. {
  12. public interface IUserRepository : IRepository
  13. {
  14. Task<User> GetAsync(int id);
  15. Task<User> GetAsync(SqlKata.Query query);
  16. Task<UserDetail> GetDetailAsync(int id);
  17. Task<string> GetNameAsync(int id);
  18. Task<string> GetAvatarUrlAsync(int id);
  19. string GetAvatarUrl(User user);
  20. Task<User> GetByPhoneAsync(string phone);
  21. Task<bool> DeleteUsersAsync(IEnumerable<int> userIds);
  22. Task<bool> ChangeRoleAsync(IEnumerable<int> userIds, int roleId);
  23. Task<bool> ChangeDepartmentAsync(IEnumerable<int> userIds, int department);
  24. Task<bool> UpdateAsync(User user);
  25. Task<bool> UpdateAsync(SqlKata.Query query);
  26. Task<int> GetCountAsync(int departmentId, int roleId, string keyword);
  27. /// <summary>
  28. /// Set the limit and offset for a given page.
  29. /// </summary>
  30. /// <param name="page"></param>
  31. /// <param name="perPage"></param>
  32. /// <param name="departmentId"></param>
  33. /// <param name="roleId"></param>
  34. /// <param name="keyword"></param>
  35. /// <returns></returns>
  36. Task<IEnumerable<User>> GetPageListAsync(int page, int perPage, int departmentId, int roleId, string keyword);
  37. /// <summary>
  38. /// 登录
  39. /// </summary>
  40. /// <param name="request"></param>
  41. /// <returns></returns>
  42. Task<UserSignInResult> SignInAsync(UserSignInRequest request);
  43. Task<int> InsertAsync(User user);
  44. /// <summary>
  45. /// 删除用户
  46. /// </summary>
  47. /// <param name="id"></param>
  48. /// <returns></returns>
  49. Task<bool> DeleteAsync(int id);
  50. /// <summary>
  51. /// 更新用户信息
  52. /// </summary>
  53. /// <param name="id"></param>
  54. /// <param name="request"></param>
  55. /// <returns></returns>
  56. Task<bool> UpdateAsync(int id, UserInfoRequest request);
  57. /// <summary>
  58. /// 用户分页列表
  59. /// </summary>
  60. /// <param name="request"></param>
  61. /// <returns></returns>
  62. Task<PagedList<UserResult>> GetPagedListAsync(UserPageSearchRequest request);
  63. Task<List<UserResult>> GetListAsync(ArticleSearchRequest request);
  64. /// <summary>
  65. /// 更新excel用户数据
  66. /// </summary>
  67. /// <param name="request"></param>
  68. /// <returns></returns>
  69. Task<bool> UpdateUserExcelAsync(List<User> request);
  70. /// <summary>
  71. /// 更新用户是否接收私信
  72. /// </summary>
  73. /// <param name="request"></param>
  74. /// <returns></returns>
  75. Task<bool> UpdateUserPrivateLetterAsync(UserPrivateLetterRequest request);
  76. /// <summary>
  77. /// 更新用户是否接收通知
  78. /// </summary>
  79. Task<bool> UpdateUserNoticeAsync(UserNoticeRequest request);
  80. /// <summary>
  81. /// 更新用户是否接收回复
  82. /// </summary>
  83. Task<bool> UpdateUserReplyAsync(UserReplyRequest request);
  84. /// <summary>
  85. /// 更新用户是否静音
  86. /// </summary>
  87. Task<bool> UpdateUserMuteAsync(UserMuteRequest request);
  88. /// <summary>
  89. /// 更新用户是否震动
  90. /// </summary>
  91. Task<bool> UpdateUserShakeAsync(UserShakeRequest request);
  92. /// <summary>
  93. /// 修改用户手机号码
  94. /// </summary>
  95. /// <param name="request"></param>
  96. /// <returns></returns>
  97. Task<bool> UpdateUserPhoneAsync(UserUpdatePhoneRequest request);
  98. /// <summary>
  99. /// 用户邮箱验证
  100. /// </summary>
  101. /// <param name="request"></param>
  102. /// <returns></returns>
  103. Task<bool> SendEmailVerifyCodeAsync(UserEmailVerifyCodeRequest request);
  104. /// <summary>
  105. /// 用户修改密码
  106. /// </summary>
  107. /// <param name="request"></param>
  108. /// <returns></returns>
  109. Task<bool> UpdateUserEmailAsync(UserUpdateEmailRequest request);
  110. /// <summary>
  111. /// 根据部门ID获取下面的用户
  112. /// </summary>
  113. /// <param name="departmentId"></param>
  114. /// <returns></returns>
  115. Task<IEnumerable<User>> GetUserByDepartmentIdAsync(int departmentId);
  116. /// <summary>
  117. /// 根据部门ID获取下面的用户ID
  118. /// </summary>
  119. /// <param name="departmentId"></param>
  120. /// <returns></returns>
  121. Task<IEnumerable<int>> GetUserIdListByDepartmentIdAsync(int departmentId);
  122. /// <summary>
  123. /// 根据角色ID获取下面的用户ID
  124. /// </summary>
  125. /// <param name="roleId"></param>
  126. /// <returns></returns>
  127. Task<IEnumerable<int>> GetUserIdListByRoleIdAsync(int roleId);
  128. /// <summary>
  129. /// 创建环信用户
  130. /// </summary>
  131. /// <param name="request"></param>
  132. /// <returns></returns>
  133. Task<bool> CreateMiUserAsync(User request);
  134. /// <summary>
  135. /// 模糊搜索用户
  136. /// </summary>
  137. /// <param name="request"></param>
  138. /// <returns></returns>
  139. Task<IEnumerable<UserInfoResult>> SearchUserNameAsync(SearchUserNameRequest request);
  140. /// <summary>
  141. /// 获取用户
  142. /// </summary>
  143. /// <returns></returns>
  144. Task<IEnumerable<User>> FindAllUserAsync(SqlKata.Query query);
  145. /// <summary>
  146. /// 根据GUID获取用户信息
  147. /// </summary>
  148. /// <param name="guid"></param>
  149. /// <returns></returns>
  150. Task<UserDetail> GetGuidAsync(string guid);
  151. Task<int> CountAsync(SqlKata.Query query);
  152. Task<IEnumerable<User>> GetAllAsync(SqlKata.Query query);
  153. /// <summary>
  154. /// 根据ID集合查询用户
  155. /// </summary>
  156. /// <param name="ids"></param>
  157. /// <returns></returns>
  158. Task<IEnumerable<User>> UserListInsAsync(List<int> ids);
  159. /// <summary>
  160. /// 获取用户未读数据
  161. /// </summary>
  162. /// <param name="userId"></param>
  163. /// <returns></returns>
  164. Task<UserCountResult> GetUserCountAsync(int userId);
  165. /// <summary>
  166. /// 获取工作用户选择审核和抄送人
  167. /// </summary>
  168. /// <param name="userIds"></param>
  169. /// <param name="flowId"></param>
  170. /// <returns></returns>
  171. Task<List<Entity.User>> GeFlowUsers(List<int> userIds, int flowId, string type);
  172. Task<List<JobUserResult>> ElasticSearchUser();
  173. /// <summary>
  174. /// 根据姓名查询用户
  175. /// </summary>
  176. /// <param name="name"></param>
  177. /// <returns></returns>
  178. Task<IEnumerable<UserInfoResult>> UserByNameAsync(string name);
  179. /// <summary>
  180. /// openId微信认证
  181. /// </summary>
  182. /// <param name="openId"></param>
  183. /// /// <returns></returns>
  184. Task<User> GetByOpenIdAsync(string openId);
  185. /// <summary>
  186. /// 绑定微信
  187. /// </summary>
  188. /// <param name="request"></param>
  189. /// <returns></returns>
  190. Task<bool> UpdateByOpendIdAsync(UserSignInRequest request);
  191. /// <summary>
  192. /// vip用户
  193. /// </summary>
  194. /// <param name="request"></param>
  195. /// <returns></returns>
  196. Task<PagedList<UserDetail>> GetUserVipDetail(UserSearchVipRequest request);
  197. Task<bool> UpdateDisableAsync(UserUpdateDisableRequest request);
  198. }
  199. }