处理cp申请校验数量
This commit is contained in:
parent
d6feab886c
commit
005776a9f0
@ -70,6 +70,12 @@ public class ProcessCpApplyCmd {
|
|||||||
// 非复合申请:CP已存在
|
// 非复合申请:CP已存在
|
||||||
ResponseAssert.isFalse(UserRelationErrorCode.ME_OR_YOU_CP_EXISTED,
|
ResponseAssert.isFalse(UserRelationErrorCode.ME_OR_YOU_CP_EXISTED,
|
||||||
cpRelationshipService.existsCp(cpApply.getSendApplyUserId(), cpApply.getAcceptApplyUserId()));
|
cpRelationshipService.existsCp(cpApply.getSendApplyUserId(), cpApply.getAcceptApplyUserId()));
|
||||||
|
|
||||||
|
// 检查CP数量限制(最多4个)
|
||||||
|
int senderCpCount = cpRelationshipService.countNormalCp(cmd.requiredReqUserId());
|
||||||
|
int receiverCpCount = cpRelationshipService.countNormalCp(cpApply.getAcceptApplyUserId());
|
||||||
|
ResponseAssert.isFalse(UserRelationErrorCode.CP_LIMIT_EXCEEDED, senderCpCount >= 4);
|
||||||
|
ResponseAssert.isFalse(UserRelationErrorCode.CP_LIMIT_EXCEEDED, receiverCpCount >= 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 操作失败
|
// 操作失败
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user