update to spring-boot-2.1.8.RELEASE & spring-cloud-Greenwich.SR3
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
|
||||
<p align="center">
|
||||
<img src='https://img.shields.io/badge/license-Apache%202-4EB1BA.svg' alt='License'/>
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.0.9.RELEASE-blue" alt="Downloads"/>
|
||||
<img src="https://img.shields.io/badge/Spring%20Cloud-Finchley.SR4-blue" alt="Downloads"/>
|
||||
<img src="https://img.shields.io/badge/Spring%20Cloud%20Alibaba-2.0.0.RELEASE-blue" alt="Downloads"/>
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.1.8.RELEASE-blue" alt="Downloads"/>
|
||||
<img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR3-blue" alt="Downloads"/>
|
||||
<img src="https://img.shields.io/badge/Spring%20Cloud%20Alibaba-2.1.0.RELEASE-blue" alt="Downloads"/>
|
||||
<img src="https://img.shields.io/badge/Layui-EasyWeb-yellowgreen" alt="Downloads"/>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
## 如果您觉得有帮助,请点右上角 "Star" 支持一下谢谢
|
||||
|
||||
[TOC]
|
||||
@@ -37,8 +38,6 @@
|
||||
* 注重代码规范,严格控制包依赖,每个工程基本都是最小依赖
|
||||
* 非常适合学习和企业中使用
|
||||
|
||||
> 重构于开源项目OCP&cp:https://gitee.com/owenwangwen/open-capacity-platform
|
||||
|
||||
|
||||
|
||||
## 2. 项目总体架构图
|
||||
|
||||
@@ -41,11 +41,15 @@
|
||||
<userAgent.version>1.21</userAgent.version>
|
||||
<transmittable.version>2.11.0</transmittable.version>
|
||||
<lettuce.version>5.1.8.RELEASE</lettuce.version>
|
||||
<banner.versio>1.0.2</banner.versio>
|
||||
<platform-bom>Cairo-SR3</platform-bom>
|
||||
<spring-cloud-alibaba-dependencies.version>2.0.0.RELEASE</spring-cloud-alibaba-dependencies.version>
|
||||
<spring-boot-dependencies.version>2.0.9.RELEASE</spring-boot-dependencies.version>
|
||||
<spring-cloud-dependencies.version>Finchley.SR4</spring-cloud-dependencies.version>
|
||||
<banner.version>1.0.2</banner.version>
|
||||
<commons-beanutils.version>1.9.4</commons-beanutils.version>
|
||||
<spring-social-security.version>1.1.6.RELEASE</spring-social-security.version>
|
||||
<commons-io.version>2.6</commons-io.version>
|
||||
<servlet-api.version>4.0.1</servlet-api.version>
|
||||
<!--<platform-bom>Cairo-SR3</platform-bom>-->
|
||||
<spring-cloud-alibaba-dependencies.version>2.1.0.RELEASE</spring-cloud-alibaba-dependencies.version>
|
||||
<spring-boot-dependencies.version>2.1.8.RELEASE</spring-boot-dependencies.version>
|
||||
<spring-cloud-dependencies.version>Greenwich.SR3</spring-cloud-dependencies.version>
|
||||
<spring-boot-maven-plugin.version>2.1.1.RELEASE</spring-boot-maven-plugin.version>
|
||||
<docker-maven-plugin.version>1.2.0</docker-maven-plugin.version>
|
||||
<sonar.exclusions>zlt-job/**/*, zlt-register/**/*, zlt-web/**/*</sonar.exclusions>
|
||||
@@ -69,6 +73,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>${commons-beanutils.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
@@ -313,7 +318,22 @@
|
||||
<dependency>
|
||||
<groupId>com.nepxion</groupId>
|
||||
<artifactId>banner</artifactId>
|
||||
<version>${banner.versio}</version>
|
||||
<version>${banner.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.social</groupId>
|
||||
<artifactId>spring-social-security</artifactId>
|
||||
<version>${spring-social-security.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons-io.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>${servlet-api.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -323,13 +343,13 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!--<dependency>
|
||||
<groupId>io.spring.platform</groupId>
|
||||
<artifactId>platform-bom</artifactId>
|
||||
<version>${platform-bom}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/user-center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:/mapper/*Mapper.xml
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/file_center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:/mapper/*Mapper.xml
|
||||
|
||||
+4
-4
@@ -52,8 +52,8 @@ public class IndexController {
|
||||
/**
|
||||
* 索引明细
|
||||
*/
|
||||
@GetMapping("/index/{indexName}")
|
||||
public Result<Map<String, Object>> showIndex(@PathVariable String indexName) {
|
||||
@GetMapping("/index")
|
||||
public Result<Map<String, Object>> showIndex(String indexName) {
|
||||
Map<String, Object> result = indexService.show(indexName);
|
||||
return Result.succeed(result);
|
||||
}
|
||||
@@ -61,8 +61,8 @@ public class IndexController {
|
||||
/**
|
||||
* 删除索引
|
||||
*/
|
||||
@DeleteMapping("/index/{indexName}")
|
||||
public Result deleteIndex(@PathVariable String indexName) {
|
||||
@DeleteMapping("/index")
|
||||
public Result deleteIndex(String indexName) {
|
||||
indexService.delete(indexName);
|
||||
return Result.succeed("操作成功");
|
||||
}
|
||||
|
||||
+8
-2
@@ -1,6 +1,7 @@
|
||||
package com.central.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import com.central.admin.model.IndexDto;
|
||||
import com.central.admin.model.IndexVo;
|
||||
@@ -115,7 +116,12 @@ public class IndexServiceImpl implements IIndexService {
|
||||
|
||||
IndexMetaData indexMetaData = stat.get(indexName);
|
||||
//获取settings数据
|
||||
Map<String, String> settMap = indexMetaData.getSettings().getAsMap();
|
||||
String settingsStr = indexMetaData.getSettings().toString();
|
||||
Object settingsObj = null;
|
||||
if (StrUtil.isNotEmpty(settingsStr)) {
|
||||
settingsObj = JSONObject.parse(settingsStr);
|
||||
}
|
||||
|
||||
ImmutableOpenMap<String, MappingMetaData> mappOpenMap = indexMetaData.getMappings();
|
||||
ImmutableOpenMap<String, AliasMetaData> aliasesOpenMap = indexMetaData.getAliases();
|
||||
Map<String, Object> result = new HashMap<>(1);
|
||||
@@ -123,7 +129,7 @@ public class IndexServiceImpl implements IIndexService {
|
||||
Map<String, Object> mappMap = new HashMap<>(mappOpenMap.size());
|
||||
Map<String, Object> aliasesMap = new HashMap<>(aliasesOpenMap.size());
|
||||
indexMap.put("aliases", aliasesMap);
|
||||
indexMap.put("settings", settMap);
|
||||
indexMap.put("settings", settingsObj);
|
||||
indexMap.put("mappings", mappMap);
|
||||
result.put(indexName, indexMap);
|
||||
//获取mappings数据
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import org.elasticsearch.search.aggregations.Aggregations;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.ExtendedBounds;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.InternalDateHistogram;
|
||||
import org.elasticsearch.search.aggregations.bucket.range.date.InternalDateRange;
|
||||
import org.elasticsearch.search.aggregations.bucket.range.InternalDateRange;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
||||
import org.elasticsearch.search.aggregations.metrics.cardinality.Cardinality;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
@@ -2,7 +2,10 @@ spring:
|
||||
data:
|
||||
elasticsearch:
|
||||
cluster-name: ${zlt.elasticsearch.cluster-name}
|
||||
cluster-nodes: ${zlt.elasticsearch.cluster-nodes}
|
||||
cluster-nodes: ${zlt.elasticsearch.cluster-nodes}:9300
|
||||
elasticsearch:
|
||||
rest:
|
||||
uris: ${zlt.elasticsearch.cluster-nodes}:9200
|
||||
|
||||
zlt:
|
||||
indices:
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/user-center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:/mapper/*Mapper.xml
|
||||
|
||||
@@ -40,5 +40,10 @@
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package com.central.oauth2.common.annotation;
|
||||
|
||||
import com.central.oauth2.common.config.TokenStoreConfig;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 开启token存储认证配置化
|
||||
*
|
||||
* @author zlt
|
||||
* @date 2019/7/7
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Import(TokenStoreConfig.class)
|
||||
public @interface EnableTokenStore {
|
||||
}
|
||||
+1
@@ -10,6 +10,7 @@ import org.springframework.context.annotation.Import;
|
||||
*
|
||||
* @author zlt
|
||||
*/
|
||||
@Configuration
|
||||
public class TokenStoreConfig {
|
||||
@Configuration
|
||||
@ConditionalOnProperty(prefix = "zlt.oauth2.token.store", name = "type", havingValue = "db")
|
||||
|
||||
@@ -11,7 +11,7 @@ spring.redis.timeout=5000
|
||||
|
||||
##### elasticsearch配置
|
||||
zlt.elasticsearch.cluster-name=my-es
|
||||
zlt.elasticsearch.cluster-nodes=192.168.28.130:9300
|
||||
zlt.elasticsearch.cluster-nodes=119.3.105.180
|
||||
|
||||
##### sentinel配置
|
||||
zlt.sentinel.dashboard=192.168.28.130:6999
|
||||
|
||||
@@ -11,7 +11,7 @@ spring.redis.password=1q2w3e4r
|
||||
|
||||
##### elasticsearch配置
|
||||
zlt.elasticsearch.cluster-name=my-es
|
||||
zlt.elasticsearch.cluster-nodes=192.168.28.130:9300
|
||||
zlt.elasticsearch.cluster-nodes=192.168.28.130
|
||||
|
||||
##### sentinel配置
|
||||
zlt.sentinel.dashboard=192.168.28.130:6999
|
||||
|
||||
@@ -11,7 +11,7 @@ spring.redis.timeout=5000
|
||||
|
||||
##### elasticsearch配置
|
||||
zlt.elasticsearch.cluster-name=my-es
|
||||
zlt.elasticsearch.cluster-nodes=192.168.28.130:9300
|
||||
zlt.elasticsearch.cluster-nodes=192.168.28.130
|
||||
|
||||
##### sentinel配置
|
||||
zlt.sentinel.dashboard=192.168.28.130:6999
|
||||
|
||||
@@ -102,4 +102,8 @@ spring.redis.lettuce.pool.max-wait=-1
|
||||
# 连接池中的最大空闲连接
|
||||
spring.redis.lettuce.pool.max-idle=8
|
||||
# 连接池中的最小空闲连接
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
|
||||
|
||||
##### 允许bean覆盖
|
||||
spring.main.allow-bean-definition-overriding=true
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://192.168.28.130:3306/seata-demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: root
|
||||
password: 1q2w3e4r
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
cloud:
|
||||
alibaba:
|
||||
seata:
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://192.168.28.130:3306/seata-demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: root
|
||||
password: 1q2w3e4r
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
cloud:
|
||||
alibaba:
|
||||
seata:
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://192.168.28.130:3306/seata-demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: root
|
||||
password: 1q2w3e4r
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
cloud:
|
||||
alibaba:
|
||||
seata:
|
||||
|
||||
@@ -4,19 +4,19 @@ sharding:
|
||||
names: ds-master,ds-slave-0,ds-slave-1
|
||||
ds-master:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_master?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
ds-slave-0:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_slave_0?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
ds-slave-1:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_slave_1?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
|
||||
@@ -4,13 +4,13 @@ sharding:
|
||||
names: ds-0,ds-1
|
||||
ds-0:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_0?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
ds-1:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_1?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
|
||||
@@ -4,13 +4,13 @@ sharding:
|
||||
names: ds-alibaba,ds-baidu
|
||||
ds-alibaba:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_alibaba?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
ds-baidu:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_baidu?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
|
||||
@@ -4,19 +4,19 @@ sharding:
|
||||
names: ds,ds-0,ds-1
|
||||
ds:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
ds-0:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_0?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
ds-1:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_1?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
|
||||
@@ -4,7 +4,7 @@ sharding:
|
||||
names: ds
|
||||
ds:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
*
|
||||
* @author ujued
|
||||
*/
|
||||
@FeignClient(value = "txlcn-demo-spring-service-b", fallback = ServiceBFallback.class)
|
||||
@FeignClient(value = "txlcn-demo-spring-service-b")
|
||||
public interface ServiceBClient {
|
||||
|
||||
@GetMapping("/rpc")
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package org.txlcn.demo.common.spring;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 19-2-19 下午1:53
|
||||
*
|
||||
* @author ujued
|
||||
*/
|
||||
@Component
|
||||
public class ServiceBFallback implements ServiceBClient {
|
||||
@Override
|
||||
public String rpc(String name) {
|
||||
return "fallback";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
*
|
||||
* @author ujued
|
||||
*/
|
||||
@FeignClient(value = "txlcn-demo-spring-service-c", fallback = ServiceCFallback.class)
|
||||
@FeignClient(value = "txlcn-demo-spring-service-c")
|
||||
public interface ServiceCClient {
|
||||
|
||||
@GetMapping("/rpc")
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package org.txlcn.demo.common.spring;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 19-2-19 下午1:53
|
||||
*
|
||||
* @author ujued
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ServiceCFallback implements ServiceCClient {
|
||||
@Override
|
||||
public String rpc(String name) {
|
||||
return "fallback";
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/txlcn-demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
@@ -13,7 +13,7 @@ tx-lcn:
|
||||
enabled: true
|
||||
logger:
|
||||
enabled: true
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://${zlt.datasource.ip}:3306/tx_logger?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
@@ -1,6 +1,6 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/txlcn-demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
@@ -13,7 +13,7 @@ tx-lcn:
|
||||
enabled: true
|
||||
logger:
|
||||
enabled: true
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://${zlt.datasource.ip}:3306/tx_logger?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
@@ -1,6 +1,6 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/txlcn-demo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
@@ -13,7 +13,7 @@ tx-lcn:
|
||||
enabled: true
|
||||
logger:
|
||||
enabled: true
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://${zlt.datasource.ip}:3306/tx_logger?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
-2
@@ -1,7 +1,6 @@
|
||||
package com.central.gateway.config;
|
||||
|
||||
import com.central.common.config.DefaultPasswordConfig;
|
||||
import com.central.oauth2.common.annotation.EnableTokenStore;
|
||||
import com.central.oauth2.common.config.DefaultResourceServerConf;
|
||||
import com.central.oauth2.common.properties.SecurityProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -19,7 +18,6 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.E
|
||||
@Configuration
|
||||
@EnableResourceServer
|
||||
@EnableConfigurationProperties(SecurityProperties.class)
|
||||
@EnableTokenStore
|
||||
@Import({DefaultPasswordConfig.class})
|
||||
public class ResourceServerConfiguration extends DefaultResourceServerConf {
|
||||
@Autowired
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#################
|
||||
spring.profiles.active=dev
|
||||
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://${zlt.datasource.ip}:3306/tx-manager?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=${zlt.datasource.username}
|
||||
spring.datasource.password=${zlt.datasource.password}
|
||||
@@ -11,7 +11,7 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
|
||||
tx-lcn.logger.enabled=true
|
||||
tx-lcn.logger.driver-class-name=com.mysql.jdbc.Driver
|
||||
tx-lcn.logger.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
tx-lcn.logger.jdbc-url=jdbc:mysql://${zlt.datasource.ip}:3306/tx_logger?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
tx-lcn.logger.username=${zlt.datasource.username}
|
||||
tx-lcn.logger.password=${zlt.datasource.password}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.central.oauth.config;
|
||||
|
||||
import com.central.oauth.service.impl.RedisClientDetailsService;
|
||||
import com.central.oauth2.common.annotation.EnableTokenStore;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -30,7 +29,6 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAuthorizationServer
|
||||
@EnableTokenStore
|
||||
@AutoConfigureAfter(AuthorizationServerEndpointsConfigurer.class)
|
||||
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.central.oauth.handler;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.central.oauth2.common.util.AuthUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/oauth-center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:/mapper/*Mapper.xml
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
layer.confirm('确定要删除吗?', function (i) {
|
||||
layer.close(i);
|
||||
layer.load(2);
|
||||
admin.req('api-search/admin/index/' + obj.data.indexName, {}, function (data) {
|
||||
admin.req('api-search/admin/index?indexName='+obj.data.indexName, {}, function (data) {
|
||||
layer.closeAll('loading');
|
||||
if (data.resp_code == 0) {
|
||||
layer.msg(data.resp_msg, {icon: 1, time: 500});
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// 回显user数据
|
||||
let indexName = admin.getTempData('indexName');
|
||||
if (indexName) {
|
||||
admin.req('api-search/admin/index/'+indexName, {}, function (data) {
|
||||
admin.req('api-search/admin/index', {'indexName':indexName}, function (data) {
|
||||
layer.closeAll('loading');
|
||||
if (0 == data.resp_code) {
|
||||
$('#data').html(syntaxHighlight(data.datas));
|
||||
|
||||
Reference in New Issue
Block a user