44323
2023-11-27 aa925d851857f50eff0556411366690d9a78a0e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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();
        }
    }
}