提交 3aa8980a 编写于 作者: sq3536's avatar sq3536

没有mogodb存储时排除mogodb,解决启动报错

上级 ccf5d0a0
......@@ -30,6 +30,18 @@ import java.util.List;
@MapperScan("${pub.getPKGCodeName()}.*.mapper")
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
<#assign bmogo=false>
<#if app.getAllPSAppDataEntities()??>
<#list app.getAllPSAppDataEntities() as appde>
<#if appde.getStorageMode()?? && appde.getStorageMode()==2>
<#assign bmogo=true>
<#break >
</#if>
</#list>
</#if>
<#if bmogo==false>
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
</#if>
})
public class ${app.getPKGCodeName()}Application extends WebMvcConfigurerAdapter{
......
......@@ -18,8 +18,21 @@ import java.util.List;
@EnableDiscoveryClient
@Configuration
@EnableTransactionManagement
@SpringBootApplication
@EnableFeignClients(basePackages = {"${pub.getPKGCodeName()}" })
@SpringBootApplication(exclude = {
<#assign bmogo=false>
<#if sys.getAllPSDataEntities()??>
<#list sys.getAllPSDataEntities() as de>
<#if de.getStorageMode()?? && de.getStorageMode()==2>
<#assign bmogo=true>
<#break >
</#if>
</#list>
</#if>
<#if bmogo==false>
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
</#if>
})
public class DevBootApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) {
......
......@@ -26,6 +26,18 @@ import java.util.List;
@MapperScan("${pub.getPKGCodeName()}.*.mapper")
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
<#assign bmogo=false>
<#if item.getPSDEServiceAPIs()??>
<#list item.getPSDEServiceAPIs() as api>
<#if api.getPSDataEntity()?? && api.getPSDataEntity().getStorageMode()?? && api.getPSDataEntity().getStorageMode()==2>
<#assign bmogo=true>
<#break >
</#if>
</#list>
</#if>
<#if bmogo==false>
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
</#if>
})
@EnableFeignClients(basePackages = {"${pub.getPKGCodeName()}" })
public class ${sys.codeName}${item.codeName}Application extends WebMvcConfigurerAdapter{
......
......@@ -51,6 +51,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
private String keyFieldTag="keyfield";
@Resource
@Lazy
private MongoTemplate mongoTemplate;
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册