Commit c98fd9555bb5ec2263a0bd00e938e9a4346a624c
1 parent
1b5a63ef
fix: YudaoTranslateAutoConfiguration 增加 @ConditionalOnBean(TransService.class)
Showing
1 changed file
with
2 additions
and
0 deletions
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/config/YudaoTranslateAutoConfiguration.java
| ... | ... | @@ -3,12 +3,14 @@ package cn.iocoder.yudao.framework.translate.config; |
| 3 | 3 | import cn.iocoder.yudao.framework.translate.core.TranslateUtils; |
| 4 | 4 | import org.dromara.trans.service.impl.TransService; |
| 5 | 5 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 6 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | |
| 6 | 7 | import org.springframework.context.annotation.Bean; |
| 7 | 8 | |
| 8 | 9 | @AutoConfiguration |
| 9 | 10 | public class YudaoTranslateAutoConfiguration { |
| 10 | 11 | |
| 11 | 12 | @Bean |
| 13 | + @ConditionalOnBean(TransService.class) | |
| 12 | 14 | @SuppressWarnings("InstantiationOfUtilityClass") |
| 13 | 15 | public TranslateUtils translateUtils(TransService transService) { |
| 14 | 16 | TranslateUtils.init(transService); | ... | ... |