From b0fa185d3659729df61540f5295b6e78deb78b2f Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 6 Jan 2025 14:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=A7=AF=E5=88=86=E5=88=B7?= =?UTF-8?q?=E6=96=B0task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/enums/CreditsEventsEnum.java | 1 + src/main/java/com/ai/da/common/task/AccountTask.java | 2 +- src/main/java/com/ai/da/service/impl/AccountServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/common/enums/CreditsEventsEnum.java b/src/main/java/com/ai/da/common/enums/CreditsEventsEnum.java index 532934b0..ed9f73b6 100644 --- a/src/main/java/com/ai/da/common/enums/CreditsEventsEnum.java +++ b/src/main/java/com/ai/da/common/enums/CreditsEventsEnum.java @@ -20,6 +20,7 @@ public enum CreditsEventsEnum { INIT_MONTHLY("init_monthly", "5000"), INIT_TRIAL("init_trial", "100"), INIT_WEEKLY("init_weekly","6000"), + RESET_YEAR_CREDITS("reset_year_credits","6000"), // SUPER_RESOLUTION("Super Resolution","30"), SUPER_RESOLUTION("Super Resolution","10"), diff --git a/src/main/java/com/ai/da/common/task/AccountTask.java b/src/main/java/com/ai/da/common/task/AccountTask.java index 62d901b0..9c66563c 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -24,7 +24,7 @@ public class AccountTask { // @Scheduled(cron = "59 59 23 * * ?") @Scheduled(cron = "0 0 0 1 * ?") public void refreshCreditsMonthly() { - log.info("每周日晚11:59:59刷新付费用户积分为 6000"); + log.info("每月1号0点 将年费用户积分重置为 6000"); accountService.refreshCreditsWeekly(); } diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 3dd13d77..fea340e5 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -1621,7 +1621,7 @@ public class AccountServiceImpl extends ServiceImpl impl UpdateWrapper accountUpdateWrapper = new UpdateWrapper<>(); // 刷新账号有效期截止之前的年付用户的积分 long epochMilli = Instant.now().toEpochMilli(); - accountUpdateWrapper.lambda().set(Account::getCredits, CreditsEventsEnum.INIT_WEEKLY.getValue()) + accountUpdateWrapper.lambda().set(Account::getCredits, CreditsEventsEnum.RESET_YEAR_CREDITS.getValue()) .eq(Account::getSystemUser,1) // .or().eq(Account::getSystemUser,2) .gt(Account::getValidEndTime, epochMilli);