mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
Merge branch 'master' into 5.0
# Conflicts: # doc/docs/files/10011_项目接入到SOP.md # pom.xml # sop-common/sop-bridge-nacos/pom.xml # sop-common/sop-service-common/pom.xml
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.gitee.sop.gateway;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@MapperScan(basePackages = {
|
||||
"com.gitee.sop.gateway.mapper"
|
||||
})
|
||||
@SpringBootApplication(scanBasePackages = "com.gitee.sop")
|
||||
public class SopGatewayApplication {
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.gitee.sop.gateway.config;
|
||||
|
||||
import com.gitee.sop.gatewaycommon.bean.ApiConfig;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -16,12 +13,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "config_gray")
|
||||
@Table(name = "config_gray",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class ConfigGray {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -15,12 +12,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "config_gray_instance")
|
||||
@Table(name = "config_gray_instance",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class ConfigGrayInstance {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -16,12 +13,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "config_limit")
|
||||
@Table(name = "config_limit",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class ConfigLimit {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
|
||||
|
||||
/**
|
||||
@@ -15,12 +12,9 @@ import javax.persistence.Table;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "config_route_base")
|
||||
@Table(name = "config_route_base",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class ConfigRouteBase {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -16,12 +13,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "config_service_route")
|
||||
@Table(name = "config_service_route",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class ConfigServiceRoute {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
/** 数据库字段:id */
|
||||
private String id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -16,12 +13,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "isv_info")
|
||||
@Table(name = "isv_info",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class IsvInfo {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -17,13 +14,10 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "monitor_info")
|
||||
@Table(name = "monitor_info",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class MonitorInfo {
|
||||
/** 数据库字段:id */
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
/** 路由id, 数据库字段:route_id */
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -16,13 +13,10 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "monitor_info_error")
|
||||
@Table(name = "monitor_info_error",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class MonitorInfoError {
|
||||
/** 数据库字段:id */
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
/** 错误id,md5Hex(instanceId + routeId + errorMsg), 数据库字段:error_id */
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -16,12 +13,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "perm_isv_role")
|
||||
@Table(name = "perm_isv_role",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class PermIsvRole {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,11 +2,8 @@ package com.gitee.sop.gateway.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import com.gitee.fastmybatis.annotation.Pk;
|
||||
import com.gitee.fastmybatis.annotation.Table;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -16,12 +13,9 @@ import java.util.Date;
|
||||
*
|
||||
* @author tanghc
|
||||
*/
|
||||
@Table(name = "perm_role_permission")
|
||||
@Table(name = "perm_role_permission",pk = @Pk(name = "id"))
|
||||
@Data
|
||||
public class PermRolePermission {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
/** 数据库字段:id */
|
||||
private Long id;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gitee.sop.gateway.interceptor;
|
||||
|
||||
import com.gitee.sop.gateway.mapper.DbMonitorInfoManager;
|
||||
import com.gitee.sop.gateway.manager.DbMonitorInfoManager;
|
||||
import com.gitee.sop.gatewaycommon.bean.LRUCache;
|
||||
import com.gitee.sop.gatewaycommon.interceptor.RouteInterceptorContext;
|
||||
import com.gitee.sop.gatewaycommon.monitor.MonitorDTO;
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package com.gitee.sop.gateway.mapper;
|
||||
package com.gitee.sop.gateway.manager;
|
||||
|
||||
import com.gitee.sop.gateway.mapper.MonitorInfoErrorMapper;
|
||||
import com.gitee.sop.gateway.mapper.MonitorInfoMapper;
|
||||
import com.gitee.sop.gatewaycommon.monitor.MonitorDTO;
|
||||
import com.gitee.sop.gatewaycommon.monitor.MonitorErrorMsg;
|
||||
import com.gitee.sop.gatewaycommon.monitor.RouteErrorCount;
|
@@ -1,22 +1,22 @@
|
||||
package com.gitee.sop.gateway;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
*/
|
||||
public class ExcludeTest extends TestCase {
|
||||
public void testRegex() {
|
||||
String serviceId = "com.aaa.bbb.story-service";
|
||||
String sopServiceExcludeRegex = "com\\..*;story\\-.*";
|
||||
if (StringUtils.isNotBlank(sopServiceExcludeRegex)) {
|
||||
String[] regexArr = sopServiceExcludeRegex.split(";");
|
||||
for (String regex : regexArr) {
|
||||
if (serviceId.matches(regex)) {
|
||||
System.out.println("111");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//package com.gitee.sop.gateway;
|
||||
//
|
||||
//import junit.framework.TestCase;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//
|
||||
///**
|
||||
// * @author tanghc
|
||||
// */
|
||||
//public class ExcludeTest extends TestCase {
|
||||
// public void testRegex() {
|
||||
// String serviceId = "com.aaa.bbb.story-service";
|
||||
// String sopServiceExcludeRegex = "com\\..*;story\\-.*";
|
||||
// if (StringUtils.isNotBlank(sopServiceExcludeRegex)) {
|
||||
// String[] regexArr = sopServiceExcludeRegex.split(";");
|
||||
// for (String regex : regexArr) {
|
||||
// if (serviceId.matches(regex)) {
|
||||
// System.out.println("111");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
Reference in New Issue
Block a user