init commit
This commit is contained in:
55
template/entrance/web/pom.xml
Normal file
55
template/entrance/web/pom.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>{{ .groupId }}</groupId>
|
||||
<artifactId>{{ .artifactId }}-entrance</artifactId>
|
||||
<version>{{ .version }}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>{{ .artifactId }}-entrance-web</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.vs</groupId>
|
||||
<artifactId>ox-springboot-web-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vs</groupId>
|
||||
<artifactId>vs-sqlmapper-spring</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>{{ .groupId }}</groupId>
|
||||
<artifactId>{{ .artifactId }}-entrance-mq</artifactId>
|
||||
<version>{{ .version }}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vs</groupId>
|
||||
<artifactId>vs-mock-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vs</groupId>
|
||||
<artifactId>vs-debug-agent</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vs</groupId>
|
||||
<artifactId>vs-debug-plugin</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<layers>
|
||||
<enabled>true</enabled>
|
||||
</layers>
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,48 @@
|
||||
package {{ .package }}.entrance.web;
|
||||
|
||||
import com.vs.debug.stack.config.EnableVSReplayConfiguration;
|
||||
import com.vs.sqlmapper.spring.DataSourceConfig;
|
||||
import com.vs.sqlmapper.spring.scan.VSDaoBeanScan;
|
||||
import com.vs.mock.config.EnableVSMockConfiguration;
|
||||
import com.vs.sqlmapper.spring.express.EnableVSMockExpress;
|
||||
|
||||
import com.vs.debug.stack.agent.LogStackContextInvokeRecorder;
|
||||
import com.vs.debug.stack.agent.MethodVisitorHandlerFilter;
|
||||
import com.vs.debug.stack.agent.StackContextInvokeRecorder;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
|
||||
/**
|
||||
* 应用入口
|
||||
*
|
||||
* @author byteawake
|
||||
* @date 2021/5/11 下午5:30
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = {"{{ .groupId }}", "com.vs", "{{ .groupId }}.index_sync"})
|
||||
@VSDaoBeanScan(basePackages = {"com.vs","{{ .groupId }}"})
|
||||
@Import(DataSourceConfig.class)
|
||||
@EnableVSReplayConfiguration
|
||||
@EnableVSMockConfiguration
|
||||
@EnableVSMockExpress
|
||||
public class AppApplication{
|
||||
|
||||
// @Bean(name = "stackContextInvokeRecorder")
|
||||
// public StackContextInvokeRecorder createStackContextInvokeRecorder() throws Exception {
|
||||
// return new LogStackContextInvokeRecorder(); // 可以根据需求扩展实现
|
||||
// }
|
||||
|
||||
@Bean
|
||||
public MethodVisitorHandlerFilter createMethodVisitorHandlerFilter() {
|
||||
StackContextInvokeRecorder stackContextInvokeRecorder = new LogStackContextInvokeRecorder();
|
||||
return new MethodVisitorHandlerFilter(stackContextInvokeRecorder);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AppApplication.class,args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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
|
||||
spring.datasource.url=jdbc:{{ .dbType }}://${DB_HOST:{{ .dbHost }}:{{ .dbPort }}}/${DB_DATABASE:{{ .dbDatabase }}}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=${DB_USER:{{ .dbUser }}}
|
||||
spring.datasource.password=${DB_PASSWORD:{{ .dbPassword }}}
|
||||
{{- 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
|
||||
{{- end }}
|
||||
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
|
||||
spring.datasource.tomcat.max-age=3600000
|
||||
spring.jpa.open-in-view=false
|
||||
|
||||
# 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_address }}}
|
||||
rocketmq.topic=${DB_DATABASE:{{ .rocketmq_topic }}}
|
||||
rocketmq.consumerGroup={{ .rocketmq_consumerGroup }}
|
||||
rocketmq.tag=*
|
||||
rocketmq.producer.group={{ .rocketmq_producerGroup }}
|
||||
|
||||
#elasticsearch
|
||||
essql.hosts=${OPENSEARCH_HOST:{{ .elasticsearch_host }}}
|
||||
essql.port={{ .elasticsearch_port }}
|
||||
essql.username=${OPENSEARCH_USER:{{ .elasticsearch_username }}}
|
||||
essql.password=${OPENSEARCH_PASSWORD:{{ .elasticsearch_password }}}
|
||||
essql.scheme=${OPENSEARCH_SCHEME:{{ .elasticsearch_scheme }}}
|
||||
|
||||
#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:{{ .xxljob_address }}}
|
||||
xxl.job.executor.port=9999
|
||||
xxl.job.executor.appname={{ .artifactId }}
|
||||
xxl.job.executor.title={{ .artifactId }}
|
||||
xxl.job.accessToken={{ .xxljob_accessToken }}
|
||||
xxl.job.admin.username=${XXL_JOB_ADMIN_USER:{{ .xxljob_username }}}
|
||||
xxl.job.admin.password=${XXL_JOB_ADMIN_PASSWORD:{{ .xxljob_password }}}
|
||||
|
||||
#redis
|
||||
redis-config.pool.hostAndPort=${REDIS_HOST:{{ .redis_address }}}
|
||||
redis-config.pool.password=${REDIS_PASSWORD:{{ .redis_password }}}
|
||||
redis-config.pool.maxTotal={{ .redis_maxTotal }}
|
||||
redis-config.pool.maxIdle={{ .redis_maxIdle }}
|
||||
redis-config.pool.minIdle={{ .redis_minIdle }}
|
||||
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
|
||||
@@ -0,0 +1,82 @@
|
||||
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
|
||||
spring.datasource.url=jdbc:{{ .dbType }}://${DB_HOST:{{ .dbHost }}:{{ .dbPort }}}/${DB_DATABASE:{{ .dbDatabase }}}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=${DB_USER:{{ .dbUser }}}
|
||||
spring.datasource.password=${DB_PASSWORD:{{ .dbPassword }}}
|
||||
{{- 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
|
||||
{{- end }}
|
||||
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
|
||||
spring.datasource.tomcat.max-age=3600000
|
||||
spring.jpa.open-in-view=false
|
||||
|
||||
# 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={{ .rocketmq_topic }}
|
||||
rocketmq.consumerGroup={{ .rocketmq_consumerGroup }}
|
||||
rocketmq.tag=*
|
||||
rocketmq.producer.group={{ .rocketmq_producerGroup }}
|
||||
|
||||
#elasticsearch
|
||||
essql.hosts=${OPENSEARCH_HOST}
|
||||
essql.port={{ .elasticsearch_port }}
|
||||
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={{ .artifactId }}
|
||||
xxl.job.executor.title={{ .artifactId }}
|
||||
xxl.job.accessToken={{ .xxljob_accessToken }}
|
||||
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={{ .redis_maxTotal }}
|
||||
redis-config.pool.maxIdle={{ .redis_maxIdle }}
|
||||
redis-config.pool.minIdle={{ .redis_minIdle }}
|
||||
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
|
||||
@@ -0,0 +1,83 @@
|
||||
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
|
||||
spring.datasource.url=jdbc:{{ .dbType }}://${DB_HOST:{{ .dbHost }}:{{ .dbPort }}}/${DB_DATABASE:{{ .dbDatabase }}}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=${DB_USER:{{ .dbUser }}}
|
||||
spring.datasource.password=${DB_PASSWORD:{{ .dbPassword }}}
|
||||
{{- 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
|
||||
{{- end }}
|
||||
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
|
||||
spring.datasource.tomcat.max-age=3600000
|
||||
spring.jpa.open-in-view=false
|
||||
|
||||
# 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_address }}}
|
||||
rocketmq.topic=${MYSQL_DATABASE:{{ .rocketmq_topic }}}
|
||||
rocketmq.consumerGroup={{ .rocketmq_consumerGroup }}
|
||||
rocketmq.tag=*
|
||||
rocketmq.producer.group={{ .rocketmq_producerGroup }}
|
||||
|
||||
#elasticsearch
|
||||
essql.hosts=${OPENSEARCH_HOST:{{ .elasticsearch_host }}}
|
||||
essql.port={{ .elasticsearch_port }}
|
||||
essql.username=${OPENSEARCH_USER:{{ .elasticsearch_username }}}
|
||||
essql.password=${OPENSEARCH_PASSWORD:{{ .elasticsearch_password }}}
|
||||
essql.scheme=${OPENSEARCH_SCHEME:{{ .elasticsearch_scheme }}}
|
||||
|
||||
#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:{{ .xxljob_address }}}
|
||||
xxl.job.executor.port=9999
|
||||
xxl.job.executor.appname={{ .artifactId }}
|
||||
xxl.job.executor.title={{ .artifactId }}
|
||||
xxl.job.accessToken={{ .xxljob_accessToken }}
|
||||
xxl.job.admin.username=${XXL_JOB_ADMIN_USER:{{ .xxljob_username }}}
|
||||
xxl.job.admin.password=${XXL_JOB_ADMIN_PASSWORD:{{ .xxljob_password }}}
|
||||
|
||||
#redis
|
||||
redis-config.pool.hostAndPort=${REDIS_HOST:{{ .redis_address }}}
|
||||
redis-config.pool.password=${REDIS_PASSWORD:{{ .redis_password }}}
|
||||
redis-config.pool.maxTotal={{ .redis_maxTotal }}
|
||||
redis-config.pool.maxIdle={{ .redis_maxIdle }}
|
||||
redis-config.pool.minIdle={{ .redis_minIdle }}
|
||||
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
|
||||
@@ -0,0 +1,5 @@
|
||||
spring.profiles.active=local
|
||||
envs=local,remote,online,custom
|
||||
|
||||
project_id=${projectId}
|
||||
project_name={{ .artifactId }}
|
||||
26
template/entrance/web/src/main/resources/visitor_agents.conf
Normal file
26
template/entrance/web/src/main/resources/visitor_agents.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
[debug.server.host]
|
||||
// 这块,目前基本是写死这样的配置,不要修改
|
||||
vs.debug.host = http://vsstudio.teitui.com
|
||||
|
||||
[debug.proxy.custom]
|
||||
// 定义需要增强的classs,没有增加的class不记录堆栈
|
||||
// 一般明显不需要记录的class,配置成: class.name=false
|
||||
// 正则表述式支持,请注意书写
|
||||
// class.pattern = true 表示要增强记录堆栈的
|
||||
|
||||
// 自定义的增加的类
|
||||
|
||||
com.vs.entrance.controller.env.register.DebugEnvRegisterTask=false
|
||||
com.vs.common.util.rpc.pub.PublicInterfaceExecutor = true +[execute]
|
||||
com.vs.common.util.rpc.pub.PublicInterfaceFilter = true +[doFilter]
|
||||
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter=true
|
||||
|
||||
com.vs.sqlmapper.core.SqlManagerImpl = true +[sqlWatcher]
|
||||
com.vs.common.util.rpc.RpcMethodExecutor = true
|
||||
|
||||
[debug.proxy.service]
|
||||
// 默认支持serivce下面的所有类,放到最后一行
|
||||
|
||||
.*?\.service[\.\w_]+ = true -[set*, get*]
|
||||
.*?\.controller[\.\w_]+ = true -[set*, get*]
|
||||
.*?\.hibernate[\.\w_]+ = false
|
||||
@@ -0,0 +1,14 @@
|
||||
package {{ .package }}.entrance.web;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class AppApplicationTest {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user