From 005776a9f0a8394b55767977677538d959c655c7 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 11 Dec 2025 19:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86cp=E7=94=B3=E8=AF=B7=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle/other/app/command/user/ProcessCpApplyCmd.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/ProcessCpApplyCmd.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/ProcessCpApplyCmd.java index 6f5d41b2..1ff3698c 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/ProcessCpApplyCmd.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/ProcessCpApplyCmd.java @@ -70,6 +70,12 @@ public class ProcessCpApplyCmd { // 非复合申请:CP已存在 ResponseAssert.isFalse(UserRelationErrorCode.ME_OR_YOU_CP_EXISTED, 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); } // 操作失败