feat: 优化部分文案

This commit is contained in:
zengxiaobo 2024-04-28 16:11:20 +08:00
parent 37b646f708
commit f79a63d09c
6 changed files with 15 additions and 18 deletions

View File

@ -1,5 +1,6 @@
package cn.axzo.foundation.event.support; package cn.axzo.foundation.event.support;
import cn.axzo.foundation.util.FastjsonUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.NonNull; import lombok.NonNull;
@ -16,7 +17,7 @@ public interface PayloadDifferentiator {
* 建议使用 FastjsonUtils.diffJson() 产生 diff 数据 * 建议使用 FastjsonUtils.diffJson() 产生 diff 数据
* @param payload * @param payload
* @return diff 文本. * @return diff 文本.
* @see com.fiture.bfs.utils.FastjsonUtils.diffJson() * @see cn.axzo.foundation.util.FastjsonUtils#diffJson
*/ */
String buildDiffText(@NonNull JSONObject payload); String buildDiffText(@NonNull JSONObject payload);
} }

View File

@ -22,9 +22,9 @@ import java.util.stream.Stream;
/** /**
* 用于支持h2兼容mysql中json的函数 * 用于支持h2兼容mysql中json的函数
* eg: * eg:
* CREATE ALIAS `JSON_EXTRACT` FOR "com.fiture.bfs.unittest.h2.JsonFunctions.extract"; * CREATE ALIAS `JSON_EXTRACT` FOR "cn.axzo.foundation.unittest.support.h2.JsonFunctions.extract";
* CREATE ALIAS `JSON_CONTAINS` FOR "com.fiture.bfs.unittest.h2.JsonFunctions.contains"; * CREATE ALIAS `JSON_CONTAINS` FOR "cn.axzo.foundation.unittest.support.h2.JsonFunctions.contains";
* CREATE ALIAS `JSON_LENGTH` FOR "com.fiture.bfs.unittest.h2.JsonFunctions.length"; * CREATE ALIAS `JSON_LENGTH` FOR "cn.axzo.foundation.unittest.support.h2.JsonFunctions.length";
* *
* NOTE: JSON.parse(json, Feature.AutoCloseSource)其中Feature.AutoCloseSource是为了兼容fastjson2. 默认该feature在JSON中已经开启 * NOTE: JSON.parse(json, Feature.AutoCloseSource)其中Feature.AutoCloseSource是为了兼容fastjson2. 默认该feature在JSON中已经开启
*/ */

View File

@ -6,12 +6,12 @@ import java.util.Objects;
/** /**
* 用于支持h2兼容mysql中string的函数 * 用于支持h2兼容mysql中string的函数
* eg: * eg:
* CREATE ALIAS FIND_IN_SET FOR "com.fiture.bfs.unittest.h2.StringFunctions.findInSet"; * CREATE ALIAS FIND_IN_SET FOR "cn.axzo.foundation.unittest.support.h2.StringFunctions.findInSet";
*/ */
public class StringFunctions { public class StringFunctions {
/** /**
* CREATE ALIAS FIND_IN_SET FOR "com.fiture.bfs.unittest.h2.StringFunctions.findInSet"; * CREATE ALIAS FIND_IN_SET FOR "cn.axzo.foundation.unittest.support.h2.StringFunctions.findInSet";
*/ */
public static Integer findInSet(String str, String strList) { public static Integer findInSet(String str, String strList) {
if (!Objects.isNull(str) && !Objects.isNull(strList)) { if (!Objects.isNull(str) && !Objects.isNull(strList)) {

View File

@ -133,7 +133,7 @@ public class DefaultWebMvcConfig extends DelegatingWebMvcConfiguration implement
// https://baijiahao.baidu.com/s?id=1671603044044877345&wfr=spider&for=pc // https://baijiahao.baidu.com/s?id=1671603044044877345&wfr=spider&for=pc
// 使用安全模式关闭 AutoType // 使用安全模式关闭 AutoType
//TODO 为了适配现有的fiture项目. 降低版本不支持该方法 //TODO 为了适配现有的项目. 降低版本不支持该方法
//ParserConfig.getGlobalInstance().setSafeMode(true); //ParserConfig.getGlobalInstance().setSafeMode(true);
} }

View File

@ -23,14 +23,11 @@ import java.util.stream.Collectors;
@AllArgsConstructor @AllArgsConstructor
public class RequestParams { public class RequestParams {
private static final String AUTHORIZATION_HEADER_TOKEN_PREFIX = "Bearer "; private static final String AUTHORIZATION_HEADER_TOKEN_PREFIX = "Bearer ";
@Deprecated private static final String AUTHORIZATION_HEADER_NAME = "Axzo-Authorization";
private static final String LEGACY_AUTHORIZATION_HEADER_NAME = "Authorization";
private static final String AUTHORIZATION_HEADER_NAME = "Bfs-Authorization";
private static final int MAX_REQUEST_BODY_LOG_SIZE = 1024; private static final int MAX_REQUEST_BODY_LOG_SIZE = 1024;
private static final ImmutableSet<String> PRETTY_PRINT_HEADERS = ImmutableSet.of("fiture-session"); private static final ImmutableSet<String> PRETTY_PRINT_HEADERS = ImmutableSet.of("userinfo");
private static final ImmutableSet<String> IGNORE_PRINT_HEADERS = ImmutableSet.of(LEGACY_AUTHORIZATION_HEADER_NAME, AUTHORIZATION_HEADER_NAME, private static final ImmutableSet<String> IGNORE_PRINT_HEADERS = ImmutableSet.of(AUTHORIZATION_HEADER_NAME, "User-Agent");
"User-Agent", "_HTTP_APP_CLIENT_OBJECT", "_HTTP_SESSION_OBJECT", "_EMPLOYEE_PRINCIPAL");
@Getter @Getter
Map<String, String> headers; Map<String, String> headers;
@ -135,7 +132,6 @@ public class RequestParams {
public void addAuthorization(String token) { public void addAuthorization(String token) {
String authToken = AUTHORIZATION_HEADER_TOKEN_PREFIX + token; String authToken = AUTHORIZATION_HEADER_TOKEN_PREFIX + token;
addHeader(AUTHORIZATION_HEADER_NAME, authToken); addHeader(AUTHORIZATION_HEADER_NAME, authToken);
addHeader(LEGACY_AUTHORIZATION_HEADER_NAME, authToken);
} }
public void addHeader(String name, String value) { public void addHeader(String name, String value) {

View File

@ -109,14 +109,14 @@ public interface RpcClient {
}); });
} }
Set<String> FITURE_HEADERS = ImmutableSet.of(); Set<String> AXZO_HEADERS = ImmutableSet.of();
// XXX: http/2会把所有Header都转成小写, 历史定义的Header都是大写的在http/2协议下会透传失败 // XXX: http/2会把所有Header都转成小写, 历史定义的Header都是大写的在http/2协议下会透传失败
TreeSet<String> CASE_INSENSITIVE_FITURE_HEADERS = FITURE_HEADERS.stream() TreeSet<String> CASE_INSENSITIVE_AXZO_HEADERS = AXZO_HEADERS.stream()
.collect(Collectors.toCollection(() -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER))); .collect(Collectors.toCollection(() -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER)));
// fiture-开头的header复制到请求的下一跳 // axzo-开头的header复制到请求的下一跳
String BFS_HEADER_PREFIX = "fiture-"; String AZXO_HEADER_PREFIX = "axzo-";
List<Supplier<Map<String, String>>> DEFAULT_HEADER_SUPPLIERS = ImmutableList.of(); List<Supplier<Map<String, String>>> DEFAULT_HEADER_SUPPLIERS = ImmutableList.of();