From 345c9f2e063b7455e7402fbaaeb0b76255911e2e Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 4 Mar 2026 11:00:45 +0800 Subject: [PATCH] =?UTF-8?q?roomDailyTask=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wallet/inner/model/enums/GoldOrigin.java | 5 +++++ .../app/command/task/RoomDailyTaskClaimExe.java | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-inner-api/wallet-inner/wallet-inner-model/src/main/java/com/red/circle/wallet/inner/model/enums/GoldOrigin.java b/rc-service/rc-inner-api/wallet-inner/wallet-inner-model/src/main/java/com/red/circle/wallet/inner/model/enums/GoldOrigin.java index 49047d21..7a5f981e 100644 --- a/rc-service/rc-inner-api/wallet-inner/wallet-inner-model/src/main/java/com/red/circle/wallet/inner/model/enums/GoldOrigin.java +++ b/rc-service/rc-inner-api/wallet-inner/wallet-inner-model/src/main/java/com/red/circle/wallet/inner/model/enums/GoldOrigin.java @@ -192,6 +192,11 @@ public enum GoldOrigin { */ DAILY_TASK("Daily task"), + /** + * 房间每日奖励 + */ + ROOM_DAILY_TASK("Daily Coin Bonanza"), + /** * cp奖励. */ diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java index 6bc7426e..5bc80fc7 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java @@ -10,6 +10,11 @@ import com.red.circle.other.infra.database.rds.entity.task.RoomDailyTaskTier; import com.red.circle.other.infra.database.rds.service.RoomDailyTaskDatabaseService; import com.red.circle.other.inner.asserts.user.UserErrorCode; import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; +import com.red.circle.tool.core.sequence.IdWorkerUtils; +import com.red.circle.tool.core.tuple.PennyAmount; +import com.red.circle.wallet.inner.endpoint.wallet.WalletGoldClient; +import com.red.circle.wallet.inner.model.cmd.GoldReceiptCmd; +import com.red.circle.wallet.inner.model.enums.GoldOrigin; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -27,6 +32,7 @@ import java.time.LocalDateTime; public class RoomDailyTaskClaimExe { private final RoomDailyTaskDatabaseService taskDatabaseService; + private final WalletGoldClient walletGoldClient; @Transactional(rollbackFor = Exception.class) public RoomDailyTaskClaimCO execute(RoomDailyTaskClaimCmd cmd) { @@ -78,7 +84,14 @@ public class RoomDailyTaskClaimExe { record.setCreateTime(LocalDateTime.now()); taskDatabaseService.saveClaimRecord(record); - // TODO: 调用钱包服务发放金币 + walletGoldClient.changeBalance(GoldReceiptCmd.builder() + .appIncome() + .userId(userId) + .amount(PennyAmount.ofDollar(tier.getRewardValue().longValue())) + .eventId(bizNo) + .sysOrigin(cmd.requireReqSysOrigin()) + .origin(GoldOrigin.ROOM_DAILY_TASK) + .build()); log.info("任务奖励领取成功, userId={}, taskCode={}, tierIndex={}, rewardValue={}", userId, taskCode, tierIndex, tier.getRewardValue());