赠送道具,购买道具,管理员赠送道具 消息增加道具类型

This commit is contained in:
tianfeng 2025-11-19 12:02:23 +08:00
parent 11c7269ee0
commit 980fc94205
3 changed files with 13 additions and 4 deletions

View File

@ -46,6 +46,7 @@ import com.red.circle.wallet.inner.model.cmd.GoldReceiptCmd;
import com.red.circle.wallet.inner.model.dto.WalletReceiptDTO;
import com.red.circle.wallet.inner.model.dto.WalletReceiptResDTO;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import lombok.RequiredArgsConstructor;
@ -191,11 +192,14 @@ public class PropsPurchasingCmdExe {
UserProfileDTO userProfileDTO = userProfileAppConvertor.toUserProfileDTO(userProfileGateway.getByUserId(cmd.requiredReqUserId()));
RegionConfig region = userRegionGateway.getRegionConfigByUserId(userProfileDTO.getId());
Map<String, Object> map = new HashMap<>();
map.put("propType", cmd.getType());
String sourceUrl = commodity.getPropsResources().getCover();
officialNoticeClient.send(NoticeExtTemplateCustomizeCmd.builder()
.toAccount(cmd.getAcceptUserId())
.noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
.content(I18nUtils.getPropsRewardContent(cmd.getType(), cmd.getDays(), I18nUtils.getLanguageByRegion(region.getRegionName())))
.title(JSON.toJSONString(map))
.expand(sourceUrl)
.build());
}

View File

@ -62,10 +62,7 @@ import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -415,10 +412,13 @@ public class ManagerAuthServiceImpl implements ManagerAuthService {
url = props.getCover();
}
Map<String, Object> map = new HashMap<>();
map.put("propType", sourceType);
officialNoticeClient.send(
NoticeExtTemplateCustomizeCmd.builder().toAccount(cmd.getAcceptUserId())
.noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
.content(I18nUtils.getPropsRewardContent(sourceType, days, I18nUtils.getLanguageByRegion(region.getRegionName())))
.title(JSON.toJSONString(map))
.expand(url)
.build());
}

View File

@ -1,5 +1,6 @@
package com.red.circle.other.app.inner.endpoint.material.props;
import com.alibaba.fastjson.JSON;
import com.red.circle.external.inner.endpoint.message.OfficialNoticeClient;
import com.red.circle.external.inner.model.cmd.message.notice.official.NoticeExtTemplateCustomizeCmd;
import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum;
@ -92,16 +93,20 @@ public class PropsBackpackClientEndpoint implements PropsBackpackClientApi {
url = props.getCover();
}
Map<String, Object> map = new HashMap<>();
map.put("propType", type);
if (!Objects.isNull(user)) {
if (Arrays.asList("ACTIVITY", "ADMINISTRATOR").contains(type)) {
BadgePictureConfig badgePictureConfig = badgePictureConfigService.getByBadgeId(user.getOriginSys(), propsId);
url = badgePictureConfig != null ? badgePictureConfig.getSelectUrl() : "";
map.put("propType", "BADGE");
}
RegionConfig region = userRegionGateway.getRegionConfigByUserId(userId);
officialNoticeClient.send(
NoticeExtTemplateCustomizeCmd.builder().toAccount(userId)
.noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
.title(JSON.toJSONString(map))
.content(I18nUtils.getPropsRewardContent(type, days, I18nUtils.getLanguageByRegion(region.getRegionName())))
.expand(url)
.build());