调整启动的扫描路径,去除重复注册。

pull/7/MERGE
tanghc 4 years ago
parent 8c8b1c7442
commit c49b6eecaa
  1. 1
      changelog.md
  2. 5
      pom.xml
  3. 5
      sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/api/service/MonitorApi.java
  4. 1
      sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/api/service/MonitorNewApi.java
  5. 24
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/BaseGatewayConfiguration.java
  6. 21
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/ErrorLogController.java
  7. 21
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/GatewayMonitorController.java
  8. 8
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/loadbalancer/LoadBalanceConfig.java
  9. 2
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/EnvGrayManager.java
  10. 1
      sop-common/sop-service-common/pom.xml
  11. 10
      sop-gateway/pom.xml
  12. 2
      sop-gateway/src/main/java/com/gitee/sop/gateway/SopGatewayApplication.java

@ -5,6 +5,7 @@
需要执行`sop-upgrade-4.1.0.sql`
- 重构路由监控功能
- 升级SpringBoot,SpringCloud,SpringCloudAlibaba版本
## 4.0.3

@ -46,7 +46,6 @@
<!-- Logging -->
<logback.version>1.2.3</logback.version>
<!-- <slf4j.version>1.7.5</slf4j.version>-->
<!-- Test -->
<junit.version>4.11</junit.version>
@ -58,8 +57,8 @@
<commons-lang3.version>3.8.1</commons-lang3.version>
<commons-codec.version>1.11</commons-codec.version>
<commons-logging.version>1.2</commons-logging.version>
<!-- <validation-api.version>2.0.1.Final</validation-api.version>-->
<!-- <hibernate-validator.version>6.0.13.Final</hibernate-validator.version>-->
<validation-api.version>2.0.1.Final</validation-api.version>
<hibernate-validator.version>6.0.13.Final</hibernate-validator.version>
<fastmybatis.version>1.9.1</fastmybatis.version>
<spring-data-redis.version>2.3.0.RELEASE</spring-data-redis.version>
<guava.version>29.0-jre</guava.version>

@ -29,8 +29,11 @@ import java.util.stream.Collectors;
/**
* @author tanghc
* @deprecated use com.gitee.sop.adminserver.api.service.MonitorNewApi
* @see MonitorNewApi
*/
@ApiService
@Deprecated
//@ApiService
@ApiDoc("服务管理-监控")
@Slf4j
public class MonitorApi {

@ -25,6 +25,7 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
* 路由监控
* @author tanghc
*/
@ApiService

@ -1,10 +1,6 @@
package com.gitee.sop.gatewaycommon.gateway.configuration;
import com.gitee.sop.gatewaycommon.bean.ApiConfig;
import com.gitee.sop.gatewaycommon.gateway.controller.ConfigChannelController;
import com.gitee.sop.gatewaycommon.gateway.controller.ErrorLogController;
import com.gitee.sop.gatewaycommon.gateway.controller.GatewayController;
import com.gitee.sop.gatewaycommon.gateway.controller.GatewayMonitorController;
import com.gitee.sop.gatewaycommon.gateway.filter.GatewayModifyResponseGatewayFilter;
import com.gitee.sop.gatewaycommon.gateway.filter.IndexFilter;
import com.gitee.sop.gatewaycommon.gateway.filter.LimitFilter;
@ -50,26 +46,6 @@ public class BaseGatewayConfiguration extends AbstractConfiguration {
return new IndexFilter();
}
@Bean
public GatewayController gatewayErrorController() {
return new GatewayController();
}
@Bean
public ConfigChannelController configChannelController() {
return new ConfigChannelController();
}
@Bean
public ErrorLogController errorLogController() {
return new ErrorLogController();
}
@Bean
public GatewayMonitorController gatewayMonitorController() {
return new GatewayMonitorController();
}
/**
* 自定义异常处理[@@]注册Bean时依赖的Bean会从容器中直接获取所以直接注入即可
*

@ -1,21 +0,0 @@
package com.gitee.sop.gatewaycommon.gateway.controller;
import com.gitee.sop.gatewaycommon.bean.BaseErrorLogController;
import com.gitee.sop.gatewaycommon.param.ApiParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import java.util.Map;
/**
* @author tanghc
*/
@RestController
public class ErrorLogController extends BaseErrorLogController<ServerWebExchange> {
@Override
protected ApiParam getApiParam(ServerWebExchange request) {
Map<String, String> params = request.getRequest().getQueryParams().toSingleValueMap();
return ApiParam.build(params);
}
}

@ -1,21 +0,0 @@
package com.gitee.sop.gatewaycommon.gateway.controller;
import com.gitee.sop.gatewaycommon.support.BaseMonitorController;
import com.gitee.sop.gatewaycommon.param.ApiParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import java.util.Map;
/**
* @author tanghc
*/
@RestController
public class GatewayMonitorController extends BaseMonitorController<ServerWebExchange> {
@Override
protected ApiParam getApiParam(ServerWebExchange request) {
Map<String, String> params = request.getRequest().getQueryParams().toSingleValueMap();
return ApiParam.build(params);
}
}

@ -1,8 +0,0 @@
package com.gitee.sop.gatewaycommon.loadbalancer;
/**
* @author tanghc
*/
public class LoadBalanceConfig {
}

@ -8,8 +8,6 @@ import com.gitee.sop.gatewaycommon.loadbalancer.ServiceGrayConfig;
*/
public interface EnvGrayManager extends BeanInitializer {
String ENV_GRAY = "sop.env-gray";
/**
* 保存灰度配置
* @param serviceGrayConfig 灰度配置

@ -65,7 +65,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.4.RELEASE</version>
<optional>true</optional>
</dependency>
<dependency>

@ -40,16 +40,6 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--
修复:Spring Cloud Hoxton.SR1 gateway 与reactor-netty 0.9.3.RELEASE不兼容问题
https://blog.csdn.net/sun800711/article/details/104061049
-->
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.9.4.RELEASE</version>
</dependency>
<dependency>
<groupId>net.oschina.durcframework</groupId>
<artifactId>fastmybatis-spring-boot-starter</artifactId>

@ -3,7 +3,7 @@ package com.gitee.sop.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = "com.gitee.sop")
public class SopGatewayApplication {
public static void main(String[] args) {

Loading…
Cancel
Save