验证是否是好友 校验开放增加客服人员
This commit is contained in:
parent
69ada2534f
commit
cbc975eef9
@ -1,8 +1,12 @@
|
||||
package com.red.circle.other.app.command.user.query;
|
||||
|
||||
import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd;
|
||||
import com.red.circle.other.infra.database.mongo.entity.sys.CustomerServiceConfig;
|
||||
import com.red.circle.other.infra.database.mongo.service.sys.CustomerServiceConfigService;
|
||||
import com.red.circle.other.infra.database.rds.service.sys.AdministratorService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.RelationshipFriendService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -19,6 +23,7 @@ public class FriendCheckQryExe {
|
||||
|
||||
private final AdministratorService administratorService;
|
||||
private final RelationshipFriendService relationshipFriendService;
|
||||
private final CustomerServiceConfigService customerServiceConfigService;
|
||||
|
||||
public Boolean execute(AppUserIdCmd cmd) {
|
||||
Boolean isAdmin = administratorService.existsAvailable(
|
||||
@ -28,6 +33,12 @@ public class FriendCheckQryExe {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
List<CustomerServiceConfig> configList = customerServiceConfigService.list(cmd.getReqSysOrigin().getOrigin(), "");
|
||||
boolean match = configList.stream().anyMatch(c -> c.getUserId().equals(cmd.getUserId()) || c.getUserId().equals(cmd.getReqUserId()));
|
||||
if (match) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
return relationshipFriendService
|
||||
.checkFriend(cmd.requiredReqUserId(), cmd.getUserId());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user