IUserRepository.cs 7.8 KB

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