diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/FamilyErrorCode.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/FamilyErrorCode.java index aabeefb7..f0a31add 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/FamilyErrorCode.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/FamilyErrorCode.java @@ -98,6 +98,11 @@ public enum FamilyErrorCode implements IResponseErrorCode { */ ONLY_ADMIN_CAN_DISBAND_FAMILY(2517, "Only the patriarch can disband the family"), + /** + * 用户已加入家族 + */ + USER_JOINED_FAMILY(2518, "The user has joined the family"), + ; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/CancelFamilyApplyExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/CancelFamilyApplyExe.java index c061e63a..d79e19df 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/CancelFamilyApplyExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/CancelFamilyApplyExe.java @@ -5,6 +5,7 @@ import com.red.circle.framework.core.response.CommonErrorCode; import com.red.circle.other.app.dto.cmd.family.CancelFamilyApplyCmd; import com.red.circle.other.infra.database.rds.entity.family.FamilyMessage; import com.red.circle.other.infra.database.rds.service.family.FamilyMessageService; +import com.red.circle.other.inner.asserts.FamilyErrorCode; import com.red.circle.other.inner.enums.FamilyMessageStatusEnum; import java.util.Objects; import lombok.RequiredArgsConstructor; @@ -25,6 +26,8 @@ public class CancelFamilyApplyExe { ResponseAssert.notNull(CommonErrorCode.NOT_FOUND_RECORD_INFO, msg); ResponseAssert.isTrue(CommonErrorCode.DATA_ERROR, Objects.equals(msg.getSenderUser(), cmd.getReqUserId())); + ResponseAssert.isFalse(FamilyErrorCode.USER_JOINED_FAMILY, + Objects.equals(msg.getStatus(), FamilyMessageStatusEnum.APPROVED.getCode())); ResponseAssert.isTrue(CommonErrorCode.DATA_ERROR, Objects.equals(msg.getStatus(), FamilyMessageStatusEnum.PENDING.getCode())); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/ReapplyFamilyExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/ReapplyFamilyExe.java index cb21a455..ad1a3710 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/ReapplyFamilyExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/ReapplyFamilyExe.java @@ -37,6 +37,8 @@ public class ReapplyFamilyExe { ResponseAssert.notNull(CommonErrorCode.NOT_FOUND_RECORD_INFO, msg); ResponseAssert.isTrue(CommonErrorCode.DATA_ERROR, Objects.equals(msg.getSenderUser(), cmd.getReqUserId())); + ResponseAssert.isFalse(FamilyErrorCode.USER_JOINED_FAMILY, + Objects.equals(msg.getStatus(), FamilyMessageStatusEnum.APPROVED.getCode())); ResponseAssert.isTrue(CommonErrorCode.DATA_ERROR, Objects.equals(msg.getStatus(), FamilyMessageStatusEnum.REJECTED.getCode()));