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

更改配置文件

上级 27d74f15
......@@ -5,6 +5,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.ibizsys.model.service.IPSSubSysServiceAPI;
import net.ibizsys.model.system.IPSSystemModule;
import java.util.*;
......@@ -32,4 +33,26 @@ public class SubServiceApiModel extends BaseModel {
return subEntityApi.get(codeName);
}
public IPSSubSysServiceAPI getPSSubSysServiceAPI() {
return (IPSSubSysServiceAPI)opt;
}
public String module;
public String getModule()
{
if(module==null)
{
IPSSystemModule systemModule = getPSSubSysServiceAPI().getPSSystemModule();
if(systemModule!=null&&systemModule.getCodeName()!=null&&systemModule.getPSSysModelGroup() == null) {
module = getPSSubSysServiceAPI().getPSSystemModule().getCodeName().toLowerCase();
if("rt".equals(module))
module="";
}
else
module="";
}
return module;
}
}
......@@ -57,6 +57,7 @@ public class SystemModel extends BaseModel {
this.setPackageName(system.getCodeName().toLowerCase());
}
getEntitiesMap();
getSubServiceApiMap();
}
public IPSSystem getSystem() {
......@@ -217,11 +218,25 @@ public class SystemModel extends BaseModel {
private Map<String, SubServiceApiModel> subServiceApiMap;
private Map<String, List<SubServiceApiModel>> subServiceApiModules;
public synchronized Map<String, SubServiceApiModel> getSubServiceApiMap() {
if (subServiceApiMap == null) {
subServiceApiMap = new LinkedHashMap<>();
getSystem().getAllPSSubSysServiceAPIs().forEach(subSysServiceAPI -> {
subServiceApiMap.put(subSysServiceAPI.getCodeName(), new SubServiceApiModel(subSysServiceAPI).setSystem(this));
SubServiceApiModel subapi=new SubServiceApiModel(subSysServiceAPI).setSystem(this);
subServiceApiMap.put(subSysServiceAPI.getCodeName(), subapi);
String module=subapi.getModule();
if(!StringUtils.isEmpty(module))
{
if(subServiceApiModules==null)
subServiceApiModules=new LinkedHashMap<>();
if(!subServiceApiModules.containsKey(module))
subServiceApiModules.put(module,new ArrayList<>());
subServiceApiModules.get(module).add(subapi);
}
});
}
return subServiceApiMap;
......
......@@ -5,10 +5,21 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import net.ibizsys.central.cloud.core.spring.configuration.NacosServiceHubSetting;
import net.ibizsys.central.cloud.core.spring.rt.ServiceHub;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableDiscoveryClient(autoRegister=false)
@SpringBootApplication(exclude= SecurityAutoConfiguration.class)
@ComponentScan({"net.ibizsys.central.cloud.core.spring","net.ibizsys.central.plugin.boot.core","{{packageName}}"})
@SpringBootApplication(exclude = { {{#unless system.enableMongo}}org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,{{/unless}}com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class,SecurityAutoConfiguration.class})
@ComponentScan(basePackages = {"net.ibizsys.central.cloud.core.spring","net.ibizsys.central.plugin.boot.core","{{packageName}}"},excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {NacosServiceHubSetting.class,ServiceHub.class})
})
@EnableAsync
@EnableScheduling
@EnableTransactionManagement
public class IBizRuntimeApplication {
public static void main(String[] args) {
......
spring:
datasource:
druid:
# 监控页面
web-stat-filter:
enabled: true
url-pattern: /*
profileEnable: true
exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: admin
login-password: admin
dynamic:
druid: #以下是全局默认值,可以全局更改
filters: stat,slf4j
useGlobalDataSourceStat: true
stat:
log-slow-sql: true
merge-sql: true
slow-sql-millis: 10000
ibiz:
filePath: /app/file/
deploysystems:
gateway:
settings:
sysdbscheme:
default:
datasource: rtds
sysutil:
unistate:
serviceurl: ${zookeeper.address:127.0.0.1:2181}
cache:
serviceurl: ${spring.redis.host:127.0.0.1}:${spring.redis.port:6379}
{{lowerCase system.name}}:
runtimeClassName: {{packageName}}.runtime.SystemRuntime
settings:
sysdbscheme:
default:
datasource: {{lowerCase system.name}}__default
dbtype: ${spring.datasource.dbtype:MYSQL}
{{#if system.subServiceApiModules}}
subsysserviceapi:
{{#each system.subServiceApiModules as |submodule|}}
{{@key}}:
{{#each submodule as |apiitem|}}
{{lowerCase apiitem.codeName}}:
serviceurl: {{apiitem.servicePath}}
{{/each}}
{{/each}}
{{/if}}
servicehub:
id: {{lowerCase system.name}}
register-naming-service: true
publish-config: true
enableAppGateway: true
tempFolder: ${ibiz.filePath:/app/file/}temp/
reportFolder: ${ibiz.filePath:/app/file/}report/
fontFolder: ${ibiz.filePath:/app/file/}font/
fileFolder: ${ibiz.filePath:/app/file/}
loadDeploySystems:
- gateway
- {{lowerCase system.name}}
systemSettings:
cloudclientutil:
serviceurl: lb://ebsx-oldapi
accesstokenurl: lb://ibizcloud-uaa/v7/login
clientid: aibizhi
clientsecret: 123456
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册