1.关闭续订前七天邮件提醒

2.优化订阅邮件提醒,向redis存储已发送的邮件类型
This commit is contained in:
2025-05-23 17:16:19 +08:00
parent 3b6b0c7e2c
commit 5c66ece467
7 changed files with 51 additions and 29 deletions

View File

@@ -13,6 +13,8 @@ public class CommonConstant {
public static final Integer MINIO_IMAGE_EXPIRE_TIME = 24 * 60;
// 单位 秒 一天过期 in redis
public static final Long GENERATE_RESULT_EXPIRE_TIME = 24 * 60 * 60L;
// 单位 秒 7天过期
public static final Long REDIS_SET_EXPIRE_TIME = 24 * 60 * 60 * 7L;
public static class Numbers{
public static final Integer NUMBER_10 = 10;

View File

@@ -84,8 +84,9 @@ public class PaymentTask {
}*/
}
// !!关闭此定时器,改为提前三天站内信提醒!!
// 提前7天向用户发送提醒邮件,每天早上8点执行
@Scheduled(cron = "0 0 8 * * ?")
// @Scheduled(cron = "0 0 8 * * ?")
public void subscriptionReminder(){
stripeService.subscriptionReminder();
}
@@ -113,7 +114,7 @@ public class PaymentTask {
}
}
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void calcCouponsCommission(){
// log.info("优惠券佣金计算定时器");
affiliateService.calcCouponsCommission();

View File

@@ -84,8 +84,10 @@ public class RedisUtil {
/**
* 将数据放入set缓存
*/
public void addToSet(String key, String value) {
public void addToSet(String key, String value, Long expiresIn) {
redisTemplate.opsForSet().add(key, value);
// 设置过期时间
redisTemplate.expire(key, expiresIn, TimeUnit.SECONDS);
}
/**
@@ -302,4 +304,5 @@ public class RedisUtil {
}
public final static String STRIPE_EXCEPTION_LOG = "StripeException:";
public final static String SUBSCRIPTION_SENT_EMAIL_TYPE = "SubscriptionEmailSentType:";
}