first commit
This commit is contained in:
34
template/.gitignore
vendored
Normal file
34
template/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
## java
|
||||||
|
bin/
|
||||||
|
classes/
|
||||||
|
|
||||||
|
|
||||||
|
## eclipse
|
||||||
|
.settings/
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
|
||||||
|
## idea
|
||||||
|
*.iml
|
||||||
|
.idea/**
|
||||||
|
!.idea/dataSources.xml
|
||||||
|
HELP.md
|
||||||
|
|
||||||
|
## vscode
|
||||||
|
.vscode/
|
||||||
|
.factorypath
|
||||||
|
|
||||||
|
## maven:
|
||||||
|
target/
|
||||||
|
test-output/
|
||||||
|
|
||||||
|
## system
|
||||||
|
.DS_Store
|
||||||
|
logs/
|
||||||
|
*.log
|
||||||
|
|
||||||
|
## vs
|
||||||
|
.vs
|
||||||
|
!modules/.gitkeep
|
||||||
|
.gitattributes
|
||||||
|
.toco/config.local.yml
|
||||||
1
template/.mvn/jvm.config
Normal file
1
template/.mvn/jvm.config
Normal file
@@ -0,0 +1 @@
|
|||||||
|
-Xmx1536m
|
||||||
BIN
template/.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
template/.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
20
template/.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
20
template/.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
distributionUrl=https://maven.aliyun.com/repository/public/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
|
||||||
|
distributionSha256Sum=7822eb593d29558d8edf87845a2c47e36e2a89d17a84cd2390824633214ed423
|
||||||
|
wrapperUrl=https://maven.aliyun.com/repository/public/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
|
||||||
|
wrapperUrlSha256Sum=e63a53cfb9c4d291ebe3c2b0edacb7622bbc480326beaa5a0456e412f52f066a
|
||||||
1
template/.values.yml
Normal file
1
template/.values.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{{ toYaml . }}
|
||||||
20
template/Dockerfile
Normal file
20
template/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
FROM maven:3.8.8 as builder
|
||||||
|
WORKDIR source
|
||||||
|
COPY ./ ./
|
||||||
|
ARG JAR_FILE=entrance/web/target/*.jar
|
||||||
|
RUN mvn clean package -Dmaven.test.skip=true
|
||||||
|
RUN cp ${JAR_FILE} app.jar
|
||||||
|
RUN java -Djarmode=layertools -jar ./app.jar extract
|
||||||
|
|
||||||
|
FROM openjdk:11.0.14
|
||||||
|
WORKDIR /application
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
RUN echo 'Asia/Shanghai' >/etc/timezone
|
||||||
|
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
|
||||||
|
COPY --from=builder source/dependencies/ ./
|
||||||
|
COPY --from=builder source/snapshot-dependencies/ ./
|
||||||
|
COPY --from=builder source/spring-boot-loader/ ./
|
||||||
|
COPY --from=builder source/application/ ./
|
||||||
|
ENV JAVA_OPTS="-Xms512m -Xmx512m"
|
||||||
|
ENV MAIN_CLASS="org.springframework.boot.loader.JarLauncher"
|
||||||
|
ENTRYPOINT ["sh", "-c", "exec java ${JAVA_OPTS} -Djava.security.egd=file:dev/./urandom ${MAIN_CLASS}"]
|
||||||
5
template/common/README.md
Normal file
5
template/common/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
> 本模块存放公共组件
|
||||||
|
``` \-- *.utils(工具类; package)
|
||||||
|
\-- *.enums(公共枚举; package)
|
||||||
|
\-- *.constants(公共常量; package)
|
||||||
|
```
|
||||||
66
template/common/pom.xml
Normal file
66
template/common/pom.xml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?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 }}</artifactId>
|
||||||
|
<version>{{ .version }}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>{{ .groupId }}</groupId>
|
||||||
|
<artifactId>{{ .artifactId }}-common</artifactId>
|
||||||
|
<version>{{ .version }}</version>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.annotation</groupId>
|
||||||
|
<artifactId>javax.annotation-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
<artifactId>transport</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>redis.clients</groupId>
|
||||||
|
<artifactId>jedis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch</groupId>
|
||||||
|
<artifactId>elasticsearch</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package {{ .package }}.common.config;
|
||||||
|
|
||||||
|
import io.micrometer.core.instrument.Clock;
|
||||||
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
|
import io.micrometer.core.instrument.MockClock;
|
||||||
|
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
> 本模块存放公共常量
|
||||||
|
``` \-- *Constant.java
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package {{ .package }}.common.elasticsearch;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ConfigurationProperties(prefix = "essql")
|
||||||
|
@Component
|
||||||
|
public class ESConfig {
|
||||||
|
private String url;
|
||||||
|
private String password;
|
||||||
|
private String username;
|
||||||
|
private String hosts;
|
||||||
|
private int port;
|
||||||
|
private String scheme;
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
package {{ .package }}.common.elasticsearch;
|
||||||
|
|
||||||
|
import org.apache.http.HttpHost;
|
||||||
|
import org.apache.http.auth.AuthScope;
|
||||||
|
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||||
|
import org.apache.http.client.CredentialsProvider;
|
||||||
|
import org.apache.http.client.config.RequestConfig;
|
||||||
|
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||||
|
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
||||||
|
import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
|
||||||
|
import org.elasticsearch.client.RestClient;
|
||||||
|
import org.elasticsearch.client.RestClientBuilder;
|
||||||
|
import org.elasticsearch.client.RestHighLevelClient;
|
||||||
|
import org.elasticsearch.common.Nullable;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.net.ssl.*;
|
||||||
|
import java.security.KeyManagementException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Objects;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConditionalOnProperty(name = "essql.hosts")
|
||||||
|
public class EsConfiguration {
|
||||||
|
private static int connectTimeOut = 1000; // 连接超时时间
|
||||||
|
private static int socketTimeOut = 30000; // 连接超时时间
|
||||||
|
private static int connectionRequestTimeOut = 500; // 获取连接的超时时间
|
||||||
|
|
||||||
|
private static int maxConnectNum = 100; // 最大连接数
|
||||||
|
private static int maxConnectPerRoute = 100; // 最大路由连接数
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ESConfig esConfig;
|
||||||
|
|
||||||
|
private ArrayList<HttpHost> hostList = null;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
void init(){
|
||||||
|
hostList = new ArrayList<>();
|
||||||
|
String[] hostStrs = esConfig.getHosts().split(",");
|
||||||
|
for (String host : hostStrs) {
|
||||||
|
hostList.add(new HttpHost(host, esConfig.getPort(), esConfig.getScheme()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public RestHighLevelClient client() {
|
||||||
|
RestClientBuilder builder = RestClient.builder(hostList.toArray(new HttpHost[0]));
|
||||||
|
// 异步httpclient连接延时配置
|
||||||
|
builder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
|
||||||
|
@Override
|
||||||
|
public RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder requestConfigBuilder) {
|
||||||
|
requestConfigBuilder.setConnectTimeout(connectTimeOut);
|
||||||
|
requestConfigBuilder.setSocketTimeout(socketTimeOut);
|
||||||
|
requestConfigBuilder.setConnectionRequestTimeout(connectionRequestTimeOut);
|
||||||
|
return requestConfigBuilder;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
||||||
|
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(esConfig.getUsername(), esConfig.getPassword()));
|
||||||
|
|
||||||
|
SSLContext sc = null;
|
||||||
|
try{
|
||||||
|
sc = SSLContext.getInstance("SSL");
|
||||||
|
sc.init(null, trustAllCerts, new SecureRandom());
|
||||||
|
}catch(KeyManagementException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}catch(NoSuchAlgorithmException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(sc, new NullHostNameVerifier());
|
||||||
|
SecuredHttpClientConfigCallback httpClientConfigCallback = new SecuredHttpClientConfigCallback(sessionStrategy,credentialsProvider);
|
||||||
|
|
||||||
|
// 异步httpclient连接数配置
|
||||||
|
builder.setHttpClientConfigCallback(httpClientConfigCallback);
|
||||||
|
|
||||||
|
RestHighLevelClient client = new RestHighLevelClient(builder);
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static class NullHostNameVerifier implements HostnameVerifier {
|
||||||
|
@Override
|
||||||
|
public boolean verify(String arg0, SSLSession arg1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SecuredHttpClientConfigCallback implements RestClientBuilder.HttpClientConfigCallback {
|
||||||
|
@Nullable
|
||||||
|
private final CredentialsProvider credentialsProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link SSLIOSessionStrategy} for all requests to enable SSL / TLS encryption.
|
||||||
|
*/
|
||||||
|
private final SSLIOSessionStrategy sslStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new {@link SecuredHttpClientConfigCallback}.
|
||||||
|
*
|
||||||
|
* @param credentialsProvider The credential provider, if a username/password have been supplied
|
||||||
|
* @param sslStrategy The SSL strategy, if SSL / TLS have been supplied
|
||||||
|
* @throws NullPointerException if {@code sslStrategy} is {@code null}
|
||||||
|
*/
|
||||||
|
SecuredHttpClientConfigCallback(final SSLIOSessionStrategy sslStrategy,
|
||||||
|
@Nullable final CredentialsProvider credentialsProvider) {
|
||||||
|
this.sslStrategy = Objects.requireNonNull(sslStrategy);
|
||||||
|
this.credentialsProvider = credentialsProvider;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the {@link CredentialsProvider} that will be added to the HTTP client.
|
||||||
|
* @return Can be {@code null}.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
CredentialsProvider getCredentialsProvider() {
|
||||||
|
return credentialsProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the {@link SSLIOSessionStrategy} that will be added to the HTTP client.
|
||||||
|
*
|
||||||
|
* @return Never {@code null}.
|
||||||
|
*/
|
||||||
|
SSLIOSessionStrategy getSSLStrategy() {
|
||||||
|
return sslStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@linkplain HttpAsyncClientBuilder#setDefaultCredentialsProvider(CredentialsProvider) credential provider},
|
||||||
|
*
|
||||||
|
* @param httpClientBuilder The client to configure.
|
||||||
|
* @return Always {@code httpClientBuilder}.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public HttpAsyncClientBuilder customizeHttpClient(final HttpAsyncClientBuilder httpClientBuilder) {
|
||||||
|
// enable SSL / TLS
|
||||||
|
httpClientBuilder.setSSLStrategy(sslStrategy);
|
||||||
|
|
||||||
|
// enable user authentication
|
||||||
|
if (credentialsProvider != null) {
|
||||||
|
httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
|
||||||
|
}
|
||||||
|
httpClientBuilder.setMaxConnTotal(maxConnectNum);
|
||||||
|
httpClientBuilder.setMaxConnPerRoute(maxConnectPerRoute);
|
||||||
|
return httpClientBuilder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,509 @@
|
|||||||
|
package {{ .package }}.common.elasticsearch;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.elasticsearch.action.admin.indices.alias.Alias;
|
||||||
|
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
|
||||||
|
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
|
||||||
|
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
||||||
|
import org.elasticsearch.action.bulk.BulkItemResponse;
|
||||||
|
import org.elasticsearch.action.bulk.BulkRequest;
|
||||||
|
import org.elasticsearch.action.bulk.BulkResponse;
|
||||||
|
import org.elasticsearch.action.delete.DeleteRequest;
|
||||||
|
import org.elasticsearch.action.delete.DeleteResponse;
|
||||||
|
import org.elasticsearch.action.get.GetRequest;
|
||||||
|
import org.elasticsearch.action.get.GetResponse;
|
||||||
|
import org.elasticsearch.action.index.IndexRequest;
|
||||||
|
import org.elasticsearch.action.index.IndexResponse;
|
||||||
|
import org.elasticsearch.action.search.SearchRequest;
|
||||||
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
|
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||||
|
import org.elasticsearch.action.update.UpdateRequest;
|
||||||
|
import org.elasticsearch.action.update.UpdateResponse;
|
||||||
|
import org.elasticsearch.client.GetAliasesResponse;
|
||||||
|
import org.elasticsearch.client.RequestOptions;
|
||||||
|
import org.elasticsearch.client.RestClient;
|
||||||
|
import org.elasticsearch.client.RestHighLevelClient;
|
||||||
|
import org.elasticsearch.client.indices.CreateIndexRequest;
|
||||||
|
import org.elasticsearch.client.indices.CreateIndexResponse;
|
||||||
|
import org.elasticsearch.client.indices.GetIndexRequest;
|
||||||
|
import org.elasticsearch.client.indices.PutMappingRequest;
|
||||||
|
import org.elasticsearch.common.Strings;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.common.text.Text;
|
||||||
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
|
import org.elasticsearch.common.xcontent.XContentType;
|
||||||
|
import org.elasticsearch.rest.RestStatus;
|
||||||
|
import org.elasticsearch.search.SearchHit;
|
||||||
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
|
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
|
||||||
|
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
|
||||||
|
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
|
||||||
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import org.springframework.context.annotation.Conditional;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
|
||||||
|
|
||||||
|
import {{ .package }}.common.utils.JsonUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* es 的工具类
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConditionalOnProperty(name = "essql.hosts")
|
||||||
|
public class EsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RestHighLevelClient restHighLevelClient;
|
||||||
|
|
||||||
|
private Logger log = LoggerFactory.getLogger(EsService.class);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关键字
|
||||||
|
*/
|
||||||
|
public static final String KEYWORD = ".keyword";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建索引
|
||||||
|
*
|
||||||
|
* @param index 索引
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean createIndex(String index) throws IOException {
|
||||||
|
if(isIndexExist(index)){
|
||||||
|
log.error("Index is exits!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//1.创建索引请求
|
||||||
|
CreateIndexRequest request = new CreateIndexRequest(index);
|
||||||
|
//2.执行客户端请求
|
||||||
|
CreateIndexResponse response = restHighLevelClient.indices().create(request, RequestOptions.DEFAULT);
|
||||||
|
|
||||||
|
log.info("创建索引{}成功",index);
|
||||||
|
|
||||||
|
return response.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建索引并指定分片和复制集数量
|
||||||
|
* @param indexName
|
||||||
|
* @param numberOfShards
|
||||||
|
* @param numberOfReplicas
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public boolean createIndexWithShards(String indexName, Integer numberOfShards, Integer numberOfReplicas) throws IOException {
|
||||||
|
CreateIndexRequest createIndexRequest = new CreateIndexRequest(indexName);
|
||||||
|
//设置分片信息
|
||||||
|
numberOfShards = numberOfShards == null ? 1 : numberOfShards;
|
||||||
|
numberOfReplicas = numberOfReplicas == null ? 1 : numberOfReplicas;
|
||||||
|
createIndexRequest.settings(Settings.builder().
|
||||||
|
put("index.number_of_shards", numberOfShards)
|
||||||
|
.put("index.number_of_replicas", numberOfReplicas));
|
||||||
|
//创建索引
|
||||||
|
CreateIndexResponse createIndexResponse = restHighLevelClient.indices().create(createIndexRequest, RequestOptions.DEFAULT);
|
||||||
|
return createIndexResponse.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建索引,并关联别名
|
||||||
|
* @param indexName
|
||||||
|
* @param aliasName
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public boolean createIndexWithAlias(String indexName, String aliasName) throws IOException {
|
||||||
|
CreateIndexRequest request = new CreateIndexRequest(indexName);
|
||||||
|
if (StringUtils.isNotEmpty(aliasName)) {
|
||||||
|
request.alias(new Alias(aliasName));
|
||||||
|
}
|
||||||
|
CreateIndexResponse createIndexResponse = restHighLevelClient.indices().create(request, RequestOptions.DEFAULT);
|
||||||
|
return createIndexResponse.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除索引
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean deleteIndex(String index) throws IOException {
|
||||||
|
if(!isIndexExist(index)) {
|
||||||
|
log.error("Index is not exits!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//删除索引请求
|
||||||
|
DeleteIndexRequest request = new DeleteIndexRequest(index);
|
||||||
|
//执行客户端请求
|
||||||
|
AcknowledgedResponse delete = restHighLevelClient.indices().delete(request, RequestOptions.DEFAULT);
|
||||||
|
|
||||||
|
log.info("删除索引{}成功",index);
|
||||||
|
|
||||||
|
return delete.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断索引是否存在
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isIndexExist(String index) throws IOException {
|
||||||
|
|
||||||
|
GetIndexRequest request = new GetIndexRequest(index);
|
||||||
|
|
||||||
|
boolean exists = restHighLevelClient.indices().exists(request, RequestOptions.DEFAULT);
|
||||||
|
|
||||||
|
return exists;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取别名关联的index列表
|
||||||
|
* @param aliasName
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public List<String> getIndicesByAlias(String aliasName) throws IOException {
|
||||||
|
GetAliasesRequest aliasRequest = new GetAliasesRequest(aliasName);
|
||||||
|
GetAliasesResponse response = restHighLevelClient.indices().getAlias(aliasRequest, RequestOptions.DEFAULT);
|
||||||
|
if(!RestStatus.OK.equals(response.status())){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return new ArrayList<>(response.getAliases().keySet());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增别名
|
||||||
|
* @param indexName
|
||||||
|
* @param aliasName
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public boolean addAlias(String indexName, String aliasName) throws IOException {
|
||||||
|
IndicesAliasesRequest aliasesRequest = new IndicesAliasesRequest();
|
||||||
|
IndicesAliasesRequest.AliasActions aliasAction =
|
||||||
|
new IndicesAliasesRequest.AliasActions(IndicesAliasesRequest.AliasActions.Type.ADD)
|
||||||
|
.index(indexName)
|
||||||
|
.alias(aliasName);
|
||||||
|
aliasesRequest.addAliasAction(aliasAction);
|
||||||
|
AcknowledgedResponse acknowledgedResponse = restHighLevelClient.indices().updateAliases(aliasesRequest,RequestOptions.DEFAULT);
|
||||||
|
return acknowledgedResponse.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改别名关联的索引
|
||||||
|
* @param aliasname
|
||||||
|
* @param oldIndices
|
||||||
|
* @param newIndices
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public boolean changeAlias(String aliasname, List<String> oldIndices, List<String> newIndices) throws IOException {
|
||||||
|
IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest();
|
||||||
|
|
||||||
|
for(String newIndexname: newIndices) {
|
||||||
|
IndicesAliasesRequest.AliasActions addIndexAction = new IndicesAliasesRequest.AliasActions(
|
||||||
|
IndicesAliasesRequest.AliasActions.Type.ADD).index(newIndexname).alias(aliasname);
|
||||||
|
indicesAliasesRequest.addAliasAction(addIndexAction);
|
||||||
|
}
|
||||||
|
for(String oldIndexname: oldIndices) {
|
||||||
|
IndicesAliasesRequest.AliasActions removeAction = new IndicesAliasesRequest.AliasActions(
|
||||||
|
IndicesAliasesRequest.AliasActions.Type.REMOVE).index(oldIndexname).alias(aliasname);
|
||||||
|
indicesAliasesRequest.addAliasAction(removeAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
AcknowledgedResponse indicesAliasesResponse = restHighLevelClient.indices().updateAliases(indicesAliasesRequest,
|
||||||
|
RequestOptions.DEFAULT);
|
||||||
|
return indicesAliasesResponse.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 别名是否存在
|
||||||
|
* @param aliasName
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public boolean isAliasExists(String aliasName) throws IOException {
|
||||||
|
GetAliasesRequest getAliasesRequest = new GetAliasesRequest(aliasName);
|
||||||
|
return restHighLevelClient.indices().existsAlias(getAliasesRequest, RequestOptions.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置index mapping
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public boolean addMappingForIndex(PutMappingRequest request) throws IOException {
|
||||||
|
request.setTimeout(TimeValue.timeValueMinutes(2));
|
||||||
|
AcknowledgedResponse response = restHighLevelClient.indices().putMapping(request, RequestOptions.DEFAULT);
|
||||||
|
return response.isAcknowledged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据添加,正定ID
|
||||||
|
*
|
||||||
|
* @param jsonObject 要增加的数据
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @param id 数据ID, 为null时es随机生成
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String addData(JSONObject jsonObject, String index, String id) throws IOException {
|
||||||
|
|
||||||
|
//创建请求
|
||||||
|
IndexRequest request = new IndexRequest(index);
|
||||||
|
//规则 put /test_index/_doc/1
|
||||||
|
request.id(id);
|
||||||
|
request.timeout(TimeValue.timeValueSeconds(1));
|
||||||
|
//将数据放入请求 json
|
||||||
|
IndexRequest source = request.source(jsonObject, XContentType.JSON);
|
||||||
|
//客户端发送请求
|
||||||
|
IndexResponse response = restHighLevelClient.index(request, RequestOptions.DEFAULT);
|
||||||
|
|
||||||
|
log.info("添加数据成功 索引为: {}, response 状态: {}, id为: {}",index,response.status().getStatus(), response.getId());
|
||||||
|
return response.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean addDataList(List<Pair<Long,?>> datas, String index) throws IOException {
|
||||||
|
//
|
||||||
|
BulkRequest bulkRequest = new BulkRequest();
|
||||||
|
bulkRequest.timeout(TimeValue.timeValueSeconds(10));
|
||||||
|
|
||||||
|
IndexRequest request;
|
||||||
|
if (datas!=null&&datas.size()>0){
|
||||||
|
for(Pair<Long,?> o: datas){
|
||||||
|
request = new IndexRequest(index);
|
||||||
|
String source = JsonUtils.toJson(o.getRight());
|
||||||
|
request.id(o.getLeft().toString());
|
||||||
|
request.source(source, XContentType.JSON);
|
||||||
|
bulkRequest.add(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BulkResponse resp = restHighLevelClient.bulk(bulkRequest,RequestOptions.DEFAULT);
|
||||||
|
if(resp.hasFailures()){
|
||||||
|
for(BulkItemResponse itemResponse : resp){
|
||||||
|
if(itemResponse.isFailed()){
|
||||||
|
BulkItemResponse.Failure failure = itemResponse.getFailure();
|
||||||
|
log.warn("同步索引失败:index:{}, id:{}, itemId:{}, error: {}", itemResponse.getIndex(), itemResponse.getId(), itemResponse.getItemId(), failure.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !resp.hasFailures();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据添加 随机id
|
||||||
|
*
|
||||||
|
* @param jsonObject 要增加的数据
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String addData(JSONObject jsonObject, String index) throws IOException {
|
||||||
|
return addData(jsonObject, index, UUID.randomUUID().toString().replaceAll("-", "").toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID删除数据
|
||||||
|
*
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @param id 数据ID
|
||||||
|
*/
|
||||||
|
public void deleteDataById(String index, String id) throws IOException {
|
||||||
|
//删除请求
|
||||||
|
DeleteRequest request = new DeleteRequest(index, id);
|
||||||
|
//执行客户端请求
|
||||||
|
DeleteResponse delete = restHighLevelClient.delete(request, RequestOptions.DEFAULT);
|
||||||
|
log.info("索引为: {}, id为: {}删除数据成功",index, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID 更新数据
|
||||||
|
*
|
||||||
|
* @param object 要增加的数据
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @param id 数据ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void updateDataById(Object object, String index, String id) throws IOException {
|
||||||
|
//更新请求
|
||||||
|
UpdateRequest update = new UpdateRequest(index, id);
|
||||||
|
|
||||||
|
//保证数据实时更新
|
||||||
|
//update.setRefreshPolicy("wait_for");
|
||||||
|
|
||||||
|
update.timeout("1s");
|
||||||
|
update.doc(JsonUtils.toJson(object), XContentType.JSON);
|
||||||
|
//执行更新请求
|
||||||
|
UpdateResponse update1 = restHighLevelClient.update(update, RequestOptions.DEFAULT);
|
||||||
|
log.info("索引为: {}, id为: {}, 更新数据成功",index, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID 更新数据,保证实时性
|
||||||
|
*
|
||||||
|
* @param object 要增加的数据
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @param id 数据ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void updateDataByIdNoRealTime(Object object, String index, String id) throws IOException {
|
||||||
|
//更新请求
|
||||||
|
UpdateRequest update = new UpdateRequest(index, id);
|
||||||
|
|
||||||
|
//保证数据实时更新
|
||||||
|
update.setRefreshPolicy("wait_for");
|
||||||
|
|
||||||
|
update.timeout("1s");
|
||||||
|
update.doc(JsonUtils.toJson(object), XContentType.JSON);
|
||||||
|
//执行更新请求
|
||||||
|
UpdateResponse update1 = restHighLevelClient.update(update, RequestOptions.DEFAULT);
|
||||||
|
log.info("索引为: {}, id为: {}, 更新数据成功",index, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID获取数据
|
||||||
|
*
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @param id 数据ID
|
||||||
|
* @param fields 需要显示的字段,逗号分隔(缺省为全部字段)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String,Object> searchDataById(String index, String id, String fields) throws IOException {
|
||||||
|
GetRequest request = new GetRequest(index, id);
|
||||||
|
if (StringUtils.isNotEmpty(fields)){
|
||||||
|
//只查询特定字段。如果需要查询所有字段则不设置该项。
|
||||||
|
request.fetchSourceContext(new FetchSourceContext(true,fields.split(","), Strings.EMPTY_ARRAY));
|
||||||
|
}
|
||||||
|
GetResponse response = restHighLevelClient.get(request, RequestOptions.DEFAULT);
|
||||||
|
Map<String, Object> map = response.getSource();
|
||||||
|
//为返回的数据添加id
|
||||||
|
map.put("id",response.getId());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID判断文档是否存在
|
||||||
|
* @param index 索引,类似数据库
|
||||||
|
* @param id 数据ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean existsById(String index,String id) throws IOException {
|
||||||
|
GetRequest request = new GetRequest(index, id);
|
||||||
|
//不获取返回的_source的上下文
|
||||||
|
request.fetchSourceContext(new FetchSourceContext(false));
|
||||||
|
request.storedFields("_none_");
|
||||||
|
return restHighLevelClient.exists(request, RequestOptions.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取低水平客户端
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestClient getLowLevelClient() {
|
||||||
|
return restHighLevelClient.getLowLevelClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高亮结果集 特殊处理
|
||||||
|
* map转对象 JSONObject.parseObject(JSONObject.toJSONString(map), Content.class)
|
||||||
|
* @param searchResponse
|
||||||
|
* @param highlightField
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> setSearchResponse(SearchResponse searchResponse, String highlightField) {
|
||||||
|
//解析结果
|
||||||
|
ArrayList<Map<String,Object>> list = new ArrayList<>();
|
||||||
|
for (SearchHit hit : searchResponse.getHits().getHits()) {
|
||||||
|
Map<String, HighlightField> high = hit.getHighlightFields();
|
||||||
|
HighlightField title = high.get(highlightField);
|
||||||
|
|
||||||
|
hit.getSourceAsMap().put("id", hit.getId());
|
||||||
|
|
||||||
|
Map<String, Object> sourceAsMap = hit.getSourceAsMap();//原来的结果
|
||||||
|
//解析高亮字段,将原来的字段换为高亮字段
|
||||||
|
if (title!=null){
|
||||||
|
Text[] texts = title.fragments();
|
||||||
|
String nTitle="";
|
||||||
|
for (Text text : texts) {
|
||||||
|
nTitle+=text;
|
||||||
|
}
|
||||||
|
//替换
|
||||||
|
sourceAsMap.put(highlightField,nTitle);
|
||||||
|
}
|
||||||
|
list.add(sourceAsMap);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询并分页
|
||||||
|
* @param index 索引名称
|
||||||
|
* @param query 查询条件
|
||||||
|
* @param size 文档大小限制
|
||||||
|
* @param from 从第几页开始
|
||||||
|
* @param fields 需要显示的字段,逗号分隔(缺省为全部字段)
|
||||||
|
* @param sortField 排序字段
|
||||||
|
* @param highlightField 高亮字段
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> searchListData(String index,
|
||||||
|
SearchSourceBuilder query,
|
||||||
|
Integer size,
|
||||||
|
Integer from,
|
||||||
|
String fields,
|
||||||
|
String sortField,
|
||||||
|
String highlightField) throws IOException {
|
||||||
|
SearchRequest request = new SearchRequest(index);
|
||||||
|
SearchSourceBuilder builder = query;
|
||||||
|
if (StringUtils.isNotEmpty(fields)){
|
||||||
|
//只查询特定字段。如果需要查询所有字段则不设置该项。
|
||||||
|
builder.fetchSource(new FetchSourceContext(true,fields.split(","),Strings.EMPTY_ARRAY));
|
||||||
|
}
|
||||||
|
from = from <= 0 ? 0 : from*size;
|
||||||
|
//设置确定结果要从哪个索引开始搜索的from选项,默认为0
|
||||||
|
builder.from(from);
|
||||||
|
builder.size(size);
|
||||||
|
if (StringUtils.isNotEmpty(sortField)){
|
||||||
|
//排序字段,注意如果proposal_no是text类型会默认带有keyword性质,需要拼接.keyword
|
||||||
|
builder.sort(sortField+".keyword", SortOrder.ASC);
|
||||||
|
}
|
||||||
|
//高亮
|
||||||
|
HighlightBuilder highlight = new HighlightBuilder();
|
||||||
|
highlight.field(highlightField);
|
||||||
|
//关闭多个高亮
|
||||||
|
highlight.requireFieldMatch(false);
|
||||||
|
highlight.preTags("<span style='color:red'>");
|
||||||
|
highlight.postTags("</span>");
|
||||||
|
builder.highlighter(highlight);
|
||||||
|
//不返回源数据。只有条数之类的数据。
|
||||||
|
//builder.fetchSource(false);
|
||||||
|
request.source(builder);
|
||||||
|
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
|
||||||
|
log.error("=="+response.getHits().getTotalHits());
|
||||||
|
if (response.status().getStatus() == 200) {
|
||||||
|
// 解析对象
|
||||||
|
return setSearchResponse(response, highlightField);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package {{ .package }}.common.elasticsearch;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.springframework.core.ResolvableType;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import org.elasticsearch.client.indices.PutMappingRequest;
|
||||||
|
|
||||||
|
import {{ .package }}.common.elasticsearch.EsService;
|
||||||
|
|
||||||
|
public interface IndexService {
|
||||||
|
|
||||||
|
public boolean indexData(List<Long> ids, String table) throws JSONException, IOException;
|
||||||
|
|
||||||
|
public List<String> subscribeTable();
|
||||||
|
|
||||||
|
public String mainTable();
|
||||||
|
|
||||||
|
public List<Long> scanMainDBIds(long offsetId, int size);
|
||||||
|
|
||||||
|
public String indexName();
|
||||||
|
|
||||||
|
public PutMappingRequest getIndexMapping();
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
> 本模块存放公共枚举
|
||||||
|
``` \-- *Enum.java
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package {{ .package }}.common.redis;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
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.JedisPoolConfig;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableConfigurationProperties({RedisPoolProperties.class})
|
||||||
|
public class RedisPoolConfig {
|
||||||
|
@Autowired
|
||||||
|
private RedisPoolProperties redisPoolProperties;
|
||||||
|
@Value("${redis-config.pool.password:}")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接池的基本配置
|
||||||
|
*
|
||||||
|
* @return JedisPoolConfig
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public JedisPoolConfig initPoolConfig() {
|
||||||
|
JedisPoolConfig poolConfig = new JedisPoolConfig();
|
||||||
|
// 设置最大连接数,默认值为8.如果赋值为-1,则表示不限制;
|
||||||
|
poolConfig.setMaxTotal(redisPoolProperties.getMaxTotal());
|
||||||
|
// 最大空闲连接数
|
||||||
|
poolConfig.setMaxIdle(redisPoolProperties.getMaxIdle());
|
||||||
|
// 最小空闲连接数
|
||||||
|
poolConfig.setMinIdle(redisPoolProperties.getMinIdle());
|
||||||
|
// 获取Jedis连接的最大等待时间,单位毫秒,默认值为-1,表示永不超时。如果超过等待时间,则直接抛出JedisConnectionException
|
||||||
|
poolConfig.setMaxWaitMillis(redisPoolProperties.getMaxWaitMillis());
|
||||||
|
// 每次释放连接的最大数目
|
||||||
|
poolConfig.setNumTestsPerEvictionRun(redisPoolProperties.getNumTestsPerEvictionRun());
|
||||||
|
// 释放连接的扫描间隔(毫秒),如果为负数,则不运行逐出线程, 默认-1
|
||||||
|
poolConfig.setTimeBetweenEvictionRunsMillis(redisPoolProperties.getTimeBetweenEvictionRunsMillis());
|
||||||
|
// 连接最小空闲时间
|
||||||
|
poolConfig.setMinEvictableIdleTimeMillis(redisPoolProperties.getMinEvictableIdleTimeMillis());
|
||||||
|
// 连接空闲多久后释放, 当空闲时间>该值 且 空闲连接>最大空闲连接数 时直接释放
|
||||||
|
poolConfig.setSoftMinEvictableIdleTimeMillis(redisPoolProperties.getSoftMinEvictableIdleTimeMillis());
|
||||||
|
// 在获取Jedis连接时,自动检验连接是否可用
|
||||||
|
poolConfig.setTestOnBorrow(redisPoolProperties.isTestOnBorrow());
|
||||||
|
// 在将连接放回池中前,自动检验连接是否有效
|
||||||
|
poolConfig.setTestOnReturn(redisPoolProperties.isTestOnReturn());
|
||||||
|
// 自动测试池中的空闲连接是否都是可用连接
|
||||||
|
poolConfig.setTestWhileIdle(redisPoolProperties.isTestWhileIdle());
|
||||||
|
// 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
|
||||||
|
poolConfig.setBlockWhenExhausted(redisPoolProperties.isBlockWhenExhausted());
|
||||||
|
// 是否启用pool的jmx管理功能, 默认true
|
||||||
|
poolConfig.setJmxEnabled(redisPoolProperties.isJmxEnabled());
|
||||||
|
// 是否启用后进先出, 默认true
|
||||||
|
poolConfig.setLifo(redisPoolProperties.isLifo());
|
||||||
|
// 每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3
|
||||||
|
poolConfig.setNumTestsPerEvictionRun(redisPoolProperties.getNumTestsPerEvictionRun());
|
||||||
|
poolConfig.setTestOnBorrow(false);
|
||||||
|
return poolConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建JedisCluster客户端, 将redis客户端放到容器中; 连接redis集群
|
||||||
|
* Jedis 连接集群
|
||||||
|
*
|
||||||
|
* @return JedisCluster 使用完成后不需要手动释放连接,返回客户端, 使用完成后不需要手动释放连接, 客户端会自动释放连接
|
||||||
|
*/
|
||||||
|
// @Bean
|
||||||
|
// @Qualifier("JedisCluster")
|
||||||
|
// public JedisCluster getJedisCluster() {
|
||||||
|
// return new JedisCluster(getSet(), initPoolConfig());
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单例版 需要手动获取jedis实例,用完后需要手动释放
|
||||||
|
*
|
||||||
|
* @return 返回redis连接池,
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public JedisPool getRedisPool() {
|
||||||
|
String host = StrUtil.subBefore(redisPoolProperties.getHostAndPort(), ":", false);
|
||||||
|
int port = Integer.parseInt(StrUtil.subAfter(redisPoolProperties.getHostAndPort(), ":", false));
|
||||||
|
if(StrUtil.isNotEmpty(this.password)) {
|
||||||
|
return new JedisPool(initPoolConfig(),host,port ,1000, password);
|
||||||
|
}else{
|
||||||
|
return new JedisPool(initPoolConfig(),host,port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取集群对象集合
|
||||||
|
*
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package {{ .package }}.common.redis;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.PropertySource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConfigurationProperties(prefix = "redis-config.pool")
|
||||||
|
public class RedisPoolProperties {
|
||||||
|
private String hostAndPort;
|
||||||
|
private int maxTotal;
|
||||||
|
private int maxIdle;
|
||||||
|
private int minIdle;
|
||||||
|
private Long maxWaitMillis;
|
||||||
|
private Long timeBetweenEvictionRunsMillis;
|
||||||
|
private Long minEvictableIdleTimeMillis;
|
||||||
|
private Long softMinEvictableIdleTimeMillis;
|
||||||
|
private boolean testOnBorrow;
|
||||||
|
private boolean testOnReturn;
|
||||||
|
private boolean testWhileIdle;
|
||||||
|
private boolean blockWhenExhausted;
|
||||||
|
private boolean jmxEnabled;
|
||||||
|
private boolean lifo;
|
||||||
|
private int numTestsPerEvictionRun;
|
||||||
|
|
||||||
|
public String getHostAndPort() {
|
||||||
|
return hostAndPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHostAndPort(String hostAndPort) {
|
||||||
|
this.hostAndPort = hostAndPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxTotal() {
|
||||||
|
return maxTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxTotal(int maxTotal) {
|
||||||
|
this.maxTotal = maxTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxIdle() {
|
||||||
|
return maxIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxIdle(int maxIdle) {
|
||||||
|
this.maxIdle = maxIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinIdle() {
|
||||||
|
return minIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinIdle(int minIdle) {
|
||||||
|
this.minIdle = minIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaxWaitMillis() {
|
||||||
|
return maxWaitMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxWaitMillis(Long maxWaitMillis) {
|
||||||
|
this.maxWaitMillis = maxWaitMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTimeBetweenEvictionRunsMillis() {
|
||||||
|
return timeBetweenEvictionRunsMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeBetweenEvictionRunsMillis(Long timeBetweenEvictionRunsMillis) {
|
||||||
|
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMinEvictableIdleTimeMillis() {
|
||||||
|
return minEvictableIdleTimeMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinEvictableIdleTimeMillis(Long minEvictableIdleTimeMillis) {
|
||||||
|
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getSoftMinEvictableIdleTimeMillis() {
|
||||||
|
return softMinEvictableIdleTimeMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSoftMinEvictableIdleTimeMillis(Long softMinEvictableIdleTimeMillis) {
|
||||||
|
this.softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTestOnBorrow() {
|
||||||
|
return testOnBorrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestOnBorrow(boolean testOnBorrow) {
|
||||||
|
this.testOnBorrow = testOnBorrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTestOnReturn() {
|
||||||
|
return testOnReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestOnReturn(boolean testOnReturn) {
|
||||||
|
this.testOnReturn = testOnReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTestWhileIdle() {
|
||||||
|
return testWhileIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestWhileIdle(boolean testWhileIdle) {
|
||||||
|
this.testWhileIdle = testWhileIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBlockWhenExhausted() {
|
||||||
|
return blockWhenExhausted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlockWhenExhausted(boolean blockWhenExhausted) {
|
||||||
|
this.blockWhenExhausted = blockWhenExhausted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isJmxEnabled() {
|
||||||
|
return jmxEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJmxEnabled(boolean jmxEnabled) {
|
||||||
|
this.jmxEnabled = jmxEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLifo() {
|
||||||
|
return lifo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLifo(boolean lifo) {
|
||||||
|
this.lifo = lifo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumTestsPerEvictionRun() {
|
||||||
|
return numTestsPerEvictionRun;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {
|
||||||
|
this.numTestsPerEvictionRun = numTestsPerEvictionRun;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package {{ .package }}.common.rocketmq;
|
||||||
|
|
||||||
|
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
|
||||||
|
|
||||||
|
public interface RocketMQService {
|
||||||
|
DefaultMQPushConsumer getConsumer(String consumerGroup);
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package {{ .package }}.common.utils;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.JavaType;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.node.MissingNode;
|
||||||
|
import com.vs.ox.common.utils.ObjectMapperFactory;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class JsonUtils {
|
||||||
|
|
||||||
|
private static final ObjectMapper objectMapper = ObjectMapperFactory.getDefaultObjectMapper();
|
||||||
|
|
||||||
|
static {
|
||||||
|
objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ObjectMapper getObjectMapper() {
|
||||||
|
return objectMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toJson(Object value) {
|
||||||
|
try {
|
||||||
|
return objectMapper.writeValueAsString(value);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new IllegalStateException("to Json error", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T readObject(String json, TypeReference<T> typeReference) {
|
||||||
|
return readObject(json, objectMapper.getTypeFactory().constructType(typeReference));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T readObject(String json, Class<T> clazz) {
|
||||||
|
return readObject(json, objectMapper.getTypeFactory().constructType(clazz));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T readObject(byte[] json, Class<T> clazz) {
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(json, clazz);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new IllegalStateException("read Json error", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T readObject(String json, JavaType javaType) {
|
||||||
|
if (isBlank(json)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(json, javaType);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new IllegalStateException("read Json error", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JsonNode path(String json, String path) {
|
||||||
|
if (isBlank(json)) {
|
||||||
|
return MissingNode.getInstance();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String atPath = path;
|
||||||
|
if (!path.startsWith("/")) {
|
||||||
|
atPath = "/" + path;
|
||||||
|
}
|
||||||
|
return objectMapper.readTree(json).at(atPath);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new IllegalStateException("read Json error", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isBlank(String str) {
|
||||||
|
int strLen;
|
||||||
|
if (str == null || (strLen = str.length()) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < strLen; i++) {
|
||||||
|
if ((!Character.isWhitespace(str.charAt(i)))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Optional<T> readPath(String json, String path, TypeReference<T> typeReference) {
|
||||||
|
return readPath(json, path, objectMapper.getTypeFactory().constructType(typeReference));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Optional<T> readPath(String json, String path, Class<T> clazz) {
|
||||||
|
JsonNode jsonNode = path(json, path);
|
||||||
|
if (jsonNode.isMissingNode()) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Optional.of(objectMapper.treeToValue(jsonNode, clazz));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Optional<T> readPath(String json, String path, JavaType javaType) {
|
||||||
|
JsonNode jsonNode = path(json, path);
|
||||||
|
if (jsonNode.isMissingNode()) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
return Optional.of(objectMapper.convertValue(jsonNode, javaType));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
> 本模块存放公共工具类
|
||||||
|
``` \-- *Util.java
|
||||||
|
```
|
||||||
1
template/entrance/README.md
Normal file
1
template/entrance/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
> 应用入口
|
||||||
15
template/entrance/mq/pom.xml
Normal file
15
template/entrance/mq/pom.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?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-mq</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
存放消息消费者
|
||||||
|
```
|
||||||
|
\-- *Consumer.java
|
||||||
|
```
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
存放DTOConverter
|
||||||
|
```
|
||||||
|
\-- *Converter.java
|
||||||
|
```
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
存放DTO
|
||||||
|
```
|
||||||
|
\-- *DTO.java
|
||||||
|
```
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
存放工具类
|
||||||
|
```
|
||||||
|
\-- *Util.java
|
||||||
|
```
|
||||||
24
template/entrance/pom.xml
Normal file
24
template/entrance/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?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 }}</artifactId>
|
||||||
|
<version>{{ .version }}</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>{{ .artifactId }}-entrance</artifactId>
|
||||||
|
<version>{{ .version }}</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>{{ .groupId }}</groupId>
|
||||||
|
<artifactId>{{ .artifactId }}-common</artifactId>
|
||||||
|
<version>{{ .version }}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<modules>
|
||||||
|
<module>mq</module>
|
||||||
|
<module>web</module>
|
||||||
|
</modules>
|
||||||
|
</project>
|
||||||
40
template/entrance/web/pom.xml
Normal file
40
template/entrance/web/pom.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?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.toco</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>
|
||||||
|
<version>${vs.mock.spring}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vs</groupId>
|
||||||
|
<artifactId>vs-debug-agent</artifactId>
|
||||||
|
<version>${vs.debug.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vs</groupId>
|
||||||
|
<artifactId>vs-debug-plugin</artifactId>
|
||||||
|
<version>${vs.debug.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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.agent.TocoAgentInitializer;
|
||||||
|
|
||||||
|
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.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
|
@SpringBootApplication(scanBasePackages = {"{{.groupId}}", "com.vs"})
|
||||||
|
@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 application = new SpringApplication(AppApplication.class);
|
||||||
|
application.addInitializers(new TocoAgentInitializer());
|
||||||
|
application.run(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package {{ .package }}.entrance.web.response;
|
||||||
|
|
||||||
|
import com.libawall.framework.core.base.result.ResultDTO;
|
||||||
|
import com.vs.common.util.rpc.pub.PublicInterface;
|
||||||
|
import com.vs.ox.common.utils.ObjectMapperFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
import org.springframework.core.MethodParameter;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||||
|
import org.springframework.http.server.ServletServerHttpResponse;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
|
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
|
||||||
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理 Controller 里的返回值,从 Object 包装为 ResultDTO 类型
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class ResponseJsonMethodReturnValueHandler implements HandlerMethodReturnValueHandler, InitializingBean {
|
||||||
|
private HttpMessageConverter messageConverter;
|
||||||
|
|
||||||
|
public ResponseJsonMethodReturnValueHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void afterPropertiesSet() {
|
||||||
|
if (this.messageConverter == null) {
|
||||||
|
this.messageConverter = new MappingJackson2HttpMessageConverter(ObjectMapperFactory.getDefaultObjectMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean supportsReturnType(MethodParameter returnType) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
|
||||||
|
Method method = returnType.getMethod();
|
||||||
|
//目前只处理自动生成接口
|
||||||
|
PublicInterface annotation = method.getAnnotation(PublicInterface.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
mavContainer.setRequestHandled(true);
|
||||||
|
Object result = returnValue == null ? ResultDTO.ok(Collections.emptyMap()) : ResultDTO.ok((returnValue));
|
||||||
|
ServletServerHttpResponse response = new ServletServerHttpResponse(webRequest.getNativeResponse(HttpServletResponse.class));
|
||||||
|
this.messageConverter.write(result, new MediaType(MediaType.APPLICATION_JSON, Collections.singletonMap("charset", "utf-8")), response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package {{ .package }}.entrance.web.response;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.method.annotation.MapMethodProcessor;
|
||||||
|
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.ViewNameMethodReturnValueHandler;
|
||||||
|
|
||||||
|
import javax.servlet.ServletContextEvent;
|
||||||
|
import javax.servlet.ServletContextListener;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class ResponseJsonWebMvcConfiguration implements ApplicationContextAware, WebMvcConfigurer {
|
||||||
|
private RequestMappingHandlerAdapter requestMappingHandlerAdapter;
|
||||||
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
void init() {
|
||||||
|
List<HandlerMethodReturnValueHandler> returnValueHandlers = this.requestMappingHandlerAdapter.getReturnValueHandlers();
|
||||||
|
Iterator<HandlerMethodReturnValueHandler> iterator = returnValueHandlers.iterator();
|
||||||
|
List<HandlerMethodReturnValueHandler> newProcessors = new ArrayList<>();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
HandlerMethodReturnValueHandler next = iterator.next();
|
||||||
|
//在controller中直接返回map,不被默认的MapMethodProcessor拦截
|
||||||
|
if (next instanceof MapMethodProcessor ||
|
||||||
|
//在controller中直接返回String,不被默认的ViewNameMethodReturnValueHandler拦截
|
||||||
|
next instanceof ViewNameMethodReturnValueHandler) {
|
||||||
|
} else {
|
||||||
|
newProcessors.add(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.requestMappingHandlerAdapter.setReturnValueHandlers(newProcessors);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
|
||||||
|
ResponseJsonMethodReturnValueHandler responseJsonMethodReturnValueHandler = new ResponseJsonMethodReturnValueHandler();
|
||||||
|
responseJsonMethodReturnValueHandler.afterPropertiesSet();
|
||||||
|
returnValueHandlers.add(responseJsonMethodReturnValueHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
ServletContextListener listener1() {
|
||||||
|
return new ServletContextListener() {
|
||||||
|
@Override
|
||||||
|
public void contextInitialized(ServletContextEvent sce) {
|
||||||
|
requestMappingHandlerAdapter = applicationContext.getBean(RequestMappingHandlerAdapter.class);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void contextDestroyed(ServletContextEvent sce) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
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
|
||||||
|
# datasource
|
||||||
|
spring.datasource.url=jdbc:mysql://${DB_HOST:10.0.2.201:3306}/${DB_DATABASE:hande_test}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
|
spring.datasource.username=${DB_USER:hande_test_user}
|
||||||
|
spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5}
|
||||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource
|
||||||
|
spring.datasource.tomcat.max-age=3600000
|
||||||
|
spring.jpa.open-in-view=false
|
||||||
|
management.metrics.export.simple.enabled=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
|
||||||
|
|
||||||
|
#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
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
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:mysql://${DB_HOST:10.0.2.201:3306}/${DB_DATABASE:hande_test}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
|
spring.datasource.username=${DB_USER:hande_test_user}
|
||||||
|
spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5}
|
||||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
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=hande_test
|
||||||
|
rocketmq.consumerGroup=CID_handeTest
|
||||||
|
rocketmq.tag=*
|
||||||
|
rocketmq.producer.group=PID_handeTest
|
||||||
|
|
||||||
|
#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
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
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:mysql://${DB_HOST:10.0.2.201:3306}/${DB_DATABASE:hande_test}?characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
|
spring.datasource.username=${DB_USER:hande_test_user}
|
||||||
|
spring.datasource.password=${DB_PASSWORD:Yu0FvhjUQDGdnmm5}
|
||||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
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: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
|
||||||
|
|
||||||
|
#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
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
spring.profiles.active=local
|
||||||
|
envs=local,remote,online,custom
|
||||||
|
spring.main.allow-bean-definition-overriding=true
|
||||||
|
project_id=${projectId}
|
||||||
|
project_name=handeTest
|
||||||
|
check=true
|
||||||
|
|
||||||
|
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
|
||||||
|
|
||||||
|
com.toco.agent.attach=true
|
||||||
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
|
||||||
1
template/modules/.gitkeep
Normal file
1
template/modules/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
308
template/mvnw
vendored
Normal file
308
template/mvnw
vendored
Normal file
@@ -0,0 +1,308 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Apache Maven Wrapper startup batch script, version 3.2.0
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||||
|
|
||||||
|
if [ -f /usr/local/etc/mavenrc ] ; then
|
||||||
|
. /usr/local/etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ] ; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ] ; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false;
|
||||||
|
darwin=false;
|
||||||
|
mingw=false
|
||||||
|
case "$(uname)" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true;;
|
||||||
|
Darwin*) darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
|
||||||
|
else
|
||||||
|
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=$(java-config --jre-home)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw ; then
|
||||||
|
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="$(which javac)"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=$(which readlink)
|
||||||
|
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
|
||||||
|
if $darwin ; then
|
||||||
|
javaHome="$(dirname "\"$javaExecutable\"")"
|
||||||
|
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="$(readlink -f "\"$javaExecutable\"")"
|
||||||
|
fi
|
||||||
|
javaHome="$(dirname "\"$javaExecutable\"")"
|
||||||
|
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ] ; then
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ] ; do
|
||||||
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=$(cd "$wdir/.." || exit 1; pwd)
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
# Remove \r in case we run on Windows within Git Bash
|
||||||
|
# and check out the repository with auto CRLF management
|
||||||
|
# enabled. Otherwise, we may read lines that are delimited with
|
||||||
|
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
|
||||||
|
# splitting rules.
|
||||||
|
tr -s '\r\n' ' ' < "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
log() {
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
printf '%s\n' "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
|
||||||
|
log "$MAVEN_PROJECTBASEDIR"
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if [ -r "$wrapperJarPath" ]; then
|
||||||
|
log "Found $wrapperJarPath"
|
||||||
|
else
|
||||||
|
log "Couldn't find $wrapperJarPath, downloading it ..."
|
||||||
|
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
else
|
||||||
|
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read -r key value; do
|
||||||
|
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
|
||||||
|
safeValue=$(echo "$value" | tr -d '\r')
|
||||||
|
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
log "Downloading from: $wrapperUrl"
|
||||||
|
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
log "Found wget ... using wget"
|
||||||
|
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
log "Found curl ... using curl"
|
||||||
|
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log "Falling back to using Java to download"
|
||||||
|
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaSource=$(cygpath --path --windows "$javaSource")
|
||||||
|
javaClass=$(cygpath --path --windows "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$javaSource" ]; then
|
||||||
|
if [ ! -e "$javaClass" ]; then
|
||||||
|
log " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaSource")
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
log " - Running MavenWrapperDownloader.java ..."
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||||
|
wrapperSha256Sum=""
|
||||||
|
while IFS="=" read -r key value; do
|
||||||
|
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
|
||||||
|
esac
|
||||||
|
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ -n "$wrapperSha256Sum" ]; then
|
||||||
|
wrapperSha256Result=false
|
||||||
|
if command -v sha256sum > /dev/null; then
|
||||||
|
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
|
||||||
|
wrapperSha256Result=true
|
||||||
|
fi
|
||||||
|
elif command -v shasum > /dev/null; then
|
||||||
|
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
|
||||||
|
wrapperSha256Result=true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
|
||||||
|
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ $wrapperSha256Result = false ]; then
|
||||||
|
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
|
||||||
|
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
|
||||||
|
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086 # safe args
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
$MAVEN_DEBUG_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||||
205
template/mvnw.cmd
vendored
Normal file
205
template/mvnw.cmd
vendored
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Apache Maven Wrapper startup batch script, version 3.2.0
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||||
|
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
|
||||||
|
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %WRAPPER_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||||
|
SET WRAPPER_SHA_256_SUM=""
|
||||||
|
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
|
||||||
|
)
|
||||||
|
IF NOT %WRAPPER_SHA_256_SUM%=="" (
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
|
||||||
|
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
|
||||||
|
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
|
||||||
|
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
|
||||||
|
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
|
||||||
|
" exit 1;"^
|
||||||
|
"}"^
|
||||||
|
"}"
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% ^
|
||||||
|
%JVM_CONFIG_MAVEN_PROPS% ^
|
||||||
|
%MAVEN_OPTS% ^
|
||||||
|
%MAVEN_DEBUG_OPTS% ^
|
||||||
|
-classpath %WRAPPER_JAR% ^
|
||||||
|
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
|
||||||
|
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||||
|
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%"=="on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
cmd /C exit /B %ERROR_CODE%
|
||||||
696
template/pom.xml
Normal file
696
template/pom.xml
Normal file
@@ -0,0 +1,696 @@
|
|||||||
|
<?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>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.7.18</version>
|
||||||
|
<relativePath />
|
||||||
|
<!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>{{ .groupId }}</groupId>
|
||||||
|
<artifactId>{{ .artifactId }}</artifactId>
|
||||||
|
<version>{{ .version }}</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<logback.classic.version>1.2.3</logback.classic.version>
|
||||||
|
<flyway.version>5.2.4</flyway.version>
|
||||||
|
<cn.hutool.all>5.7.4</cn.hutool.all>
|
||||||
|
<javax.persistence-api>2.2</javax.persistence-api>
|
||||||
|
<elasticsearch.version>7.3.1</elasticsearch.version>
|
||||||
|
<spring-boot-dependencies.version>2.6.2</spring-boot-dependencies.version>
|
||||||
|
<commons-logging.version>1.2</commons-logging.version>
|
||||||
|
<hession.version>4.0.63</hession.version>
|
||||||
|
<netty-all.version>4.1.48.Final</netty-all.version>
|
||||||
|
<gson.version>2.8.6</gson.version>
|
||||||
|
<spring-boot.version>2.2.6.RELEASE</spring-boot.version>
|
||||||
|
<mybatis-spring-boot-starter.version>2.1.2</mybatis-spring-boot-starter.version>
|
||||||
|
<mysql-connector-java.version>8.0.11</mysql-connector-java.version>
|
||||||
|
<slf4j-api.version>1.7.30</slf4j-api.version>
|
||||||
|
<junit.version>4.13</junit.version>
|
||||||
|
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
|
||||||
|
<groovy.version>3.0.3</groovy.version>
|
||||||
|
<spring.version>5.2.5.RELEASE</spring.version>
|
||||||
|
<hibernate.version>5.5.7.Final</hibernate.version>
|
||||||
|
<lobmook.version>1.18.20</lobmook.version>
|
||||||
|
<rocketmq-tools.version>4.7.1</rocketmq-tools.version>
|
||||||
|
<rocketmq-spring-boot.version>2.2.0</rocketmq-spring-boot.version>
|
||||||
|
<hutool-all.version>5.7.4</hutool-all.version>
|
||||||
|
<javax.annotation.version>1.3.2</javax.annotation.version>
|
||||||
|
<javax.transaction-api.version>1.3</javax.transaction-api.version>
|
||||||
|
<hibernate-validator.version>6.1.6.Final</hibernate-validator.version>
|
||||||
|
<spring-boot-starter-data-jpa.version>2.6.3</spring-boot-starter-data-jpa.version>
|
||||||
|
<spring-web.version>5.3.14</spring-web.version>
|
||||||
|
<toco-common.version>1.0.0-SNAPSHOT</toco-common.version>
|
||||||
|
<jedis.version>3.3.0</jedis.version>
|
||||||
|
<spring-boot-autoconfigure.version>2.7.18</spring-boot-autoconfigure.version>
|
||||||
|
<spring-boot.version>2.7.18</spring-boot.version>
|
||||||
|
<org.aspectj.version>1.9.6</org.aspectj.version>
|
||||||
|
<spring-context.version>5.3.14</spring-context.version>
|
||||||
|
<xxl-job-core.version>2.2.0</xxl-job-core.version>
|
||||||
|
<cglib-nodep.version>3.3.0</cglib-nodep.version>
|
||||||
|
<validation-api.version>2.0.1.Final</validation-api.version>
|
||||||
|
<springfox-swagger-ui.version>2.9.2</springfox-swagger-ui.version>
|
||||||
|
<springfox-swagger2.version>2.9.2</springfox-swagger2.version>
|
||||||
|
<swagger-annotations.version>1.5.22</swagger-annotations.version>
|
||||||
|
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
|
||||||
|
<jackson-databind.version>2.13.0</jackson-databind.version>
|
||||||
|
<httpclient.version>4.5.13</httpclient.version>
|
||||||
|
<guava.version>23.0</guava.version>
|
||||||
|
<opensearch.version>2.5.0</opensearch.version>
|
||||||
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
|
<transmittable-thread-local.version>2.12.3</transmittable-thread-local.version>
|
||||||
|
<spring.web.mvc.version>5.3.14</spring.web.mvc.version>
|
||||||
|
<httpasyncclient.version>4.1.5</httpasyncclient.version>
|
||||||
|
<rocketmq-client.version>4.7.1</rocketmq-client.version>
|
||||||
|
<org.json.version>20170516</org.json.version>
|
||||||
|
<elasticsearch-core.version>7.3.1</elasticsearch-core.version>
|
||||||
|
<druid-spring-boot-starter.version>1.1.21</druid-spring-boot-starter.version>
|
||||||
|
<vs.debug.version>1.0.0-SNAPSHOT</vs.debug.version>
|
||||||
|
<vs.mock.spring>1.0.0-SNAPSHOT</vs.mock.spring>
|
||||||
|
<libawall.version>2.2.0.RELEASE</libawall.version>
|
||||||
|
<toco.version>1.0.0-SNAPSHOT</toco.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.esotericsoftware</groupId>
|
||||||
|
<artifactId>kryo</artifactId>
|
||||||
|
<version>5.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis-spring</artifactId>
|
||||||
|
<version>2.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>3.5.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-core</artifactId>
|
||||||
|
<version>2.17.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>toco-all</artifactId>
|
||||||
|
<type>pom</type>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.quartz-scheduler</groupId>
|
||||||
|
<artifactId>quartz</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
|
<version>4.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
<version>2.7.18</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
<version>2.7.18</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-beans</artifactId>
|
||||||
|
<version>5.3.31</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-core</artifactId>
|
||||||
|
<version>5.3.31</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.9.28.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>${mysql-connector-java.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
<version>${druid-spring-boot-starter.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.enums</groupId>
|
||||||
|
<artifactId>libawall-enums-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.enums</groupId>
|
||||||
|
<artifactId>libawall-enums-service</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.enums</groupId>
|
||||||
|
<artifactId>libawall-enums-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.note</groupId>
|
||||||
|
<artifactId>libawall-note-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.note</groupId>
|
||||||
|
<artifactId>libawall-note-service</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.note</groupId>
|
||||||
|
<artifactId>libawall-note-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.role</groupId>
|
||||||
|
<artifactId>libawall-role-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.role</groupId>
|
||||||
|
<artifactId>libawall-role-service</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.role</groupId>
|
||||||
|
<artifactId>libawall-role-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-service</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>${cn.hutool.all}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.persistence</groupId>
|
||||||
|
<artifactId>javax.persistence-api</artifactId>
|
||||||
|
<version>${javax.persistence-api}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>${junit.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<version>${logback.classic.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.flywaydb</groupId>
|
||||||
|
<artifactId>flyway-core</artifactId>
|
||||||
|
<version>${flyway.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.json</groupId>
|
||||||
|
<artifactId>json</artifactId>
|
||||||
|
<version>${org.json.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpasyncclient</artifactId>
|
||||||
|
<version>${httpasyncclient.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
<version>${spring.web.mvc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>transmittable-thread-local</artifactId>
|
||||||
|
<version>${transmittable-thread-local.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>${slf4j-api.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<version>${guava.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>ox-bo-common</artifactId>
|
||||||
|
<version>${toco-common.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>${httpclient.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpmime</artifactId>
|
||||||
|
<version>${httpclient.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>${jackson-databind.version}</version> <!-- 使用适当的版本 -->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
|
<version>${javax.servlet-api.version}</version> <!-- 使用适当的版本 -->
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>${toco-common.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensearch.client</groupId>
|
||||||
|
<artifactId>opensearch-rest-high-level-client</artifactId>
|
||||||
|
<version>2.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
<version>${swagger-annotations.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-models</artifactId>
|
||||||
|
<version>1.5.21</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>elasticsearch-x-content</artifactId>
|
||||||
|
<groupId>org.elasticsearch</groupId>
|
||||||
|
<version>7.3.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${springfox-swagger-ui.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
|
<version>${springfox-swagger2.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-models</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>${validation-api.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cglib</groupId>
|
||||||
|
<artifactId>cglib-nodep</artifactId>
|
||||||
|
<version>${cglib-nodep.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xuxueli</groupId>
|
||||||
|
<artifactId>xxl-job-core</artifactId>
|
||||||
|
<version>${xxl-job-core.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>common-rpc</artifactId>
|
||||||
|
<version>${toco-common.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>vs-sqlmanager-basic</artifactId>
|
||||||
|
<version>${toco-common.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons-lang3.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
<version>${spring-context.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjrt</artifactId>
|
||||||
|
<version>${org.aspectj.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||||
|
<version>${spring-boot-autoconfigure.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>redis.clients</groupId>
|
||||||
|
<artifactId>jedis</artifactId>
|
||||||
|
<version>${jedis.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>vs-sqlmapper-spring</artifactId>
|
||||||
|
<version>${toco-common.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.toco</groupId>
|
||||||
|
<artifactId>ox-jsqlparser</artifactId>
|
||||||
|
<version>${toco-common.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
<version>${spring-web.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
<version>${spring-boot-starter-data-jpa.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate.validator</groupId>
|
||||||
|
<artifactId>hibernate-validator</artifactId>
|
||||||
|
<version>${hibernate-validator.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.transaction</groupId>
|
||||||
|
<artifactId>javax.transaction-api</artifactId>
|
||||||
|
<version>${javax.transaction-api.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.annotation</groupId>
|
||||||
|
<artifactId>javax.annotation-api</artifactId>
|
||||||
|
<version>${javax.annotation-api.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>${hutool-all.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-spring-boot</artifactId>
|
||||||
|
<version>${rocketmq-spring-boot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-tools</artifactId>
|
||||||
|
<version>${rocketmq-tools.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-client</artifactId>
|
||||||
|
<version>${rocketmq-client.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lobmook.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
|
<version>${spring-boot-dependencies.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>${commons-logging.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.caucho</groupId>
|
||||||
|
<artifactId>hessian</artifactId>
|
||||||
|
<version>${hession.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch</groupId>
|
||||||
|
<artifactId>elasticsearch</artifactId>
|
||||||
|
<version>7.3.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
<artifactId>transport</artifactId>
|
||||||
|
<version>${elasticsearch.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
<artifactId>elasticsearch-rest-client</artifactId>
|
||||||
|
<version>${elasticsearch.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
<artifactId>elasticsearch-rest-client-sniffer</artifactId>
|
||||||
|
<version>${elasticsearch.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||||
|
<version>7.3.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.elasticsearch</groupId>
|
||||||
|
<artifactId>elasticsearch-core</artifactId>
|
||||||
|
<version>${elasticsearch-core.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensearch.client</groupId>
|
||||||
|
<artifactId>opensearch-rest-high-level-client</artifactId>
|
||||||
|
<version>${opensearch.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-core</artifactId>
|
||||||
|
<version>${hibernate.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- libawall dependencies start -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-core</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-dubbo</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-httpclient</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.enums</groupId>
|
||||||
|
<artifactId>libawall-enums-client</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.enums</groupId>
|
||||||
|
<artifactId>libawall-enums-service</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.enums</groupId>
|
||||||
|
<artifactId>libawall-enums-web</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.note</groupId>
|
||||||
|
<artifactId>libawall-note-client</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.note</groupId>
|
||||||
|
<artifactId>libawall-note-service</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.note</groupId>
|
||||||
|
<artifactId>libawall-note-web</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.role</groupId>
|
||||||
|
<artifactId>libawall-role-client</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.role</groupId>
|
||||||
|
<artifactId>libawall-role-service</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.role</groupId>
|
||||||
|
<artifactId>libawall-role-web</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-client</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-service</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-web</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.manage.upload</groupId>
|
||||||
|
<artifactId>libawall-upload-core</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-mybatis</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-mybatisplus</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-quartz</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.rabbitmq</groupId>
|
||||||
|
<artifactId>libawall-rabbitmq-client</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.rabbitmq</groupId>
|
||||||
|
<artifactId>libawall-rabbitmq-service</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.security</groupId>
|
||||||
|
<artifactId>libawall-security-common</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.security</groupId>
|
||||||
|
<artifactId>libawall-security-core</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.security</groupId>
|
||||||
|
<artifactId>libawall-security-oauth</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.security</groupId>
|
||||||
|
<artifactId>libawall-security-session-websocket</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.security</groupId>
|
||||||
|
<artifactId>libawall-security-spring-security</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework.security</groupId>
|
||||||
|
<artifactId>libawall-security-spring-session</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-swagger</artifactId>
|
||||||
|
<version>2.2.0.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-utils</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-web</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.libawallframework</groupId>
|
||||||
|
<artifactId>libawall-xxl-job</artifactId>
|
||||||
|
<version>${libawall.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<modules>
|
||||||
|
<module>entrance</module>
|
||||||
|
<module>common</module>
|
||||||
|
</modules>
|
||||||
|
</project>
|
||||||
3
template/project
Normal file
3
template/project
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
id={{ .projectId }}
|
||||||
|
name={{ .projectName | replace "-" "_" }}
|
||||||
|
version={{ .vsVersion }}
|
||||||
4
template/run.bat
Normal file
4
template/run.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@echo off
|
||||||
|
cd /d %~dp0
|
||||||
|
|
||||||
|
.\mvnw.cmd -Dstyle.color=always spring-boot:run %*
|
||||||
5
template/run.sh
Normal file
5
template/run.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd $(dirname $0)
|
||||||
|
|
||||||
|
./mvnw -Dstyle.color=always spring-boot:run $@
|
||||||
33
values.yml
Normal file
33
values.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
projectName: test_horsepower1
|
||||||
|
groupId: com.test_horsepower1
|
||||||
|
artifactId: '{{ .projectName | replace "-" "_" }}'
|
||||||
|
applicationName: "{{ .projectName }}-server"
|
||||||
|
version: 1.0-SNAPSHOT
|
||||||
|
vsVersion: 1.0.0
|
||||||
|
projectId: 3fdc654b-feb2-4d4a-be19-e9ca2998b5d6
|
||||||
|
dbType: mysql
|
||||||
|
dbHost: 10.0.2.201
|
||||||
|
dbPort: 3306
|
||||||
|
package: "{{ .groupId }}.{{ .artifactId }}"
|
||||||
|
packagePath: '{{ .package | replace "." "/" }}'
|
||||||
|
dbDatabase: '{{ .projectName | replace "-" "_" }}'
|
||||||
|
dbUser: '{{ .projectName | replace "-" "_" }}_user'
|
||||||
|
dbPassword: "{{ randAlphaNum 16 }}"
|
||||||
|
rocketmq_address: "10.0.2.221:9876;10.0.2.222:9876;10.0.2.223:9876"
|
||||||
|
rocketmq_topic: '{{ .projectName | replace "-" "_" }}'
|
||||||
|
rocketmq_consumerGroup: "CID_{{ .artifactId }}"
|
||||||
|
rocketmq_producerGroup: "PID_{{ .artifactId }}"
|
||||||
|
elasticsearch_host: "10.0.2.221,10.0.2.222,10.0.2.223"
|
||||||
|
elasticsearch_port: "9200"
|
||||||
|
elasticsearch_scheme: "https"
|
||||||
|
elasticsearch_username: "admin"
|
||||||
|
elasticsearch_password: "dnZkaNVK"
|
||||||
|
xxljob_address: "https://xxljob.teitui.com/xxl-job-admin"
|
||||||
|
xxljob_username: "admin"
|
||||||
|
xxljob_password: "123456"
|
||||||
|
xxljob_accessToken: "default_token"
|
||||||
|
redis_address: "redis.byteawake.com:6379"
|
||||||
|
redis_password: ""
|
||||||
|
redis_maxTotal: 100
|
||||||
|
redis_maxIdle: 10
|
||||||
|
redis_minIdle: 10
|
||||||
Reference in New Issue
Block a user