From 650ee3b9d4904e8c696744dff5079efd528ed6c0 Mon Sep 17 00:00:00 2001 From: XiaoyuPeng <30964063+xiaoyuuuuuupeng@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:57:02 +0800 Subject: [PATCH] fix:when proto miss package config bug (#13373) Co-authored-by: pengxiaoyu Co-authored-by: earthchen --- .../src/main/resources/Dubbo3InterfaceStub.mustache | 5 +++++ .../src/main/resources/Dubbo3TripleInterfaceStub.mustache | 6 +++++- .../resources/ReactorDubbo3TripleInterfaceStub.mustache | 7 +++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache b/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache index ebbaad9f7d7c..2764d63e831a 100644 --- a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache +++ b/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache @@ -28,7 +28,12 @@ import java.util.concurrent.atomic.AtomicBoolean; public interface {{interfaceClassName}} extends org.apache.dubbo.rpc.model.DubboStub { static final String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}"; +{{#commonPackageName}} static final String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}"; +{{/commonPackageName}} +{{^commonPackageName}} + static final String SERVICE_NAME = "{{serviceName}}"; +{{/commonPackageName}} // FIXME, initialize Dubbo3 stub when interface loaded, thinking of new ways doing this. static final boolean inited = {{className}}.init(); diff --git a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache b/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache index 72b68c3d677a..d4ca6653f9d7 100644 --- a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache +++ b/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache @@ -30,8 +30,12 @@ import java.util.concurrent.CompletableFuture; public interface {{interfaceClassName}} extends org.apache.dubbo.rpc.model.DubboStub { String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}"; +{{#commonPackageName}} String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}"; - +{{/commonPackageName}} +{{^commonPackageName}} + String SERVICE_NAME = "{{serviceName}}"; +{{/commonPackageName}} {{#unaryMethods}} {{#javaDoc}} {{{javaDoc}}} diff --git a/dubbo-plugin/dubbo-compiler/src/main/resources/ReactorDubbo3TripleInterfaceStub.mustache b/dubbo-plugin/dubbo-compiler/src/main/resources/ReactorDubbo3TripleInterfaceStub.mustache index 43e427f9f333..59114929e5c2 100644 --- a/dubbo-plugin/dubbo-compiler/src/main/resources/ReactorDubbo3TripleInterfaceStub.mustache +++ b/dubbo-plugin/dubbo-compiler/src/main/resources/ReactorDubbo3TripleInterfaceStub.mustache @@ -25,9 +25,12 @@ import reactor.core.publisher.Mono; public interface {{interfaceClassName}} extends org.apache.dubbo.rpc.model.DubboStub { String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}"; - +{{#commonPackageName}} String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}"; - +{{/commonPackageName}} +{{^commonPackageName}} + String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}"; +{{/commonPackageName}} {{#methods}} {{#javaDoc}} {{{javaDoc}}}