|
@@ -13,10 +13,16 @@ using GxPress.Common.Validation;
|
|
|
using GxPress.Entity;
|
|
|
using GxPress.EnumConst;
|
|
|
using GxPress.Repository.Interface;
|
|
|
+using GxPress.Request.AddressBookGroup;
|
|
|
+using GxPress.Request.AddressBookGroupUser;
|
|
|
using GxPress.Request.App.User;
|
|
|
+using GxPress.Request.Department;
|
|
|
using GxPress.Request.User;
|
|
|
+using GxPress.Result.AddressBook;
|
|
|
+using GxPress.Result.AddressBookGroupUser;
|
|
|
using GxPress.Result.App.FileLibrary;
|
|
|
using GxPress.Result.App.User;
|
|
|
+using GxPress.Result.Department;
|
|
|
using GxPress.Result.User;
|
|
|
using GxPress.Service.Interface;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
@@ -44,9 +50,11 @@ namespace GxPress.Api.WebControllers
|
|
|
private readonly IFileLibraryRepository fileLibraryRepository;
|
|
|
private readonly IDistributedCache _cache;
|
|
|
private readonly IUserLoginRepository userLoginRepository;
|
|
|
+ private readonly IAddressBookGroupRepository addressBookGroupRepository;
|
|
|
+ private readonly IAddressBookGroupUserRepository _addressBookGroupUserRepository;
|
|
|
public UserController(IUserRepository userRepository, IOptions<JwtOptions> jwtOptions,
|
|
|
ILogger<UserController> logger, IDepartmentRepository departmentRepository, ILoginContext loginContext,
|
|
|
- IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository)
|
|
|
+ IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository)
|
|
|
{
|
|
|
_userRepository = userRepository;
|
|
|
_departmentRepository = departmentRepository;
|
|
@@ -57,6 +65,8 @@ namespace GxPress.Api.WebControllers
|
|
|
this.fileLibraryRepository = fileLibraryRepository;
|
|
|
_cache = cache;
|
|
|
this.userLoginRepository = userLoginRepository;
|
|
|
+ this.addressBookGroupRepository = addressBookGroupRepository;
|
|
|
+ this._addressBookGroupUserRepository = _addressBookGroupUserRepository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 登录
|
|
@@ -395,5 +405,39 @@ namespace GxPress.Api.WebControllers
|
|
|
{
|
|
|
return await fileLibraryRepository.GetFileLibraryByUserIdAsync(_loginContext.AccountId);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 获取用户通讯录组
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("list-group")]
|
|
|
+ public async Task<AddressBookListResult> GetAddressBookList()
|
|
|
+ {
|
|
|
+ var request = new AddressBookListRequest { UserId = _loginContext.AccountId };
|
|
|
+ return await addressBookGroupRepository.GetAddressBookListAsync(request);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取自建用户
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("list")]
|
|
|
+ public async Task<AddressBookGroupUserListResult> GetAddressBookGroupUserList(
|
|
|
+ AddressBookGroupUserSearchRequest request)
|
|
|
+ {
|
|
|
+ var userId = _loginContext.AccountId;
|
|
|
+ return await _addressBookGroupUserRepository.GetAddressBookGroupUserListAsync(request, userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据部门ID获取成员以及下级部门
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("user-list")]
|
|
|
+ public async Task<DepartmentUserResult> GetDepartmentUserResult(DepartmentUserRequest request)
|
|
|
+ {
|
|
|
+ return await _departmentRepository.GetDepartmentUserResultAsync(request);
|
|
|
+ }
|
|
|
}
|
|
|
}
|