From 97c84fc975075faa56b3e42b429bb6d16096bca2 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Sat, 28 Feb 2026 12:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E9=81=93=E5=85=B7=E5=88=B8?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=98=BF=E8=AF=AD=E5=8C=BA=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../propcoupon/PropCouponGrantCmdExe.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java index 6b4b192d..11cd6e85 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java @@ -5,7 +5,9 @@ import com.red.circle.external.inner.model.cmd.message.notice.official.NoticeExt import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum; import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.domain.model.user.UserProfile; +import com.red.circle.other.domain.model.user.ability.RegionConfig; import com.red.circle.other.inner.model.cmd.material.PropCouponGrantCmd; import com.red.circle.other.domain.gateway.PropCouponGateway; import com.red.circle.other.domain.propcoupon.PropCoupon; @@ -20,6 +22,7 @@ import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import com.red.circle.tool.core.sequence.IdWorkerUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -42,6 +45,7 @@ public class PropCouponGrantCmdExe { private final OfficialNoticeClient officialNoticeClient; private final PropsSourceClient propsSourceClient; private final UserProfileGateway userProfileGateway; + private final UserRegionGateway userRegionGateway; /** * 执行后台赠送道具券 @@ -209,15 +213,26 @@ public class PropCouponGrantCmdExe { * 发送单个通知 */ private void sendNotification(PropCoupon propCoupon, UserProfile user, PropCouponType couponType) { + String content = getRegionContent(user.getId()); officialNoticeClient.send( NoticeExtTemplateCustomizeCmd.builder() .toAccount(user.getId()) .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) - .content("You have received a Coupon. Please check it.") + .content(content) .build() ); log.info("发送道具券赠送通知, receiverId:{}, couponNo:{}, couponType:{}", user.getId(), propCoupon.getCouponNo(), propCoupon.getCouponType().getDesc()); } + + private String getRegionContent(Long userId) { + RegionConfig region = userRegionGateway.getRegionConfigByUserId(userId); + boolean arRegion = region != null && "AR".equals(region.getRegionCode()); + if (arRegion) { + return "لقد تلقيت قسيمة. يرجى التحقق منها."; + } else { + return "You have received a Coupon. Please check it."; + } + } }