From 42295ef2ac0a5e78674cf24b62d6834138f0ffdc Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 29 十一月 2021 13:56:25 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into satoken --- ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java b/ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java new file mode 100644 index 0000000..4080a1a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java @@ -0,0 +1,42 @@ +package com.ruoyi.system.runner; + +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysDictTypeService; +import com.ruoyi.system.service.ISysOssConfigService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +/** + * 鍒濆鍖� system 妯″潡瀵瑰簲涓氬姟鏁版嵁 + * + * @author Lion Li + */ +@Slf4j +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@Component +public class SystemApplicationRunner implements ApplicationRunner { + + private final RuoYiConfig ruoyiConfig; + private final ISysConfigService configService; + private final ISysDictTypeService dictTypeService; + private final ISysOssConfigService ossConfigService; + + @Override + public void run(ApplicationArguments args) throws Exception { + ossConfigService.init(); + log.info("鍒濆鍖朞SS閰嶇疆鎴愬姛"); + if (ruoyiConfig.isCacheLazy()){ + return; + } + configService.loadingConfigCache(); + log.info("鍔犺浇鍙傛暟缂撳瓨鏁版嵁鎴愬姛"); + dictTypeService.loadingDictCache(); + log.info("鍔犺浇瀛楀吀缂撳瓨鏁版嵁鎴愬姛"); + } + +} -- Gitblit v1.9.3