forked from kidgrow-microservices-platform

zhaoxiaohao
2020-12-09 b92f672511421c4f1b673242ef6ac5b186d10d1a
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();
    }
}