-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parsing custom REST paths from proto files and generating @Ma… #14796
Conversation
dubbo-plugin/dubbo-compiler/pom.xml
Outdated
@@ -59,6 +59,11 @@ | |||
<groupId>com.salesforce.servicelibs</groupId> | |||
<artifactId>grpc-contrib</artifactId> | |||
</dependency> | |||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this module just to generate code?
} | ||
|
||
if (!httpRule.getGet().isEmpty()) { | ||
methodContext.path = httpRule.getGet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be mege with line 199?
@@ -16,10 +16,14 @@ | |||
*/ | |||
|
|||
{{#packageName}} | |||
package {{packageName}}; | |||
package {{packageName}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary indent?
|
||
{{#hasMappings}} | ||
@Mapping(method = HttpMethods.{{httpMethod}}, path = "{{path}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to make sure that the indents of the generated code is correct.
@Target(ElementType.PARAMETER) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface Grequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GRequest
import java.util.Map; | ||
|
||
@Activate | ||
public class GrpcBodyArgumentResolver implements AnnotationBaseArgumentResolver<Grequest> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to GRequestArgumentResolver
@@ -360,6 +428,11 @@ private static class MethodContext { | |||
public String grpcCallsMethodName; | |||
public int methodNumber; | |||
public String javaDoc; | |||
public HttpMethods httpMethod; | |||
public String path; | |||
public String body; // requestBody |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the comments readable
e.g.: Specify the message field that the HTTP request body mapping to
What is the purpose of the change?
Support parsing custom REST paths from proto files and generating
@Mapping
annotations. #13369Checklist