diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/GiftErrorCode.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/GiftErrorCode.java index 7971ca62..e3f7860c 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/GiftErrorCode.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/GiftErrorCode.java @@ -44,6 +44,11 @@ public enum GiftErrorCode implements IResponseErrorCode { * 不是同一个大区 */ NOT_SAME_REGION(8406, "Not the same region"), + + /** + * 魔法礼物只支持发送一个 + */ + MAGIC_GIFT_QUANTITY_ERROR(8407, "The function for gifting multiple magical gifts is currently experiencing issues and is temporarily unavailable.") ; private final int code; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/gift/LuckyGiftGiveCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/gift/LuckyGiftGiveCmdExe.java index 0ab9de07..3eca5705 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/gift/LuckyGiftGiveCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/gift/LuckyGiftGiveCmdExe.java @@ -13,6 +13,7 @@ import com.red.circle.other.app.service.task.TaskService; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.infra.database.cache.service.other.GiftCacheService; import com.red.circle.other.inner.asserts.GiftErrorCode; +import com.red.circle.other.inner.asserts.OtherErrorCode; import com.red.circle.other.inner.asserts.RoomErrorCode; import com.red.circle.other.inner.enums.material.GiftCurrencyType; import com.red.circle.other.inner.enums.material.GiftTabEnum; @@ -70,6 +71,11 @@ public class LuckyGiftGiveCmdExe { log.info("赠送幸运礼物金额为0,余额为 {}", dollarAmount); return dollarAmount; } + + if (GiftTabEnum.MAGIC.name().equals(giftConfig.getGiftTab())) { + ResponseAssert.isFalse(GiftErrorCode.MAGIC_GIFT_QUANTITY_ERROR, cmd.getQuantity() > 1); + } + // 付钱 WalletReceiptResDTO receipt = consumeCandy(cmd, giftConfig);