From eafecc3ac0227960f2b8fa377be27f066e10e50f Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期二, 20 五月 2025 10:47:58 +0800 Subject: [PATCH] perf(lb-qms): 优化查询功能和时间范围筛选 --- ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/SocialUtils.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/SocialUtils.java b/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/SocialUtils.java index db696e5..5a6b370 100644 --- a/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/SocialUtils.java +++ b/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/SocialUtils.java @@ -10,6 +10,7 @@ import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.social.config.properties.SocialLoginConfigProperties; import org.dromara.common.social.config.properties.SocialProperties; +import org.dromara.common.social.keycloak.AuthKeycloakRequest; import org.dromara.common.social.maxkey.AuthMaxKeyRequest; import org.dromara.common.social.topiam.AuthTopIamRequest; @@ -66,8 +67,23 @@ case "aliyun" -> new AuthAliyunRequest(builder.build(), STATE_CACHE); case "maxkey" -> new AuthMaxKeyRequest(builder.build(), STATE_CACHE); case "topiam" -> new AuthTopIamRequest(builder.build(), STATE_CACHE); + case "keycloak" -> new AuthKeycloakRequest(builder.build(), STATE_CACHE); default -> throw new AuthException("鏈幏鍙栧埌鏈夋晥鐨凙uth閰嶇疆"); }; } + + + public static AuthKeycloakRequest getAuthKeyloakRequest(String source, SocialProperties socialProperties) { + SocialLoginConfigProperties obj = socialProperties.getType().get(source); + if (ObjectUtil.isNull(obj)) { + throw new AuthException("涓嶆敮鎸佺殑绗笁鏂圭櫥褰曠被鍨�"); + } + AuthConfig.AuthConfigBuilder builder = AuthConfig.builder() + .clientId(obj.getClientId()) + .clientSecret(obj.getClientSecret()) + .redirectUri(obj.getRedirectUri()) + .scopes(obj.getScopes()); + return new AuthKeycloakRequest(builder.build(), STATE_CACHE); + } } -- Gitblit v1.9.3