From d5deb72c9a956e13936995389a550573eee8836c Mon Sep 17 00:00:00 2001 From: click33 <2393584716@qq.com> Date: Sat, 22 Feb 2025 18:00:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20sa-token-dubbo=20&=20sa-token-dubbo3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sa-token-plugin/pom.xml | 18 ++++++---- .../satoken/plugin/SaTokenPluginForDubbo.java | 34 +++++++++++++++++++ .../cn.dev33.satoken.plugin.SaTokenPlugin | 1 + .../main/resources/META-INF/spring.factories | 1 - ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../plugin/SaTokenPluginForDubbo3.java | 34 +++++++++++++++++++ .../cn.dev33.satoken.plugin.SaTokenPlugin | 1 + .../main/resources/META-INF/spring.factories | 1 - ...ot.autoconfigure.AutoConfiguration.imports | 1 - 9 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 sa-token-plugin/sa-token-dubbo/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo.java create mode 100644 sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin delete mode 100644 sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring.factories delete mode 100644 sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports create mode 100644 sa-token-plugin/sa-token-dubbo3/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo3.java create mode 100644 sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin delete mode 100644 sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring.factories delete mode 100644 sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/sa-token-plugin/pom.xml b/sa-token-plugin/pom.xml index ab93394f..8b5b5764 100644 --- a/sa-token-plugin/pom.xml +++ b/sa-token-plugin/pom.xml @@ -18,25 +18,29 @@ + sa-token-jackson - sa-token-redis-template - sa-token-redis-template-jdk-serializer - sa-token-redis-jackson sa-token-fastjson sa-token-fastjson2 sa-token-hutool-timed-cache + sa-token-thymeleaf + sa-token-freemarker + + + sa-token-redis-template + sa-token-redis-template-jdk-serializer + sa-token-redis-jackson sa-token-alone-redis + sa-token-spring-aop + sa-token-spring-el + sa-token-redisson-jackson sa-token-redisson-jackson2 sa-token-redisx - sa-token-thymeleaf - sa-token-freemarker sa-token-sso sa-token-oauth2 sa-token-quick-login - sa-token-spring-aop - sa-token-spring-el sa-token-temp-jwt sa-token-jwt sa-token-dubbo diff --git a/sa-token-plugin/sa-token-dubbo/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo.java b/sa-token-plugin/sa-token-dubbo/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo.java new file mode 100644 index 00000000..826c0310 --- /dev/null +++ b/sa-token-plugin/sa-token-dubbo/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo.java @@ -0,0 +1,34 @@ +/* + * Copyright 2020-2099 sa-token.cc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.dev33.satoken.plugin; + +import cn.dev33.satoken.SaManager; +import cn.dev33.satoken.context.dubbo.SaTokenSecondContextForDubbo; + +/** + * SaToken 插件安装:二级上下文 (dubbo 版) + * + * @author click33 + * @since 1.41.0 + */ +public class SaTokenPluginForDubbo implements SaTokenPlugin { + + @Override + public void setup() { + SaManager.setSaTokenSecondContext(new SaTokenSecondContextForDubbo()); + } + +} \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin b/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin new file mode 100644 index 00000000..bb334d83 --- /dev/null +++ b/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin @@ -0,0 +1 @@ +cn.dev33.satoken.plugin.SaTokenPluginForDubbo \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring.factories b/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring.factories deleted file mode 100644 index dfd24ad8..00000000 --- a/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.dev33.satoken.context.dubbo.SaTokenSecondContextCreatorForDubbo \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index 1560a6f6..00000000 --- a/sa-token-plugin/sa-token-dubbo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -cn.dev33.satoken.context.dubbo.SaTokenSecondContextCreatorForDubbo \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo3/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo3.java b/sa-token-plugin/sa-token-dubbo3/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo3.java new file mode 100644 index 00000000..2ea179e8 --- /dev/null +++ b/sa-token-plugin/sa-token-dubbo3/src/main/java/cn/dev33/satoken/plugin/SaTokenPluginForDubbo3.java @@ -0,0 +1,34 @@ +/* + * Copyright 2020-2099 sa-token.cc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.dev33.satoken.plugin; + +import cn.dev33.satoken.SaManager; +import cn.dev33.satoken.context.dubbo3.SaTokenSecondContextForDubbo3; + +/** + * SaToken 插件安装:二级上下文 (dubbo3 版) + * + * @author click33 + * @since 1.41.0 + */ +public class SaTokenPluginForDubbo3 implements SaTokenPlugin { + + @Override + public void setup() { + SaManager.setSaTokenSecondContext(new SaTokenSecondContextForDubbo3()); + } + +} \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin b/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin new file mode 100644 index 00000000..65def9b6 --- /dev/null +++ b/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/services/cn.dev33.satoken.plugin.SaTokenPlugin @@ -0,0 +1 @@ +cn.dev33.satoken.plugin.SaTokenPluginForDubbo3 \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring.factories b/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 844bf4bd..00000000 --- a/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.dev33.satoken.context.dubbo3.SaTokenSecondContextCreatorForDubbo3 \ No newline at end of file diff --git a/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index cff10092..00000000 --- a/sa-token-plugin/sa-token-dubbo3/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -cn.dev33.satoken.context.dubbo3.SaTokenSecondContextCreatorForDubbo3 \ No newline at end of file