Compare commits

...

25 Commits

Author SHA1 Message Date
ycl
f8c3857928 更新 template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java 2025-12-23 11:59:40 +08:00
ycl
4b41dc2495 更新 template/pom.xml 2025-12-18 10:08:37 +08:00
dbd072ba69 订正配置 2025-12-16 11:28:08 +08:00
1949ab7b71 订正配置 2025-12-16 11:20:06 +08:00
d7b6fd766f 订正配置 2025-12-16 11:19:33 +08:00
a1d78a0493 订正oracle配置 2025-12-15 20:07:16 +08:00
ycl
8552430402 更新 template/pom.xml 2025-11-02 10:10:37 +08:00
ycl
d250632515 更新 template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java 2025-10-31 18:24:44 +08:00
ycl
dbeb15afac 更新 template/pom.xml 2025-10-31 18:20:25 +08:00
ycl
8efc67d143 删除 template/common/src/main/java/{{.packagePath}}/common/rocketmq/RocketMQServiceImpl.java 2025-10-31 18:17:24 +08:00
ycl
760c501af1 删除 template/common/src/main/java/{{.packagePath}}/common/rocketmq/RocketMQService.java 2025-10-31 18:17:19 +08:00
ycl
786f5bc4ef 删除 template/common/src/main/java/{{.packagePath}}/common/config/RocketMqAutoConfiguration.java 2025-10-31 18:16:50 +08:00
ycl
6836bd79db 删除 template/common/src/main/java/{{.packagePath}}/common/config/MqConfig.java 2025-10-31 18:16:45 +08:00
ycl
dbe118bde8 更新 template/pom.xml 2025-10-31 18:14:51 +08:00
ycl
f2e20ac6b2 更新 template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java 2025-10-31 18:14:20 +08:00
ycl
2fe8b3d933 更新 template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java 2025-10-31 18:10:25 +08:00
ycl
9510502ca9 更新 template/entrance/web/src/main/resources/application.properties 2025-10-31 18:01:21 +08:00
ycl
f3cceca7de 更新 template/entrance/web/src/main/resources/application.properties 2025-10-31 18:01:00 +08:00
ycl
d07f302db3 更新 template/entrance/web/src/main/resources/application.properties 2025-10-31 18:00:35 +08:00
ycl
da4b7eed5e 更新 template/entrance/web/src/main/resources/application-remote.properties 2025-10-31 17:56:24 +08:00
ycl
b189a14c8d 更新 template/entrance/web/src/main/resources/application-online.properties 2025-10-31 17:55:13 +08:00
ycl
4910965bf5 更新 template/entrance/web/src/main/resources/application-local.properties 2025-10-31 17:53:55 +08:00
ycl
bde0497cbb 更新 template/entrance/web/src/main/resources/application.properties 2025-10-31 17:53:10 +08:00
ycl
bbe18ae320 更新 template/entrance/web/src/main/resources/application.properties 2025-10-31 17:28:42 +08:00
ycl
3843efa135 更新 template/pom.xml 2025-10-31 17:25:16 +08:00
11 changed files with 106 additions and 484 deletions

View File

@@ -1,14 +0,0 @@
package {{ .package }}.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "rocketmq")
public class MqConfig {
private String nameServer;
private String topic;
private String consumerGroup;
}

View File

@@ -1,20 +0,0 @@
package {{ .package }}.common.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import {{ .package }}.common.config.MqConfig;
import {{ .package }}.common.rocketmq.RocketMQService;
import {{ .package }}.common.rocketmq.RocketMQServiceImpl;
@Configuration
public class RocketMqAutoConfiguration {
@Resource
private MqConfig mqConfig;
@Bean
RocketMQService createRocketMQService() {
RocketMQServiceImpl instance = new RocketMQServiceImpl(mqConfig.getNameServer());
return instance;
}
}

View File

@@ -1,88 +1,47 @@
package {{ .package }}.common.redis; package {{ .package }}.common.redis;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPoolConfig;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import java.util.HashSet;
import java.util.Set;
@Configuration @Configuration
@EnableConfigurationProperties({RedisPoolProperties.class}) @EnableConfigurationProperties({RedisPoolProperties.class})
@ConditionalOnProperty(name = "redis-config.pool.hostAndPort")
public class RedisPoolConfig { public class RedisPoolConfig {
@Autowired @Autowired
private RedisPoolProperties redisPoolProperties; private RedisPoolProperties redisPoolProperties;
@Value("${redis-config.pool.password:}") @Value("${redis-config.pool.password:}")
private String password; private String password;
/** private JedisPoolConfig initPoolConfig() {
* 连接池的基本配置
*
* @return JedisPoolConfig
*/
@Bean
public JedisPoolConfig initPoolConfig() {
JedisPoolConfig poolConfig = new JedisPoolConfig(); JedisPoolConfig poolConfig = new JedisPoolConfig();
// 设置最大连接数默认值为8.如果赋值为-1则表示不限制
poolConfig.setMaxTotal(redisPoolProperties.getMaxTotal()); poolConfig.setMaxTotal(redisPoolProperties.getMaxTotal());
// 最大空闲连接数
poolConfig.setMaxIdle(redisPoolProperties.getMaxIdle()); poolConfig.setMaxIdle(redisPoolProperties.getMaxIdle());
// 最小空闲连接数
poolConfig.setMinIdle(redisPoolProperties.getMinIdle()); poolConfig.setMinIdle(redisPoolProperties.getMinIdle());
// 获取Jedis连接的最大等待时间单位毫秒默认值为-1表示永不超时。如果超过等待时间则直接抛出JedisConnectionException
poolConfig.setMaxWaitMillis(redisPoolProperties.getMaxWaitMillis());
// 每次释放连接的最大数目
poolConfig.setNumTestsPerEvictionRun(redisPoolProperties.getNumTestsPerEvictionRun()); poolConfig.setNumTestsPerEvictionRun(redisPoolProperties.getNumTestsPerEvictionRun());
// 释放连接的扫描间隔(毫秒),如果为负数,则不运行逐出线程, 默认-1
poolConfig.setTimeBetweenEvictionRunsMillis(redisPoolProperties.getTimeBetweenEvictionRunsMillis());
// 连接最小空闲时间
poolConfig.setMinEvictableIdleTimeMillis(redisPoolProperties.getMinEvictableIdleTimeMillis());
// 连接空闲多久后释放, 当空闲时间>该值 且 空闲连接>最大空闲连接数 时直接释放
poolConfig.setSoftMinEvictableIdleTimeMillis(redisPoolProperties.getSoftMinEvictableIdleTimeMillis());
// 在获取Jedis连接时自动检验连接是否可用
poolConfig.setTestOnBorrow(redisPoolProperties.isTestOnBorrow()); poolConfig.setTestOnBorrow(redisPoolProperties.isTestOnBorrow());
// 在将连接放回池中前,自动检验连接是否有效
poolConfig.setTestOnReturn(redisPoolProperties.isTestOnReturn()); poolConfig.setTestOnReturn(redisPoolProperties.isTestOnReturn());
// 自动测试池中的空闲连接是否都是可用连接
poolConfig.setTestWhileIdle(redisPoolProperties.isTestWhileIdle()); poolConfig.setTestWhileIdle(redisPoolProperties.isTestWhileIdle());
// 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
poolConfig.setBlockWhenExhausted(redisPoolProperties.isBlockWhenExhausted()); poolConfig.setBlockWhenExhausted(redisPoolProperties.isBlockWhenExhausted());
// 是否启用pool的jmx管理功能, 默认true
poolConfig.setJmxEnabled(redisPoolProperties.isJmxEnabled()); poolConfig.setJmxEnabled(redisPoolProperties.isJmxEnabled());
// 是否启用后进先出, 默认true
poolConfig.setLifo(redisPoolProperties.isLifo()); poolConfig.setLifo(redisPoolProperties.isLifo());
// 每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3
poolConfig.setNumTestsPerEvictionRun(redisPoolProperties.getNumTestsPerEvictionRun()); poolConfig.setNumTestsPerEvictionRun(redisPoolProperties.getNumTestsPerEvictionRun());
poolConfig.setTestOnBorrow(false); poolConfig.setTestOnBorrow(false);
return poolConfig; return poolConfig;
} }
/**
* 创建JedisCluster客户端 将redis客户端放到容器中 连接redis集群
* Jedis 连接集群
*
* @return JedisCluster 使用完成后不需要手动释放连接,返回客户端, 使用完成后不需要手动释放连接, 客户端会自动释放连接
*/
// @Bean
// @Qualifier("JedisCluster")
// public JedisCluster getJedisCluster() {
// return new JedisCluster(getSet(), initPoolConfig());
// }
/** /**
* 单例版 需要手动获取jedis实例用完后需要手动释放 * create jedis poll
* *
* @return 返回redis连接池
*/ */
@Bean @Bean
public JedisPool getRedisPool() { public JedisPool getRedisPool() {
@@ -95,19 +54,4 @@ public class RedisPoolConfig {
} }
} }
/**
* 获取集群对象集合
*
* @return Set
*/
public Set<HostAndPort> getSet() {
String hostAndPortStr = redisPoolProperties.getHostAndPort();
String[] hostAndPortArrays = hostAndPortStr.trim().split(",");
Set<HostAndPort> hostAndPorts = new HashSet<>();
for (String hostAndPort : hostAndPortArrays) {
hostAndPorts.add(new HostAndPort(hostAndPort.split(":")[0], Integer.parseInt(hostAndPort.split(":")[1])));
}
return hostAndPorts;
}
} }

View File

@@ -1,7 +0,0 @@
package {{ .package }}.common.rocketmq;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
public interface RocketMQService {
DefaultMQPushConsumer getConsumer(String consumerGroup);
}

View File

@@ -1,34 +0,0 @@
package {{ .package }}.common.rocketmq;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.exception.MQClientException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Slf4j
public class RocketMQServiceImpl implements RocketMQService {
private String serverAddr = null;
public RocketMQServiceImpl(String serverAddr) {
this.serverAddr = serverAddr;
}
Map<String, DefaultMQPushConsumer> consumerMap = new ConcurrentHashMap<>();
@Override
@Synchronized
public DefaultMQPushConsumer getConsumer(String consumerGroup) {
DefaultMQPushConsumer defaultMQPushConsumer = consumerMap.get(consumerGroup);
if (defaultMQPushConsumer != null) {
return defaultMQPushConsumer;
}
DefaultMQPushConsumer instance = new DefaultMQPushConsumer(consumerGroup);
instance.setNamesrvAddr(this.serverAddr);
this.consumerMap.put(consumerGroup, instance);
return instance;
}
}

View File

@@ -9,11 +9,14 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(scanBasePackages = {"{{.groupId}}", "com.vs"}) @SpringBootApplication(scanBasePackages = {"{{.groupId}}", "com.vs"})
@VSDaoBeanScan(basePackages = {"com.vs","{{.groupId}}"}) @VSDaoBeanScan(basePackages = {"com.vs","{{.groupId}}"})
@Import(DataSourceConfig.class) @Import(DataSourceConfig.class)
@MapperScan("{{.groupId}}.**.persist.mapper.mybatis") @MapperScan("{{.groupId}}.**.persist.mapper.mybatis")
@EnableScheduling
public class AppApplication{ public class AppApplication{
public static void main(String[] args) { public static void main(String[] args) {

View File

@@ -1,131 +1,17 @@
server.port=8082 server.port=8082
endpoints.enabled=false
server.forward-headers-strategy=framework
#custom corss-domain headers, split by ','
cross.domain.headers=
#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
base.package={{.groupId}}
mock.enabled=true mock.enabled=true
# ?????
#datasource #datasource
{{- if eq .dbType "oracle" }} {{- if eq .dbType "oracle" }}
spring.datasource.url=jdbc:oracle:thin:@//{{ .dbHost }}:{{ .dbPort }}/ORCLCDB spring.datasource.url=jdbc:oracle:thin:@//{{ .dbHost }}:1521/ORCLCDB
{{- else if eq .dbType "postgresql" }} {{- else if eq .dbType "postgresql" }}
spring.datasource.url=jdbc:postgresql://{{ .dbHost }}:{{ .dbPort }}/{{ .dbDatabase }}?useUnicode=true&characterEncoding=utf8&autoReconnect=true&stringtype=unspecified spring.datasource.url=jdbc:postgresql://{{ .dbHost }}:5432/{{ .dbDatabase }}?useUnicode=true&characterEncoding=utf8&autoReconnect=true&stringtype=unspecified
{{- else if eq .dbType "mysql" }} {{- else if eq .dbType "mysql" }}
spring.datasource.url=jdbc:mysql://${DB_HOST:10.0.2.201:3306}/${DB_DATABASE:hande_test}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai spring.datasource.url=jdbc:mysql://${DB_HOST:10.0.2.201:3306}/${DB_DATABASE:hande_test}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
{{- else if eq .dbType "dm"}} {{- else if eq .dbType "dm"}}
spring.datasource.url=jdbc:dm://${ .dbHost }/${ .dbPort }/SYSDBA?characterEncoding=utf-8&serverTimezone=Asia/Shanghai spring.datasource.url=jdbc:dm://${ .dbHost }/5436/SYSDBA?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
{{- end }} {{- end }}
spring.datasource.username=${DB_USER:hande_test_user} spring.datasource.username=${DB_USER:hande_test_user}
spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5} spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5}
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
spring.datasource.tomcat.max-age=3600000
# Druid Data Source Config
{{- if eq .dbType "mysql" }}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
{{- else if eq .dbType "postgresql" }}
spring.datasource.driver-class-name=org.postgresql.Driver
vs.sqlmapper.dialect=postgresql
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
{{- else if eq .dbType "oracle" }}
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
vs.sqlmapper.dialect=oracle
{{- else if eq .dbType "dm" }}
spring.datasource.driver-class-name=dm.jdbc.driver.DmDriver
hibernate.dialect=org.hibernate.dialect.DmDialect
vs.sqlmapper.dialect=dm
{{- end }}
hibernate.show_sql=true
vs.sqlmapper.showSql=true
spring.datasource.tomcat.max-age=3600000
spring.jpa.open-in-view=false
spring.redis.host=${REDIS_HOST:redis.byteawake.com}
# flyway
spring.flyway.enabled=false
spring.flyway.outOfOrder=true
spring.flyway.baselineOnMigrate=true
spring.upload.file.path=/data/upload
spring.exception.isHtmlRequired=false
#spring.main.lazy-initialization=true
application.name=libawall
mybatis.configuration.map-underscore-to-camel-case=true
spring.url.aaa=http://localhost:8080
spring.websocket.enabled=false
spring.application.name=libawall
spring.security.enabled=false
spring.login.security.enableRoleRequired=false
spring.login.security.login=false
spring.security.authignored=/api/**,/rpc/**
#rocketmq
rocketmq.name-server=${ROCKETMQ_HOST:10.0.2.221:9876;10.0.2.222:9876;10.0.2.223:9876}
rocketmq.topic=${DB_DATABASE:hande_test}
rocketmq.consumerGroup=CID_handeTest
rocketmq.tag=*
rocketmq.producer.group=PID_handeTest
spring.main.allow-circular-references=true
spring.login.security.csrf=false
spring.main.allow-bean-definition-overriding=true
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
#elasticsearch
#essql.hosts=${OPENSEARCH_HOST:10.0.2.221,10.0.2.222,10.0.2.223}
#essql.port=9200
#essql.username=${OPENSEARCH_USER:admin}
#essql.password=${OPENSEARCH_PASSWORD:dnZkaNVK}
#essql.scheme=${OPENSEARCH_SCHEME:https}
#get user config
get_user_uri={}
#request header
out.request.headers=
#response header
out.response.headers=Content-Type
#eg:https://vsstudio.teitui.com
out.host=
#xxljob
xxl.job.admin.addresses=${XXL_JOB_ADMIN_ADDRESS:https://xxljob.teitui.com/xxl-job-admin}
xxl.job.executor.port=9999
xxl.job.executor.appname=handeTest
xxl.job.executor.title=handeTest
xxl.job.accessToken=default_token
xxl.job.admin.username=${XXL_JOB_ADMIN_USER:admin}
xxl.job.admin.password=${XXL_JOB_ADMIN_PASSWORD:123456}
#redis
redis-config.pool.hostAndPort=${REDIS_HOST:redis.byteawake.com:6379}
redis-config.pool.password=${REDIS_PASSWORD:}
redis-config.pool.maxTotal=100
redis-config.pool.maxIdle=10
redis-config.pool.minIdle=10
redis-config.pool.maxWaitMillis=10000
redis-config.pool.softMinEvictableIdleTimeMillis=10000
redis-config.pool.testOnBorrow=true
redis-config.pool.testOnReturn=true
redis-config.pool.testWhileIdle=true
redis-config.pool.timeBetweenEvictionRunsMillis=30000
redis-config.pool.minEvictableIdleTimeMillis=1800000
redis-config.pool.numTestsPerEvictionRun=3
redis-config.pool.blockWhenExhausted=true
redis-config.pool.jmxEnabled=true
redis-config.pool.lifo=true
#flow config
liteflow.rule-source=el_json:com.vs.flow.FlowRuleSource
liteflow.print-banner=false
liteflow.monitor.enable-log=true
#create default table auto
vs.db.basetable.create=true
server.ssl.enabled=false

View File

@@ -1,12 +1,5 @@
server.port=8080 server.port=8080
endpoints.enabled=false
server.forward-headers-strategy=framework
#custom corss-domain headers, split by ','
cross.domain.headers=
#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
base.package={{.groupId}}
# ?????
#datasource #datasource
{{- if eq .dbType "oracle" }} {{- if eq .dbType "oracle" }}
spring.datasource.url=jdbc:oracle:thin:@//{{ .dbHost }}:{{ .dbPort }}/ORCLCDB spring.datasource.url=jdbc:oracle:thin:@//{{ .dbHost }}:{{ .dbPort }}/ORCLCDB
@@ -21,96 +14,4 @@ spring.datasource.username=${DB_USER:hande_test_user}
spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5} spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5}
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
# Druid Data Source Config
{{- if eq .dbType "mysql" }}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
{{- else if eq .dbType "postgresql" }}
spring.datasource.driver-class-name=org.postgresql.Driver
vs.sqlmapper.dialect=postgresql
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
{{- else if eq .dbType "oracle" }}
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
vs.sqlmapper.dialect=oracle
{{- else if eq .dbType "dm" }}
spring.datasource.driver-class-name=dm.jdbc.driver.DmDriver
hibernate.dialect=org.hibernate.dialect.DmDialect
vs.sqlmapper.dialect=dm
{{- end }}
hibernate.show_sql=true
vs.sqlmapper.showSql=true
spring.datasource.tomcat.max-age=3600000
spring.jpa.open-in-view=false
spring.redis.host=${REDIS_HOST:redis.byteawake.com}
# flyway
spring.flyway.enabled=false
spring.flyway.outOfOrder=true
spring.flyway.baselineOnMigrate=true
mybatis.configuration.map-underscore-to-camel-case=true
#rocketmq
rocketmq.name-server=${ROCKETMQ_HOST}
rocketmq.topic=hande_test
rocketmq.consumerGroup=CID_handeTest
rocketmq.tag=*
rocketmq.producer.group=PID_handeTest
spring.main.allow-circular-references=true
spring.login.security.csrf=false
spring.main.allow-bean-definition-overriding=true
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
#elasticsearch
#essql.hosts=${OPENSEARCH_HOST}
#essql.port=9200
#essql.username=${OPENSEARCH_USER:admin}
#essql.password=${OPENSEARCH_PASSWORD:admin}
#essql.scheme=${OPENSEARCH_SCHEME:https}
#get user config
get_user_uri={}
#request header
out.request.headers=
#response header
out.response.headers=Content-Type
out.host=
#xxljob
xxl.job.admin.addresses=${XXL_JOB_ADMIN_ADDRESS}
xxl.job.executor.port=9999
xxl.job.executor.appname=handeTest
xxl.job.executor.title=handeTest
xxl.job.accessToken=default_token
xxl.job.admin.username=${XXL_JOB_ADMIN_USER:admin}
xxl.job.admin.password=${XXL_JOB_ADMIN_PASSWORD:123456}
#redis
redis-config.pool.hostAndPort=${REDIS_HOST}
redis-config.pool.password=${REDIS_PASSWORD}
redis-config.pool.maxTotal=100
redis-config.pool.maxIdle=10
redis-config.pool.minIdle=10
redis-config.pool.maxWaitMillis=10000
redis-config.pool.softMinEvictableIdleTimeMillis=10000
redis-config.pool.testOnBorrow=true
redis-config.pool.testOnReturn=true
redis-config.pool.testWhileIdle=true
redis-config.pool.timeBetweenEvictionRunsMillis=30000
redis-config.pool.minEvictableIdleTimeMillis=1800000
redis-config.pool.numTestsPerEvictionRun=3
redis-config.pool.blockWhenExhausted=true
redis-config.pool.jmxEnabled=true
redis-config.pool.lifo=true
#flow config
liteflow.rule-source=el_json:com.vs.flow.FlowRuleSource
liteflow.print-banner=false
liteflow.monitor.enable-log=true
#create default table auto
vs.db.basetable.create=true

View File

@@ -1,12 +1,5 @@
server.port=8080 server.port=8080
endpoints.enabled=false
server.forward-headers-strategy=framework
#custom corss-domain headers, split by ','
cross.domain.headers=
#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
base.package={{.groupId}}
# ?????
#datasource #datasource
{{- if eq .dbType "oracle" }} {{- if eq .dbType "oracle" }}
spring.datasource.url=jdbc:oracle:thin:@//{{ .dbHost }}:{{ .dbPort }}/ORCLCDB spring.datasource.url=jdbc:oracle:thin:@//{{ .dbHost }}:{{ .dbPort }}/ORCLCDB
@@ -20,99 +13,3 @@ spring.datasource.url=jdbc:dm://${ .dbHost }/${ .dbPort }/SYSDBA?characterEncodi
spring.datasource.username=${DB_USER:hande_test_user} spring.datasource.username=${DB_USER:hande_test_user}
spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5} spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5}
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
# Druid Data Source Config
{{- if eq .dbType "mysql" }}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
{{- else if eq .dbType "postgresql" }}
spring.datasource.driver-class-name=org.postgresql.Driver
vs.sqlmapper.dialect=postgresql
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
{{- else if eq .dbType "oracle" }}
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
vs.sqlmapper.dialect=oracle
{{- else if eq .dbType "dm" }}
spring.datasource.driver-class-name=dm.jdbc.driver.DmDriver
hibernate.dialect=org.hibernate.dialect.DmDialect
vs.sqlmapper.dialect=dm
{{- end }}
vs.sqlmapper.showSql=true
hibernate.show_sql=true
spring.datasource.tomcat.max-age=3600000
spring.jpa.open-in-view=false
spring.redis.host=${REDIS_HOST:redis.byteawake.com}
# flyway
spring.flyway.enabled=false
spring.flyway.outOfOrder=true
spring.flyway.baselineOnMigrate=true
mybatis.configuration.map-underscore-to-camel-case=true
#rocketmq
rocketmq.name-server=${ROCKETMQ_HOST:10.0.2.221:9876;10.0.2.222:9876;10.0.2.223:9876}
rocketmq.topic=${MYSQL_DATABASE:hande_test}
rocketmq.consumerGroup=CID_handeTest
rocketmq.tag=*
rocketmq.producer.group=PID_handeTest
spring.main.allow-circular-references=true
spring.login.security.csrf=false
spring.main.allow-bean-definition-overriding=true
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
#elasticsearch
#essql.hosts=${OPENSEARCH_HOST:10.0.2.221,10.0.2.222,10.0.2.223}
#essql.port=9200
#essql.username=${OPENSEARCH_USER:admin}
#essql.password=${OPENSEARCH_PASSWORD:dnZkaNVK}
#essql.scheme=${OPENSEARCH_SCHEME:https}
#get user config
get_user_uri={}
#request header
out.request.headers=
#response header
out.response.headers=Content-Type
#eg:https://vsstudio.teitui.com
out.host=
#xxljob
xxl.job.admin.addresses=${XXL_JOB_ADMIN_ADDRESS:https://xxljob.teitui.com/xxl-job-admin}
xxl.job.executor.port=9999
xxl.job.executor.appname=handeTest
xxl.job.executor.title=handeTest
xxl.job.accessToken=default_token
xxl.job.admin.username=${XXL_JOB_ADMIN_USER:admin}
xxl.job.admin.password=${XXL_JOB_ADMIN_PASSWORD:123456}
#redis
redis-config.pool.hostAndPort=${REDIS_HOST:redis.byteawake.com:6379}
redis-config.pool.password=${REDIS_PASSWORD:}
redis-config.pool.maxTotal=100
redis-config.pool.maxIdle=10
redis-config.pool.minIdle=10
redis-config.pool.maxWaitMillis=10000
redis-config.pool.softMinEvictableIdleTimeMillis=10000
redis-config.pool.testOnBorrow=true
redis-config.pool.testOnReturn=true
redis-config.pool.testWhileIdle=true
redis-config.pool.timeBetweenEvictionRunsMillis=30000
redis-config.pool.minEvictableIdleTimeMillis=1800000
redis-config.pool.numTestsPerEvictionRun=3
redis-config.pool.blockWhenExhausted=true
redis-config.pool.jmxEnabled=true
redis-config.pool.lifo=true
#flow config
liteflow.rule-source=el_json:com.vs.flow.FlowRuleSource
liteflow.print-banner=false
liteflow.monitor.enable-log=true
#create default table auto
vs.db.basetable.create=true

View File

@@ -1,10 +1,71 @@
spring.profiles.active=local spring.profiles.active=local
envs=local,remote,online,custom envs=local,remote,online,custom
spring.main.allow-bean-definition-overriding=true
project_id=${projectId}
project_name=handeTest
check=true check=true
spring.main.allow-bean-definition-overriding=true
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
#注销掉es的自动装配 spring.jpa.open-in-view=false
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration spring.main.allow-circular-references=true
com.toco.agent.attach=true spring.login.security.csrf=false
application.name={{ .projectName }}
mybatis.configuration.map-underscore-to-camel-case=true
project_id={{ .projectId }}
project_name={{ .projectName }}
base.package={{.groupId}}
{{- if eq .dbType "mysql" }}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
{{- else if eq .dbType "postgresql" }}
spring.datasource.driver-class-name=org.postgresql.Driver
vs.sqlmapper.dialect=postgresql
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
{{- else if eq .dbType "oracle" }}
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
vs.sqlmapper.dialect=oracle
{{- else if eq .dbType "dm" }}
spring.datasource.driver-class-name=dm.jdbc.driver.DmDriver
hibernate.dialect=org.hibernate.dialect.DmDialect
vs.sqlmapper.dialect=dm
{{- end }}
com.toco.agent.attach=false
#create default table
vs.db.basetable.create=true
server.ssl.enabled=false
server.forward-headers-strategy=framework
#request header
out.request.headers=
#response header
out.response.headers=Content-Type
#custom corss-domain headers, split by ','
cross.domain.headers=
#eg:https://vsstudio.teitui.com
out.host=
#hibernate.show_sql=true
#vs.sqlmapper.showSql=true
mock.enabled=false
## message config , use memory for test, mq.type can be redis/rocketmq/kafka
mq.type=memory
#rocketmq.name-server=${ROCKETMQ_HOST:10.0.2.221:9876;10.0.2.222:9876;10.0.2.223:9876}
#redis
#redis-config.pool.hostAndPort=${REDIS_HOST:redis.byteawake.com:6379}
#redis-config.pool.password=${REDIS_PASSWORD:}
#redis-config.pool.maxTotal=100
#redis-config.pool.maxIdle=10
#redis-config.pool.minIdle=10
#redis-config.pool.maxWaitMillis=10000
#redis-config.pool.softMinEvictableIdleTimeMillis=10000
#redis-config.pool.testOnBorrow=true
#redis-config.pool.testOnReturn=true
#redis-config.pool.testWhileIdle=true
#redis-config.pool.timeBetweenEvictionRunsMillis=30000
#redis-config.pool.minEvictableIdleTimeMillis=1800000
#redis-config.pool.numTestsPerEvictionRun=3
#redis-config.pool.blockWhenExhausted=true
#redis-config.pool.jmxEnabled=true
#redis-config.pool.lifo=true
#kafka.bootstrap-servers=localhost:9092

View File

@@ -47,11 +47,6 @@
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.2.3</version> <version>1.2.3</version>
</dependency> </dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>5.2.4</version>
</dependency>
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
@@ -168,26 +163,36 @@
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
<version>5.7.4</version> <version>5.7.4</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.apache.rocketmq</groupId> <!-- <groupId>org.apache.rocketmq</groupId>-->
<artifactId>rocketmq-spring-boot</artifactId> <!-- <artifactId>rocketmq-spring-boot</artifactId>-->
<version>2.2.0</version> <!-- <version>2.2.0</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.apache.rocketmq</groupId> <!-- <groupId>org.apache.rocketmq</groupId>-->
<artifactId>rocketmq-tools</artifactId> <!-- <artifactId>rocketmq-tools</artifactId>-->
<version>4.7.1</version> <!-- <version>4.7.1</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.apache.rocketmq</groupId> <!-- <groupId>org.apache.rocketmq</groupId>-->
<artifactId>rocketmq-client</artifactId> <!-- <artifactId>rocketmq-client</artifactId>-->
<version>4.7.1</version> <!-- <version>4.7.1</version>-->
</dependency> <!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.kafka</groupId>-->
<!-- <artifactId>kafka-clients</artifactId>-->
<!-- <version>3.6.1</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.18.20</version> <version>1.18.20</version>
</dependency> </dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId> <artifactId>spring-boot-dependencies</artifactId>
@@ -218,7 +223,7 @@
<dependency> <dependency>
<groupId>io.github.think-1024</groupId> <groupId>io.github.think-1024</groupId>
<artifactId>toco-all-spring5-springboot2</artifactId> <artifactId>toco-all-spring5-springboot2</artifactId>
<version>1.0</version> <version>2.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.tomcat.embed</groupId> <groupId>org.apache.tomcat.embed</groupId>
@@ -276,9 +281,9 @@
</dependency> </dependency>
{{- else if eq .dbType "oracle" }} {{- else if eq .dbType "oracle" }}
<dependency> <dependency>
<groupId>com.oracle</groupId> <groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId> <artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version> <version>21.9.0.0</version>
</dependency> </dependency>
{{- end }} {{- end }}
</dependencies> </dependencies>