更改积分刷新task

This commit is contained in:
2025-01-06 14:58:46 +08:00
parent 094718e67f
commit b0fa185d36
3 changed files with 3 additions and 2 deletions

View File

@@ -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"),

View File

@@ -24,7 +24,7 @@ public class AccountTask {
// @Scheduled(cron = "59 59 23 * * ?")
@Scheduled(cron = "0 0 0 1 * ?")
public void refreshCreditsMonthly() {
log.info("周日晚115959刷新付费用户积分为 6000");
log.info("月1号0点 将年费用户积分重置为 6000");
accountService.refreshCreditsWeekly();
}

View File

@@ -1621,7 +1621,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
UpdateWrapper<Account> 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);