Skip to content

Commit 247c587

Browse files
committed
refactor(codegen): 优化代码结构和导入
- 更新了导入语句,使用 org.springframework.lang.Nullable 替代 javax.annotation.Nullable - 优化了代码格式,提高了可读性 - 在 SpringApiSdkCodegenProcessor 中添加了必要的导入语句
1 parent d99b6fe commit 247c587

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

annotation-processor/src/main/java/com/wuxp/codegen/meta/annotations/factories/SpringApiSdkCodegenProcessor.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
import com.wuxp.codegen.core.util.CodegenFileUtils;
1010
import com.wuxp.codegen.starter.LoongCodeGenerator;
1111

12-
import javax.annotation.processing.*;
12+
import javax.annotation.processing.AbstractProcessor;
13+
import javax.annotation.processing.Messager;
14+
import javax.annotation.processing.ProcessingEnvironment;
15+
import javax.annotation.processing.RoundEnvironment;
16+
import javax.annotation.processing.SupportedAnnotationTypes;
1317
import javax.lang.model.element.Element;
1418
import javax.lang.model.element.TypeElement;
1519
import javax.tools.Diagnostic;
@@ -60,7 +64,8 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
6064
Class<? extends Annotation> entityAnnotationType = ClassLoaderUtils.loadClass(className);
6165
processAnnotations(roundEnv.getElementsAnnotatedWith(entityAnnotationType), codeGenerators);
6266
} catch (ClassNotFoundException e) {
63-
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, String.format("%s can't found class %s", getClass().getSimpleName(), className));
67+
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, String.format("%s can't found class %s",
68+
getClass().getSimpleName(), className));
6469
}
6570
}
6671
return false;

loong-quick/codegen-server/src/main/java/com/wuxp/codegen/server/task/CodegenTaskService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.wuxp.codegen.server.task;
22

3-
import javax.annotation.Nullable;
3+
4+
import org.springframework.lang.Nullable;
45

56
/**
67
* 代码生成任务服务

loong-quick/codegen-server/src/main/java/com/wuxp/codegen/server/vcs/SourceCodeRepositoryAccessProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import com.wuxp.codegen.server.enums.SourcecodeRepositoryType;
55
import org.springframework.core.Ordered;
6+
import org.springframework.lang.Nullable;
67

7-
import javax.annotation.Nullable;
88

99
/**
1010
* 访问源代码仓库访问属性

0 commit comments

Comments
 (0)