1
zhujie
5 天以前 ec15861e14c66c38b1a8f5fffc6975d7da6c315c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.mzl.flower.config;
 
import com.mzl.flower.service.system.CodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
 
@Component
@Slf4j
public class DataCacheInitComponent implements CommandLineRunner {
 
    @Autowired
    private CodeService dictService;
 
    @Override
    public void run(String... args) throws Exception {
 
        log.info("初始化字典数据到缓存");
        dictService.refreshCache();
    }
}