mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
system微服务util单元测试完善
This commit is contained in:
+3
@@ -14,6 +14,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* @since 2025/11/12 13:38
|
||||
*/
|
||||
public class DictDataI18nCacheUtils {
|
||||
private DictDataI18nCacheUtils() {
|
||||
}
|
||||
|
||||
private static final Map<String, List<DictDataSimpleRespVO>> CACHE = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
|
||||
+2
-4
@@ -11,6 +11,8 @@ import java.util.Locale;
|
||||
* @since 2025/11/11 15:15
|
||||
*/
|
||||
public class LocaleUtils {
|
||||
private LocaleUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前语言,中文就默认null
|
||||
@@ -20,10 +22,6 @@ public class LocaleUtils {
|
||||
public static String getLocale() {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
|
||||
if (locale == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Locale.CHINESE.equals(locale)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+5
-4
@@ -16,7 +16,8 @@ import java.util.*;
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public class OAuth2Utils {
|
||||
|
||||
private OAuth2Utils() {
|
||||
}
|
||||
|
||||
private static final String FIELD_STATE = "state";
|
||||
|
||||
@@ -55,8 +56,8 @@ public class OAuth2Utils {
|
||||
*/
|
||||
public static String buildImplicitRedirectUri(String redirectUri, String accessToken, String state, LocalDateTime expireTime,
|
||||
Collection<String> scopes, Map<String, Object> additionalInformation) {
|
||||
Map<String, Object> vars = new LinkedHashMap<String, Object>();
|
||||
Map<String, String> keys = new HashMap<String, String>();
|
||||
Map<String, Object> vars = new LinkedHashMap<>();
|
||||
Map<String, String> keys = new HashMap<>();
|
||||
vars.put("access_token", accessToken);
|
||||
vars.put("token_type", SecurityFrameworkUtils.AUTHORIZATION_BEARER.toLowerCase());
|
||||
if (state != null) {
|
||||
@@ -83,7 +84,7 @@ public class OAuth2Utils {
|
||||
|
||||
public static String buildUnsuccessfulRedirect(String redirectUri, String responseType, String state,
|
||||
String error, String description) {
|
||||
Map<String, String> query = new LinkedHashMap<String, String>();
|
||||
Map<String, String> query = new LinkedHashMap<>();
|
||||
query.put("error", error);
|
||||
query.put("error_description", description);
|
||||
if (state != null) {
|
||||
|
||||
+2
@@ -11,6 +11,8 @@ import java.util.Objects;
|
||||
* @since 2024/9/10 15:59
|
||||
*/
|
||||
public class OrganUtils {
|
||||
private OrganUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否内置角色
|
||||
|
||||
+2
-18
@@ -15,6 +15,8 @@ import java.util.LinkedList;
|
||||
*/
|
||||
public class AsymmetricAlgorithmUtil {
|
||||
|
||||
private AsymmetricAlgorithmUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥加密(解密就要用到对应的私钥)
|
||||
@@ -80,23 +82,5 @@ public class AsymmetricAlgorithmUtil {
|
||||
return keys;
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
//
|
||||
// LinkedList<String> priKeyAndPubKey = AsymmetricAlgorithmUtil.getPriKeyAndPubKey();
|
||||
// String privateKey = priKeyAndPubKey.get(0);
|
||||
// String publicKey = priKeyAndPubKey.get(1);
|
||||
// String text = "HelloWorld";
|
||||
//
|
||||
// String encryptByPublic = AsymmetricAlgorithmUtil.encryptByPublic(text, publicKey);
|
||||
// System.out.println(encryptByPublic);
|
||||
// String s = AsymmetricAlgorithmUtil.decryptByPrivate(encryptByPublic, privateKey);
|
||||
// System.out.println("公钥加密私钥解密:"+s);
|
||||
//
|
||||
// String encryptByPrivate = AsymmetricAlgorithmUtil.encryptByPrivate(text, privateKey);
|
||||
// System.out.println(encryptByPrivate);
|
||||
// String s1 = AsymmetricAlgorithmUtil.decryptByPublic(encryptByPrivate,publicKey);
|
||||
// System.out.println("私钥加密公钥解密:"+s1);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user