Merge branch 'test' of http://172.16.46.63:30001/gitlab/base-version/ztcloud into test
This commit is contained in:
@@ -25,7 +25,7 @@ CREATE TABLE infra_api_access_log (
|
|||||||
user_ip varchar(50) NOT NULL,
|
user_ip varchar(50) NOT NULL,
|
||||||
user_agent varchar(512) NOT NULL,
|
user_agent varchar(512) NOT NULL,
|
||||||
operate_module varchar(50) DEFAULT NULL NULL,
|
operate_module varchar(50) DEFAULT NULL NULL,
|
||||||
operate_name varchar(50) DEFAULT NULL NULL,
|
operate_name varchar(256) DEFAULT NULL NULL,
|
||||||
operate_type smallint DEFAULT 0 NULL,
|
operate_type smallint DEFAULT 0 NULL,
|
||||||
begin_time datetime NOT NULL,
|
begin_time datetime NOT NULL,
|
||||||
end_time datetime NOT NULL,
|
end_time datetime NOT NULL,
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ public class CompanyDataPermissionIgnoreAspect {
|
|||||||
public Object around(ProceedingJoinPoint joinPoint, CompanyDataPermissionIgnore companyDataPermissionIgnore) throws Throwable {
|
public Object around(ProceedingJoinPoint joinPoint, CompanyDataPermissionIgnore companyDataPermissionIgnore) throws Throwable {
|
||||||
boolean oldIgnore = CompanyContextHolder.isIgnore();
|
boolean oldIgnore = CompanyContextHolder.isIgnore();
|
||||||
try {
|
try {
|
||||||
|
if (companyDataPermissionIgnore == null) {
|
||||||
|
Class<?> targetClass = joinPoint.getTarget().getClass();
|
||||||
|
companyDataPermissionIgnore = targetClass.getAnnotation(CompanyDataPermissionIgnore.class);
|
||||||
|
}
|
||||||
Object enable = SpringExpressionUtils.parseExpression(companyDataPermissionIgnore.enable());
|
Object enable = SpringExpressionUtils.parseExpression(companyDataPermissionIgnore.enable());
|
||||||
if (Boolean.TRUE.equals(enable)) {
|
if (Boolean.TRUE.equals(enable)) {
|
||||||
CompanyContextHolder.setIgnore(true);
|
CompanyContextHolder.setIgnore(true);
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ public class DeptDataPermissionIgnoreAspect {
|
|||||||
public Object around(ProceedingJoinPoint joinPoint, DeptDataPermissionIgnore deptDataPermissionIgnore) throws Throwable {
|
public Object around(ProceedingJoinPoint joinPoint, DeptDataPermissionIgnore deptDataPermissionIgnore) throws Throwable {
|
||||||
boolean oldIgnore = DeptContextHolder.shouldIgnore();
|
boolean oldIgnore = DeptContextHolder.shouldIgnore();
|
||||||
try {
|
try {
|
||||||
|
if (deptDataPermissionIgnore == null) {
|
||||||
|
Class<?> targetClass = joinPoint.getTarget().getClass();
|
||||||
|
deptDataPermissionIgnore = targetClass.getAnnotation(DeptDataPermissionIgnore.class);
|
||||||
|
}
|
||||||
Object enable = SpringExpressionUtils.parseExpression(deptDataPermissionIgnore.enable());
|
Object enable = SpringExpressionUtils.parseExpression(deptDataPermissionIgnore.enable());
|
||||||
if (Boolean.TRUE.equals(enable)) {
|
if (Boolean.TRUE.equals(enable)) {
|
||||||
DeptContextHolder.setIgnore(true);
|
DeptContextHolder.setIgnore(true);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class ApiDefinitionStepSaveReqVO {
|
|||||||
@Schema(description = "响应映射表达式(JSON)")
|
@Schema(description = "响应映射表达式(JSON)")
|
||||||
private String responseMappingExpr;
|
private String responseMappingExpr;
|
||||||
|
|
||||||
@Schema(description = "超时时间(毫秒)", example = "5000")
|
@Schema(description = "超时时间(毫秒),缺省 20000(20s)", example = "20000")
|
||||||
private Long timeout;
|
private Long timeout;
|
||||||
|
|
||||||
@Schema(description = "降级策略(JSON)")
|
@Schema(description = "降级策略(JSON)")
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class HttpStepHandler implements ApiStepHandler {
|
|||||||
|
|
||||||
private static final Duration RETRY_DELAY = Duration.ofMillis(200);
|
private static final Duration RETRY_DELAY = Duration.ofMillis(200);
|
||||||
private static final int RETRY_ATTEMPTS = 3;
|
private static final int RETRY_ATTEMPTS = 3;
|
||||||
|
private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(20);
|
||||||
|
|
||||||
private static final Set<String> DEFAULT_FORWARDED_HEADERS = Set.of(
|
private static final Set<String> DEFAULT_FORWARDED_HEADERS = Set.of(
|
||||||
"authorization",
|
"authorization",
|
||||||
@@ -229,7 +230,7 @@ public class HttpStepHandler implements ApiStepHandler {
|
|||||||
private Duration resolveTimeout(ApiStepDefinition stepDefinition) {
|
private Duration resolveTimeout(ApiStepDefinition stepDefinition) {
|
||||||
Long timeout = stepDefinition.getStep().getTimeout();
|
Long timeout = stepDefinition.getStep().getTimeout();
|
||||||
if (timeout == null || timeout <= 0) {
|
if (timeout == null || timeout <= 0) {
|
||||||
return Duration.ofSeconds(5);
|
return DEFAULT_TIMEOUT;
|
||||||
}
|
}
|
||||||
return Duration.ofMillis(timeout);
|
return Duration.ofMillis(timeout);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user