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

引用修复

上级 e580fbb4
...@@ -21,19 +21,6 @@ ...@@ -21,19 +21,6 @@
</modules> </modules>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId> <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
......
...@@ -9,11 +9,9 @@ import org.springframework.cloud.openfeign.FeignClientsConfiguration; ...@@ -9,11 +9,9 @@ import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.List; import java.util.List;
...@@ -23,31 +21,16 @@ import java.util.List; ...@@ -23,31 +21,16 @@ import java.util.List;
}) })
@EnableDiscoveryClient @EnableDiscoveryClient
@Configuration @Configuration
@EnableFeignClients(basePackages = {"{{packageName}}" }) @EnableFeignClients(basePackages = {"{{packageName}}.{{lowerCase app.codeName}}","cn.ibizlab.util"})
@EnableZuulProxy @EnableZuulProxy
@ComponentScan(basePackages = {"{{packageName}}.{{lowerCase app.codeName}}","cn.ibizlab.util"}) @ComponentScan(basePackages = {"{{packageName}}.{{lowerCase app.codeName}}","cn.ibizlab.util"})
@MapperScan("{{packageName}}.*.mapper")
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
{{#unless system.enableMongo}}
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
{{/unless}}
{{#if system.enableDS}}
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
{{/if}}
}) })
public class {{app.codeName}}Application extends WebMvcConfigurerAdapter { public class {{app.codeName}}Application extends WebMvcConfigurerAdapter {
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run({{app.codeName}}Application.class, args); SpringApplication.run({{app.codeName}}Application.class, args);
} }
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(resolver);
}
} }
server: server:
port: {{#if app.httpPort}}{{app.httpPort}}{{else}}8080{{/if}} port: {{#if app.httpPort}}{{app.httpPort}}{{else}}8080{{/if}}
spring:
cache:
redis:
time-to-live: 3600
caffeine:
spec: initialCapacity=5,maximumSize=500,expireAfterWrite=3600s
redis:
host: 127.0.0.1
port: 6379
password:
database: 0
lettuce:
pool:
max-active: 32
max-wait: 300ms
max-idle: 16
min-idle: 8
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
#阿里sentinel熔断器
feign:
httpclient:
enabled: true
sentinel:
enabled: true
compression:
request:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
response:
enabled: true
#Log配置 #Log配置
logging: logging:
level: level:
{{packageName}}: info cn.ibizlab: debug
{{packageName}}: debug
org.springframework.boot.autoconfigure: ERROR
#zuul网关超时设置
ribbon:
ReadTimeout: 60000
ConnectTimeout: 60000
#系统是否开启权限验证、是否开启缓存
#缓存级别:无缓存(无配置项)、一级缓存(L1)、二级缓存(L2)
ibiz:
systemid: {{system.codeName}}
enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
### 启用Gzip压缩
server:
compression:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
#zuul网关路由设置 #zuul网关路由设置
zuul: zuul:
routes: routes:
......
spring: spring:
profiles: profiles:
include: sys ,nacos, {{lowerCase app.codeName}}-prod include: nacos, {{lowerCase app.codeName}}-prod
application: application:
name: {{projectName}}-{{lowerCase app.codeName}} name: {{projectName}}-{{lowerCase app.codeName}}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 --> <!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}}" /> <property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 --> <!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
...@@ -26,18 +26,19 @@ ...@@ -26,18 +26,19 @@
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名--> <!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}}/{{projectName}}-{{lowerCase app.codeName}}.%d{yyyy-MM-dd}.log</FileNamePattern> <FileNamePattern>${LOG_PATH}/{{projectName}}-{{lowerCase app.codeName}}.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件最大的大小-->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数--> <!--日志文件保留天数-->
<MaxHistory>30</MaxHistory> <MaxHistory>30</MaxHistory>
</rollingPolicy> </rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}}</pattern> <pattern>${LOG_PATTERN}</pattern>
</encoder> </encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender> </appender>
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="INFO"> <root level="INFO">
......
...@@ -14,11 +14,6 @@ ...@@ -14,11 +14,6 @@
<description>{{projectDesc}} Boot</description> <description>{{projectDesc}} Boot</description>
<dependencies> <dependencies>
<dependency>
<groupId>{{packageName}}</groupId>
<artifactId>{{projectName}}-core</artifactId>
<version>${project.version}</version>
</dependency>
{{#each system.apis}} {{#each system.apis}}
<dependency> <dependency>
......
...@@ -21,16 +21,16 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -21,16 +21,16 @@ import org.springframework.beans.factory.annotation.Autowired;
@EnableDiscoveryClient @EnableDiscoveryClient
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
@EnableFeignClients(basePackages = {"{{packageName}}" }) @EnableFeignClients(basePackages = {"{{packageName}}","cn.ibizlab.util"})
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
{{#unless system.enableMongo}} {{#unless system.enableMongo}}
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class, org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
{{/unless}} {{/unless}}
{{#if system.enableDS}} {{#unless system.enableDS}}
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
{{/if}} {{/unless}}
}) })
@ComponentScan(basePackages = {"{{packageName}}"} @ComponentScan(basePackages = {"{{packageName}}","cn.ibizlab.util"}
// ,excludeFilters = { // ,excludeFilters = {
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX, pattern="{{packageName}}.xxx.rest.xxx"), // @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX, pattern="{{packageName}}.xxx.rest.xxx"),
// } // }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 --> <!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}}" /> <property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 --> <!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
...@@ -27,18 +27,19 @@ ...@@ -27,18 +27,19 @@
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名--> <!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}}/{{projectName}}.%d{yyyy-MM-dd}.log</FileNamePattern> <FileNamePattern>${LOG_PATH}/{{projectName}}.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件最大的大小-->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数--> <!--日志文件保留天数-->
<MaxHistory>30</MaxHistory> <MaxHistory>30</MaxHistory>
</rollingPolicy> </rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}}</pattern> <pattern>${LOG_PATTERN}</pattern>
</encoder> </encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender> </appender>
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="INFO"> <root level="INFO">
......
...@@ -14,42 +14,86 @@ ...@@ -14,42 +14,86 @@
<description>{{projectDesc}} Core</description> <description>{{projectDesc}} Core</description>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>cn.ibizlab</groupId>
<artifactId>spring-data-commons</artifactId> <artifactId>ibizlab-util</artifactId>
<version>${ibizlab-util.version}</version>
</dependency> </dependency>
<!-- JBPM --> {{#system.enableES}}
<dependency> <dependency>
<groupId>org.jbpm</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>jbpm-flow-builder</artifactId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency> </dependency>
{{/system.enableES}}
{{#system.enableMQ}}
<dependency> <dependency>
<groupId>org.jbpm</groupId> <groupId>org.apache.rocketmq</groupId>
<artifactId>jbpm-bpmn2</artifactId> <artifactId>rocketmq-client</artifactId>
<version>${rocketmq.version}</version>
</dependency> </dependency>
<!-- Drools --> {{/system.enableMQ}}
{{#system.enableOAuth2}}
<dependency> <dependency>
<groupId>org.drools</groupId> <groupId>org.springframework.security.oauth</groupId>
<artifactId>drools-compiler</artifactId> <artifactId>spring-security-oauth2</artifactId>
<version>2.3.6.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.drools</groupId> <groupId>org.springframework.security</groupId>
<artifactId>drools-core</artifactId> <artifactId>spring-security-jwt</artifactId>
<version>1.0.10.RELEASE</version>
</dependency> </dependency>
{{/system.enableOAuth2}}
{{#system.enableOracle}}
<!-- Oracle驱动包 -->
<dependency> <dependency>
<groupId>org.kie</groupId> <groupId>com.oracle.database.jdbc</groupId>
<artifactId>kie-spring</artifactId> <artifactId>ojdbc8</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.kie</groupId> <groupId>com.oracle.database.nls</groupId>
<artifactId>kie-api</artifactId> <artifactId>orai18n</artifactId>
</dependency> </dependency>
{{/system.enableOracle}}
{{#system.enablePostgreSQL}}
<!-- PostgreSQL驱动包 -->
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>org.postgresql</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>postgresql</artifactId>
</dependency>
{{/system.enablePostgreSQL}}
{{#system.enableMysql}}
<!-- MySQL驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
{{/system.enableMysql}}
<!-- JBPM -->
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow-builder</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bpmn2</artifactId>
</dependency>
<!-- MySQL数据库 --> <!-- MySQL数据库 -->
<dependency> <dependency>
...@@ -73,11 +117,7 @@ ...@@ -73,11 +117,7 @@
<artifactId>mapstruct-processor</artifactId> <artifactId>mapstruct-processor</artifactId>
</dependency> </dependency>
<!--MongoDB-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!--Liquibase数据库版本更新工具--> <!--Liquibase数据库版本更新工具-->
<dependency> <dependency>
......
...@@ -48,10 +48,12 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; ...@@ -48,10 +48,12 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
* 实体[{{entity.logicName}}] 服务对象接口实现 * 实体[{{entity.logicName}}] 服务对象接口实现
*/ */
@Slf4j @Slf4j
@Service("{{entity.codeName}}ServiceImpl") @Service("{{entity.codeName}}Service")
public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeName}}Mapper,{{entity.codeName}}> implements I{{entity.codeName}}Service { public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeName}}Mapper,{{entity.codeName}}> implements I{{entity.codeName}}Service {
protected I{{entity.codeName}}Service {{camelCase entity.codeName}}Service = SpringContextHolder.getBean(this.getClass()); protected I{{entity.codeName}}Service getProxyService() {
return SpringContextHolder.getBean(this.getClass());
}
{{#entity.relEntities}} {{#entity.relEntities}}
{{#neq storage "NONE"}} {{#neq storage "NONE"}}
...@@ -146,9 +148,9 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -146,9 +148,9 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
{{#if (or entity.actions.create.psDEActionLogics entity.isIndexSubDE)}} {{#if (or entity.actions.create.psDEActionLogics entity.isIndexSubDE)}}
for ({{entity.codeName}} et : list) { for ({{entity.codeName}} et : list) {
{{#if entity.unionKeyMode}} {{#if entity.unionKeyMode}}
{{camelCase entity.codeName}}Service.save(et); getProxyService().save(et);
{{else}} {{else}}
{{camelCase entity.codeName}}Service.create(et); getProxyService().create(et);
{{/if}} {{/if}}
} }
{{else}} {{else}}
...@@ -205,7 +207,7 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -205,7 +207,7 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
public boolean updateBatch(List<{{entity.codeName}}> list) { public boolean updateBatch(List<{{entity.codeName}}> list) {
{{#if (or entity.actions.update.psDEActionLogics entity.isIndexSubDE (not entity.keyField.phisicalDEField))}} {{#if (or entity.actions.update.psDEActionLogics entity.isIndexSubDE (not entity.keyField.phisicalDEField))}}
for ({{entity.codeName}} et : list) { for ({{entity.codeName}} et : list) {
{{camelCase entity.codeName}}Service.update(et); getProxyService().update(et);
} }
{{else}} {{else}}
{{#entity.hasReferences}} {{#entity.hasReferences}}
...@@ -222,9 +224,9 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -222,9 +224,9 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
{{#eq entity.actions.save.transactionMode "GLOBAL"}}@GlobalTransactional{{/eq}}{{#eq entity.actions.save.transactionMode "DEFAULT"}}@Transactional{{/eq}} {{#eq entity.actions.save.transactionMode "GLOBAL"}}@GlobalTransactional{{/eq}}{{#eq entity.actions.save.transactionMode "DEFAULT"}}@Transactional{{/eq}}
public boolean save({{entity.codeName}} et) { public boolean save({{entity.codeName}} et) {
if(checkKey(et)) if(checkKey(et))
return {{camelCase entity.codeName}}Service.update(et); return getProxyService().update(et);
else else
return {{camelCase entity.codeName}}Service.create(et); return getProxyService().create(et);
} }
{{#eq entity.actions.save.transactionMode "GLOBAL"}}@GlobalTransactional{{/eq}}{{#eq entity.actions.save.transactionMode "DEFAULT"}}@Transactional{{/eq}} {{#eq entity.actions.save.transactionMode "GLOBAL"}}@GlobalTransactional{{/eq}}{{#eq entity.actions.save.transactionMode "DEFAULT"}}@Transactional{{/eq}}
...@@ -246,9 +248,9 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -246,9 +248,9 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
_create.add(et); _create.add(et);
}); });
List rtList=new ArrayList<>(); List rtList=new ArrayList<>();
if(_update.size()>0 && (!{{camelCase entity.codeName}}Service.updateBatch(_update))) if(_update.size()>0 && (!getProxyService().updateBatch(_update)))
return false; return false;
if(_create.size()>0 && (!{{camelCase entity.codeName}}Service.createBatch(_create))) if(_create.size()>0 && (!getProxyService().createBatch(_create)))
return false; return false;
return true; return true;
} }
...@@ -297,7 +299,7 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -297,7 +299,7 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
public boolean removeBatch(Collection<{{entity.keyField.type.java}}> ids) { public boolean removeBatch(Collection<{{entity.keyField.type.java}}> ids) {
{{#if (or entity.actions.update.psDEActionLogics entity.isIndexSubDE (not entity.keyField.phisicalDEField) entity.hasPSDERsMapping)}} {{#if (or entity.actions.update.psDEActionLogics entity.isIndexSubDE (not entity.keyField.phisicalDEField) entity.hasPSDERsMapping)}}
for ({{entity.keyField.type.java}} et : ids) for ({{entity.keyField.type.java}} et : ids)
{{camelCase entity.codeName}}Service.remove(et); getProxyService().remove(et);
{{else}} {{else}}
if(!removeByIds(ids)) if(!removeByIds(ids))
return false; return false;
...@@ -359,11 +361,11 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -359,11 +361,11 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
else else
_create.add(sub); _create.add(sub);
} }
if(_update.size()>0 && (!{{camelCase entity.codeName}}Service.updateBatch(_update))) if(_update.size()>0 && (!getProxyService().updateBatch(_update)))
return false; return false;
if(_create.size()>0 && (!{{camelCase entity.codeName}}Service.createBatch(_create))) if(_create.size()>0 && (!getProxyService().createBatch(_create)))
return false; return false;
if(delIds.size()>0 && (!{{camelCase entity.codeName}}Service.removeBatch(delIds))) if(delIds.size()>0 && (!getProxyService().removeBatch(delIds)))
return false; return false;
return true; return true;
} }
......
...@@ -186,6 +186,7 @@ ribbon: ...@@ -186,6 +186,7 @@ ribbon:
#系统是否开启权限验证、是否开启缓存 #系统是否开启权限验证、是否开启缓存
#缓存级别:无缓存(无配置项)、一级缓存(L1)、二级缓存(L2) #缓存级别:无缓存(无配置项)、一级缓存(L1)、二级缓存(L2)
ibiz: ibiz:
systemid: {{system.codeName}}
enablePermissionValid: true enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存 cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
{{#eq system.saaSMode 4}} {{#eq system.saaSMode 4}}
......
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
@EnableDiscoveryClient @EnableDiscoveryClient
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
@ComponentScan(basePackages = {"{{packageName}}"} @ComponentScan(basePackages = {"{{packageName}}","cn.ibizlab.util"}}
// ,excludeFilters={ // ,excludeFilters={
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="{{packageName}}.${item.codeName?lower_case}.rest.xxx"), // @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="{{packageName}}.${item.codeName?lower_case}.rest.xxx"),
// } // }
...@@ -35,14 +35,14 @@ import java.util.List; ...@@ -35,14 +35,14 @@ import java.util.List;
{{#unless system.enableMongo}} {{#unless system.enableMongo}}
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class, org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
{{/unless}} {{/unless}}
{{#if system.enableDS}} {{#unless system.enableDS}}
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
{{/if}} {{/unless}}
}) })
@Import({ @Import({
org.springframework.cloud.openfeign.FeignClientsConfiguration.class org.springframework.cloud.openfeign.FeignClientsConfiguration.class
}) })
@EnableFeignClients(basePackages = {"{{packageName}}" }) @EnableFeignClients(basePackages = {"{{packageName}}","cn.ibizlab.util" })
@EnableAsync @EnableAsync
@EnableScheduling @EnableScheduling
public class {{system.codeName}}{{api.codeName}}Application extends WebMvcConfigurerAdapter{ public class {{system.codeName}}{{api.codeName}}Application extends WebMvcConfigurerAdapter{
......
server:
port: {{#if api.httpPort}}{{api.httpPort}}{{else}}8081{{/if}}
#Log配置
logging:
level:
{{packageName}}: info
\ No newline at end of file
spring:
profiles:
include: sys ,nacos, {{lowerCase api.codeName}}-prod
application:
name: {{projectName}}-{{lowerCase api.codeName}}
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<property name="LOG_PATH" value="logs" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %-40.40logger{39} : %msg%n" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}}</pattern>
</encoder>
</appender>
<!--<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">-->
<!-- <destination>127.0.0.1:9601</destination>-->
<!-- <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">-->
<!-- <customFields>{"appname":"{{projectName}}-{{lowerCase app.codeName}}"}</customFields>-->
<!-- </encoder>-->
<!--</appender>-->
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}/{{projectName}}-{{lowerCase api.codeName}}.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件最大的大小-->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="Console" />
<appender-ref ref="file" />
<!--<appender-ref ref="LOGSTASH" />-->
</root>
</configuration>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册