新增发送通知
This commit is contained in:
parent
c8187c272d
commit
a2492c66b5
@ -97,6 +97,7 @@ public class PropsSendCommon {
|
||||
private final ConsumptionLevelService consumptionLevelService;
|
||||
private final PropCouponGateway propCouponGateway;
|
||||
private final OfficialNoticeClient officialNoticeClient;
|
||||
private final UserRegionGateway userRegionGateway;
|
||||
|
||||
/**
|
||||
* 发送奖励.
|
||||
@ -235,7 +236,7 @@ public class PropsSendCommon {
|
||||
|
||||
private void saveSendLog(PrizeDescribeRewardCmd param) {
|
||||
//发送通知
|
||||
// RegionConfig region = userRegionGateway.getRegionConfigByUserId(param.getAcceptUserId());
|
||||
RegionConfig region = userRegionGateway.getRegionConfigByUserId(param.getAcceptUserId());
|
||||
propsSendLogService.saveBatch(param.getPrizes().stream().filter(Objects::nonNull)
|
||||
.filter(prize -> !PropsActivityRewardEnum.CUSTOMIZE.eq(prize.getType()))
|
||||
.map(conf -> {
|
||||
@ -249,12 +250,16 @@ public class PropsSendCommon {
|
||||
.setOrigin(String.valueOf(param.getOrigin()));
|
||||
propsSendLog.setCreateTime(TimestampUtils.now());
|
||||
propsSendLog.setUpdateTime(TimestampUtils.now());
|
||||
// officialNoticeClient.send(
|
||||
// NoticeExtTemplateCustomizeCmd.builder().toAccount(param.getAcceptUserId())
|
||||
// .noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
|
||||
// .content(I18nUtils.getPropsRewardContent(conf.getDetailType(), conf.getQuantity(), I18nUtils.getLanguageByRegion(region.getRegionName())))
|
||||
// .expand(null)
|
||||
// .build());
|
||||
try {
|
||||
officialNoticeClient.send(
|
||||
NoticeExtTemplateCustomizeCmd.builder().toAccount(param.getAcceptUserId())
|
||||
.noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
|
||||
.content(I18nUtils.getPropsRewardContent(conf.getDetailType(), conf.getQuantity(), I18nUtils.getLanguageByRegion(region.getRegionName())))
|
||||
.expand(null)
|
||||
.build());
|
||||
} catch (Exception e) {
|
||||
log.error("saveSendLog 发送通知失败{}", e.getMessage());
|
||||
}
|
||||
return propsSendLog;
|
||||
}).collect(Collectors.toList()));
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheSe
|
||||
import com.red.circle.other.infra.database.rds.entity.sys.GameListConfig;
|
||||
import com.red.circle.other.infra.database.rds.entity.user.user.OneTimeTask;
|
||||
import com.red.circle.other.infra.database.rds.service.sys.GameListConfigService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.device.LatestMobileDeviceService;
|
||||
import com.red.circle.other.infra.database.rds.service.user.user.OneTimeTaskService;
|
||||
import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum;
|
||||
import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd;
|
||||
@ -47,6 +48,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@ -83,6 +85,15 @@ public class SpringTest {
|
||||
private OneTimeTaskService oneTimeTaskService;
|
||||
@Autowired
|
||||
private PropsActivityClientService propsActivityClientService;
|
||||
@Autowired
|
||||
private LatestMobileDeviceService latestMobileDeviceService;
|
||||
|
||||
@Test
|
||||
public void getDeviceFingerprintByUserId() {
|
||||
Arrays.asList(1989287386040430594L, 1989287287902359554L, 1989287471839113218L).stream().toList().forEach(id -> {
|
||||
System.out.println(latestMobileDeviceService.getDeviceFingerprintByUserId(id));
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletedFirstCharge() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user