拉黑人数减少处理
This commit is contained in:
parent
cb961a8edb
commit
c953fd6869
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|||||||
import com.red.circle.framework.core.asserts.ResponseAssert;
|
import com.red.circle.framework.core.asserts.ResponseAssert;
|
||||||
import com.red.circle.framework.core.response.CommonErrorCode;
|
import com.red.circle.framework.core.response.CommonErrorCode;
|
||||||
import com.red.circle.other.app.dto.cmd.user.user.UserShieldBlackUserCmd;
|
import com.red.circle.other.app.dto.cmd.user.user.UserShieldBlackUserCmd;
|
||||||
|
import com.red.circle.other.domain.gateway.user.ability.UserRelationsCalculatorGateway;
|
||||||
|
import com.red.circle.other.domain.model.user.ability.UserRelationsCalculator;
|
||||||
import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService;
|
import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService;
|
||||||
import com.red.circle.other.infra.database.mongo.entity.live.RoomProfile;
|
import com.red.circle.other.infra.database.mongo.entity.live.RoomProfile;
|
||||||
import com.red.circle.other.infra.database.mongo.entity.live.RoomUserBlacklist;
|
import com.red.circle.other.infra.database.mongo.entity.live.RoomUserBlacklist;
|
||||||
@ -41,6 +43,7 @@ public class UserShieldBlackAddCmdExe {
|
|||||||
private final RelationshipFriendService relationshipFriendService;
|
private final RelationshipFriendService relationshipFriendService;
|
||||||
private final CpRelationshipService cpRelationshipService;
|
private final CpRelationshipService cpRelationshipService;
|
||||||
private final UserSubscriptionService userSubscriptionService;
|
private final UserSubscriptionService userSubscriptionService;
|
||||||
|
private final UserRelationsCalculatorGateway userRelationsCalculatorGateway;
|
||||||
|
|
||||||
public void execute(UserShieldBlackUserCmd cmd) {
|
public void execute(UserShieldBlackUserCmd cmd) {
|
||||||
|
|
||||||
@ -62,11 +65,12 @@ public class UserShieldBlackAddCmdExe {
|
|||||||
shieldBlackService.saveShieldBlack(cmd.requiredReqUserId()
|
shieldBlackService.saveShieldBlack(cmd.requiredReqUserId()
|
||||||
, cmd.getShieldUserId());
|
, cmd.getShieldUserId());
|
||||||
|
|
||||||
relationshipFriendService.removeFriend(cmd.requiredReqUserId(), cmd.getShieldUserId());
|
|
||||||
relationshipFriendService.removeFriend(cmd.getShieldUserId(), cmd.requiredReqUserId());
|
|
||||||
|
|
||||||
userSubscriptionService.remove(cmd.requiredReqUserId(), cmd.getShieldUserId());
|
Long reqUserId = cmd.requiredReqUserId();
|
||||||
userSubscriptionService.remove(cmd.getShieldUserId(), cmd.requiredReqUserId());
|
Long shieldUserId = cmd.getShieldUserId();
|
||||||
|
// 取消关注并删除好友
|
||||||
|
cancelSubAndRmFriend(reqUserId, shieldUserId);
|
||||||
|
cancelSubAndRmFriend(shieldUserId, reqUserId);
|
||||||
|
|
||||||
// 拉黑房间
|
// 拉黑房间
|
||||||
BaseInfo beBlackUser = baseInfoService.getById(cmd.getShieldUserId());
|
BaseInfo beBlackUser = baseInfoService.getById(cmd.getShieldUserId());
|
||||||
@ -89,4 +93,22 @@ public class UserShieldBlackAddCmdExe {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cancelSubAndRmFriend(Long reqUserId, Long shieldUserId) {
|
||||||
|
userSubscriptionService.remove(reqUserId, shieldUserId);
|
||||||
|
userRelationsCalculatorGateway.process(new UserRelationsCalculator()
|
||||||
|
.setUserId(reqUserId)
|
||||||
|
.setSubUserId(shieldUserId)
|
||||||
|
.setIncr(Boolean.FALSE)
|
||||||
|
.setType(UserRelationsCalculator.CounterEnum.SUBSCRIPTION)
|
||||||
|
);
|
||||||
|
|
||||||
|
relationshipFriendService.removeFriend(reqUserId, shieldUserId);
|
||||||
|
userRelationsCalculatorGateway.process(new UserRelationsCalculator()
|
||||||
|
.setUserId(reqUserId)
|
||||||
|
.setSubUserId(shieldUserId)
|
||||||
|
.setIncr(Boolean.FALSE)
|
||||||
|
.setType(UserRelationsCalculator.CounterEnum.FRIEND)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user