|
@@ -33,6 +33,11 @@ using Microsoft.Extensions.Caching.Distributed;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using GxPress.Service.Interface.Department;
|
|
|
+using GxPress.Request.UserMiddle;
|
|
|
+using GxPress.Service.Interface.UserMiddle;
|
|
|
+using System.Linq;
|
|
|
+using AutoMapper;
|
|
|
+
|
|
|
namespace GxPress.Api.WebControllers
|
|
|
{
|
|
|
/// <summary>
|
|
@@ -57,9 +62,11 @@ namespace GxPress.Api.WebControllers
|
|
|
private readonly IAddressBookGroupUserRepository _addressBookGroupUserRepository;
|
|
|
private readonly IFeedbackRepository _feedbackRepository;
|
|
|
private readonly IFriendsRepository friendsRepository;
|
|
|
+ private readonly IUserMiddleService userMiddleService;
|
|
|
+ private readonly IMapper _mapper;
|
|
|
public UserController(IUserRepository userRepository, IOptions<JwtOptions> jwtOptions,
|
|
|
ILogger<UserController> logger, IDepartmentRepository departmentRepository, ILoginContext loginContext,
|
|
|
- IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository, IFeedbackRepository _feedbackRepository, IFriendsRepository friendsRepository, IDepartmentService departmentService)
|
|
|
+ IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository, IFeedbackRepository _feedbackRepository, IFriendsRepository friendsRepository, IDepartmentService departmentService, IUserMiddleService userMiddleService,IMapper _mapper)
|
|
|
{
|
|
|
_userRepository = userRepository;
|
|
|
_departmentRepository = departmentRepository;
|
|
@@ -75,6 +82,8 @@ namespace GxPress.Api.WebControllers
|
|
|
this._feedbackRepository = _feedbackRepository;
|
|
|
this.friendsRepository = friendsRepository;
|
|
|
this.departmentService = departmentService;
|
|
|
+ this.userMiddleService = userMiddleService;
|
|
|
+ this._mapper=_mapper;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 登录
|
|
@@ -513,5 +522,22 @@ namespace GxPress.Api.WebControllers
|
|
|
request.UserId = _loginContext.AccountId;
|
|
|
return await _userService.GetGroupOrGroupChatUserInfosResult(request);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 获取用户列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="userMiddles">来源类型 1:通知收件人 2:通知抄送人 3:站内信收集人 4:站内信抄送人 5:话题 6:笔记共享文件夹 7:收藏共享文件夹 </param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("user-middle")]
|
|
|
+ public async Task<List<UserInfoResult>> FindUsersAsync(UserMiddles userMiddles)
|
|
|
+ {
|
|
|
+ var model = await userMiddleService.FindUsersAsync(userMiddles.Item, _loginContext.AccountId);
|
|
|
+ var result = model.Select(n => _mapper.Map<UserInfoResult>(n)).ToList();
|
|
|
+ foreach (var item in result)
|
|
|
+ {
|
|
|
+ item.TypeId = 0;
|
|
|
+ item.TypeValue = 0;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
}
|