拉黑新增cp限制
This commit is contained in:
parent
62e9576d36
commit
43c79934f5
@ -211,6 +211,11 @@ public enum OtherErrorCode implements IResponseErrorCode {
|
||||
SIGN_IN_OPERATION_TOO_FREQUENT(3286, "Sign-in operation too frequent, please try again later"),
|
||||
|
||||
CONSECUTIVE_REWARD(3287, "Consecutive Check-in Reward!"),
|
||||
|
||||
/**
|
||||
* 请先取消cp关系
|
||||
*/
|
||||
CANCEL_CP_RELATION_FIRST(3288, "Please cancel the cp relationship first"),
|
||||
;
|
||||
|
||||
private final int code;
|
||||
|
||||
@ -10,14 +10,19 @@ import com.red.circle.other.infra.database.mongo.entity.live.RoomUserBlacklist;
|
||||
import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService;
|
||||
import com.red.circle.other.infra.database.mongo.service.live.RoomUserBlacklistService;
|
||||
import com.red.circle.other.infra.database.rds.entity.user.user.BaseInfo;
|
||||
import com.red.circle.other.infra.database.rds.entity.user.user.CpRelationship;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.BaseInfoService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.CpRelationshipService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.RelationshipFriendService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.ShieldBlackService;
|
||||
import com.red.circle.other.inner.asserts.OtherErrorCode;
|
||||
import com.red.circle.other.inner.enums.config.EnumConfigKey;
|
||||
import com.red.circle.other.inner.enums.live.RoomUserRolesEnum;
|
||||
import com.red.circle.tool.core.date.TimestampUtils;
|
||||
import com.red.circle.tool.core.text.StringUtils;
|
||||
import com.red.circle.other.inner.asserts.user.UserErrorCode;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -37,6 +42,7 @@ public class UserShieldBlackAddCmdExe {
|
||||
private final RoomUserBlacklistService roomUserBlacklistService;
|
||||
private final RoomProfileManagerService roomProfileManagerService;
|
||||
private final RelationshipFriendService relationshipFriendService;
|
||||
private final CpRelationshipService cpRelationshipService;
|
||||
|
||||
public void execute(UserShieldBlackUserCmd cmd) {
|
||||
|
||||
@ -47,6 +53,13 @@ public class UserShieldBlackAddCmdExe {
|
||||
StringUtils.isNotBlank(superAdminIds) && superAdminIds
|
||||
.contains(String.valueOf(cmd.getShieldUserId())));
|
||||
|
||||
List<CpRelationship> cpRelationshipList = cpRelationshipService.getByUserId(cmd.requiredReqUserId());
|
||||
List<CpRelationship> dismissing = cpRelationshipService.getDismissingByUserId(cmd.requiredReqUserId());
|
||||
cpRelationshipList.addAll(dismissing);
|
||||
|
||||
List<Long> cpUserIdList = cpRelationshipList.stream().map(CpRelationship::getCpUserId).toList();
|
||||
ResponseAssert.isFalse(OtherErrorCode.CANCEL_CP_RELATION_FIRST, cpUserIdList.contains(cmd.getShieldUserId()));
|
||||
|
||||
// 拉黑用户
|
||||
shieldBlackService.saveShieldBlack(cmd.requiredReqUserId()
|
||||
, cmd.getShieldUserId());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user