cloudroam
2024-09-27 0790e530ea01e0629fa5d21d6e94d79e50bd52d9
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();
    }
}