|
@@ -13,6 +13,7 @@ using GxPress.Common.Validation;
|
|
using GxPress.Entity;
|
|
using GxPress.Entity;
|
|
using GxPress.EnumConst;
|
|
using GxPress.EnumConst;
|
|
using GxPress.Repository.Interface;
|
|
using GxPress.Repository.Interface;
|
|
|
|
+using GxPress.Repository.Interface.Friends;
|
|
using GxPress.Request.AddressBookGroup;
|
|
using GxPress.Request.AddressBookGroup;
|
|
using GxPress.Request.AddressBookGroupUser;
|
|
using GxPress.Request.AddressBookGroupUser;
|
|
using GxPress.Request.App.User;
|
|
using GxPress.Request.App.User;
|
|
@@ -53,11 +54,11 @@ namespace GxPress.Api.WebControllers
|
|
private readonly IUserLoginRepository userLoginRepository;
|
|
private readonly IUserLoginRepository userLoginRepository;
|
|
private readonly IAddressBookGroupRepository addressBookGroupRepository;
|
|
private readonly IAddressBookGroupRepository addressBookGroupRepository;
|
|
private readonly IAddressBookGroupUserRepository _addressBookGroupUserRepository;
|
|
private readonly IAddressBookGroupUserRepository _addressBookGroupUserRepository;
|
|
-
|
|
|
|
private readonly IFeedbackRepository _feedbackRepository;
|
|
private readonly IFeedbackRepository _feedbackRepository;
|
|
|
|
+ private readonly IFriendsRepository friendsRepository;
|
|
public UserController(IUserRepository userRepository, IOptions<JwtOptions> jwtOptions,
|
|
public UserController(IUserRepository userRepository, IOptions<JwtOptions> jwtOptions,
|
|
ILogger<UserController> logger, IDepartmentRepository departmentRepository, ILoginContext loginContext,
|
|
ILogger<UserController> logger, IDepartmentRepository departmentRepository, ILoginContext loginContext,
|
|
- IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository, IFeedbackRepository _feedbackRepository)
|
|
|
|
|
|
+ IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository, IFeedbackRepository _feedbackRepository, IFriendsRepository friendsRepository)
|
|
{
|
|
{
|
|
_userRepository = userRepository;
|
|
_userRepository = userRepository;
|
|
_departmentRepository = departmentRepository;
|
|
_departmentRepository = departmentRepository;
|
|
@@ -71,6 +72,7 @@ namespace GxPress.Api.WebControllers
|
|
this.addressBookGroupRepository = addressBookGroupRepository;
|
|
this.addressBookGroupRepository = addressBookGroupRepository;
|
|
this._addressBookGroupUserRepository = _addressBookGroupUserRepository;
|
|
this._addressBookGroupUserRepository = _addressBookGroupUserRepository;
|
|
this._feedbackRepository = _feedbackRepository;
|
|
this._feedbackRepository = _feedbackRepository;
|
|
|
|
+ this.friendsRepository = friendsRepository;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 登录
|
|
/// 登录
|
|
@@ -478,5 +480,15 @@ namespace GxPress.Api.WebControllers
|
|
{
|
|
{
|
|
return await _userService.FindUserInfoNoFriendsResultAsync(_loginContext.AccountId, keyword);
|
|
return await _userService.FindUserInfoNoFriendsResultAsync(_loginContext.AccountId, keyword);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 删除我的好友
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpDelete("friends")]
|
|
|
|
+ public async Task<bool> DeleteAsync(IEnumerable<int> friendsIds)
|
|
|
|
+ {
|
|
|
|
+ return await friendsRepository.DeleteAsync(friendsIds, _loginContext.AccountId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|