IUserRepository.cs 8.8 KB

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