cp 申请 不同区域不可操作
This commit is contained in:
parent
4f1e0b8be1
commit
d6feab886c
@ -62,6 +62,11 @@ public enum UserRelationErrorCode implements IResponseErrorCode {
|
|||||||
*/
|
*/
|
||||||
CP_LIMIT_EXCEEDED(4311, "CP limit exceeded, maximum 4 CPs allowed"),
|
CP_LIMIT_EXCEEDED(4311, "CP limit exceeded, maximum 4 CPs allowed"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不同区域不可操作.
|
||||||
|
*/
|
||||||
|
UNAVAILABLE_NOT_REGION(4312, "Unavailable to operate not same region"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import com.red.circle.other.app.convertor.user.UserProfileAppConvertor;
|
|||||||
import com.red.circle.other.app.dto.cmd.user.relation.cp.CpApplyCmd;
|
import com.red.circle.other.app.dto.cmd.user.relation.cp.CpApplyCmd;
|
||||||
import com.red.circle.other.app.util.OfficialNoticeUtils;
|
import com.red.circle.other.app.util.OfficialNoticeUtils;
|
||||||
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
||||||
|
import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway;
|
||||||
import com.red.circle.other.domain.model.user.UserProfile;
|
import com.red.circle.other.domain.model.user.UserProfile;
|
||||||
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.rds.entity.user.user.CpApply;
|
import com.red.circle.other.infra.database.rds.entity.user.user.CpApply;
|
||||||
@ -54,6 +55,7 @@ public class SendCpApplyCmdExe {
|
|||||||
private final EnumConfigCacheService enumConfigCacheService;
|
private final EnumConfigCacheService enumConfigCacheService;
|
||||||
private final UserProfileGateway userProfileGateway;
|
private final UserProfileGateway userProfileGateway;
|
||||||
private final UserProfileAppConvertor userProfileAppConvertor;
|
private final UserProfileAppConvertor userProfileAppConvertor;
|
||||||
|
private final UserRegionGateway userRegionGateway;
|
||||||
|
|
||||||
public void execute(CpApplyCmd cmd) {
|
public void execute(CpApplyCmd cmd) {
|
||||||
|
|
||||||
@ -61,6 +63,9 @@ public class SendCpApplyCmdExe {
|
|||||||
ResponseAssert.isFalse(UserRelationErrorCode.UNAVAILABLE_OPS_YOURSELF,
|
ResponseAssert.isFalse(UserRelationErrorCode.UNAVAILABLE_OPS_YOURSELF,
|
||||||
Objects.equals(cmd.requiredReqUserId(), cmd.getAcceptApplyUserId()));
|
Objects.equals(cmd.requiredReqUserId(), cmd.getAcceptApplyUserId()));
|
||||||
|
|
||||||
|
boolean eqRegion = userRegionGateway.checkEqRegion(cmd.requiredReqUserId(), cmd.getAcceptApplyUserId());
|
||||||
|
ResponseAssert.isTrue(UserRelationErrorCode.UNAVAILABLE_NOT_REGION, eqRegion);
|
||||||
|
|
||||||
// 检查是否是复合申请
|
// 检查是否是复合申请
|
||||||
CpRelationship dismissingCp = cpRelationshipService.getDismissingCp(
|
CpRelationship dismissingCp = cpRelationshipService.getDismissingCp(
|
||||||
cmd.requiredReqUserId(), cmd.getAcceptApplyUserId());
|
cmd.requiredReqUserId(), cmd.getAcceptApplyUserId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user