IUserRepository.cs 9.7 KB

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