package com.dsh.account.util;
|
|
import com.dsh.account.entity.TAppUser;
|
import com.dsh.account.service.TAppUserService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* @author zhibing.pu
|
* @date 2023/6/24 15:26
|
*/
|
@Component
|
public class TaskUtil {
|
|
@Autowired
|
private TAppUserService appUserService;
|
|
|
/**
|
* 每隔一分钟去处理的定时任务
|
*/
|
@Scheduled(fixedRate = 1000 * 60)
|
public void taskMinute() {
|
try {
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
|
/**
|
* 每天的凌晨执行的任务
|
*/
|
@Scheduled(cron = "0 0 0 * * *")
|
public void taskDay() {
|
try {
|
appUserService.membershipEnd();
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
}
|