forked from kidgrow-microservices-platform

zhaoxiaohao
2021-02-26 42732fda8d3fdef36b33e2c46f2988df7424bf6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.kidgrow.oprationcenter.config;
 
import com.kidgrow.oprationcenter.service.IHospitalScreeningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
 
@Component //作为bean加入spring
@Order(value = 2)//多个启动任务的执行顺序
public class RedisStartupRunner implements CommandLineRunner {
    @Autowired
    IHospitalScreeningService hospitalScreeningService;
 
    @Override
    public void run(String... args) throws Exception {
        hospitalScreeningService.tableToRedis();
    }
}