feat(config): 集成字典管理模块配置
- 在插件父pom中添加字典模块引用 - 在Web启动模块中添加字典模块依赖 - 启用@EnableCoderDict字典翻译插件 - 配置应用启动时字典缓存预热 - 完成字典管理系统完整集成
This commit is contained in:
parent
f74779d0ad
commit
55734b2b12
@ -1,6 +1,8 @@
|
|||||||
package org.leocoder.thin.system.config.init;
|
package org.leocoder.thin.system.config.init;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.leocoder.thin.system.service.dictdata.SysDictDataService;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -16,9 +18,13 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
public class ServerCommandLineRunner implements CommandLineRunner {
|
public class ServerCommandLineRunner implements CommandLineRunner {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysDictDataService sysDictDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(String... args) {
|
public void run(String... args) {
|
||||||
|
// 逻辑代码[字典数据缓存]
|
||||||
|
sysDictDataService.listDictCacheRedis();
|
||||||
log.info("CommandLineRunner项目启动后立即执行,重新获取缓存 => [推荐使用]");
|
log.info("CommandLineRunner项目启动后立即执行,重新获取缓存 => [推荐使用]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
<module>coder-common-thin-limit</module>
|
<module>coder-common-thin-limit</module>
|
||||||
<module>coder-common-thin-oper-logs</module>
|
<module>coder-common-thin-oper-logs</module>
|
||||||
<module>coder-common-thin-oss</module>
|
<module>coder-common-thin-oss</module>
|
||||||
|
<module>coder-common-thin-dict</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@ -37,6 +37,12 @@
|
|||||||
<artifactId>coder-common-thin-oss</artifactId>
|
<artifactId>coder-common-thin-oss</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 字典管理模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.leocoder.thin</groupId>
|
||||||
|
<artifactId>coder-common-thin-dict</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
<!-- 定时任务 -->
|
<!-- 定时任务 -->
|
||||||
<!-- <dependency> -->
|
<!-- <dependency> -->
|
||||||
<!-- <groupId>org.leocoder.thin</groupId> -->
|
<!-- <groupId>org.leocoder.thin</groupId> -->
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import org.leocoder.thin.oss.annotation.EnableCoderOss;
|
|||||||
import org.leocoder.thin.repect.anno.EnableCoderRepeatSubmit;
|
import org.leocoder.thin.repect.anno.EnableCoderRepeatSubmit;
|
||||||
import org.leocoder.thin.resultex.anno.EnableResultEx;
|
import org.leocoder.thin.resultex.anno.EnableResultEx;
|
||||||
import org.leocoder.thin.satoken.anno.EnableCoderSaToken;
|
import org.leocoder.thin.satoken.anno.EnableCoderSaToken;
|
||||||
|
import org.leocoder.thin.dict.anno.EnableCoderDict;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
@ -29,7 +30,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
@EnableResultEx
|
@EnableResultEx
|
||||||
@EnableOperLog
|
@EnableOperLog
|
||||||
@EnableCoderOss
|
@EnableCoderOss
|
||||||
// @EnableCoderDict
|
@EnableCoderDict
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SpringBootApplication(scanBasePackages = "org.leocoder.thin")
|
@SpringBootApplication(scanBasePackages = "org.leocoder.thin")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user