update - REQ-2516-处理生成接口参数注解丢失问题

This commit is contained in:
yangqicheng 2024-05-29 19:27:58 +08:00
parent 66e2b475c9
commit d4e784901c
2 changed files with 11 additions and 2 deletions

View File

@ -55,7 +55,16 @@ public class GenServiceProcessor extends BaseCodeGenProcessor {
if (add) {
List<ParameterSpec> parameterSpecs = new ArrayList<>();
for (VariableElement variableElement : executableElement.getParameters()) {
parameterSpecs.add(ParameterSpec.get(variableElement));
ParameterSpec parameterSpec = ParameterSpec.get(variableElement);
List<? extends AnnotationMirror> paramAnnotations = variableElement.getAnnotationMirrors();
if (paramAnnotations != null && !paramAnnotations.isEmpty()) {
List<AnnotationSpec> annotationSpecs = new ArrayList<>();
for (AnnotationMirror annotation : paramAnnotations) {
annotationSpecs.add(AnnotationSpec.get(annotation));
}
parameterSpec = parameterSpec.toBuilder().addAnnotations(annotationSpecs).build();
}
parameterSpecs.add(parameterSpec);
}
List<AnnotationSpec> annotationSpecs = new ArrayList<>();
for (AnnotationMirror annotationMirror : annotationMirrors) {

View File

@ -15,7 +15,7 @@ public @interface GenService {
String genSourcePath() default "workflow-engine-spring-boot-starter/src/main/java";
String genClassName() default "WorkflowCoreService";
String genClassName() default "WorkflowCoreService_Gen";
boolean overrideSource() default false;
}