Skip to content

Commit af00c1a

Browse files
committed
refactor(codegen): 替换JSON转换器实现- 移除对JacksonObjectConverter的依赖
- 使用JsonUtils替代JsonObjectConverter进行JSON解析 - 简化代码生成服务中的JSON处理逻辑 - 减少不必要的类导入和实例化 - 提高代码可维护性和一致性
1 parent 9a7efad commit af00c1a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/tech/wetech/flexmodel/codegen/CodeGenerationService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import groovy.lang.GroovyClassLoader;
44
import org.slf4j.Logger;
55
import org.slf4j.LoggerFactory;
6-
import tech.wetech.flexmodel.JsonObjectConverter;
6+
import tech.wetech.flexmodel.JsonUtils;
77
import tech.wetech.flexmodel.model.EntityDefinition;
88
import tech.wetech.flexmodel.model.EnumDefinition;
99
import tech.wetech.flexmodel.session.SessionFactory;
10-
import tech.wetech.flexmodel.supports.jackson.JacksonObjectConverter;
1110

1211
import java.io.File;
1312
import java.io.IOException;
@@ -35,7 +34,6 @@ public class CodeGenerationService {
3534
private final GroovyClassLoader loader = new GroovyClassLoader();
3635

3736
private final SessionFactory sessionFactory;
38-
private final JsonObjectConverter jsonConverter = new JacksonObjectConverter();
3937

4038
private final Map<String, TemplateInfo> templateInfoMap = new HashMap<>();
4139

@@ -300,7 +298,7 @@ private Map<String, Object> loadTemplate(String templateName) throws Exception {
300298
}
301299

302300
String jsonContent = Files.readString(variablesPath);
303-
Map<String, Object> variables = jsonConverter.parseToMap(jsonContent);
301+
Map<String, Object> variables = JsonUtils.parseToMap(jsonContent);
304302
// Cache the result
305303
templateInfoMap.put(templateName, new TemplateInfo(templateName, variables));
306304

0 commit comments

Comments
 (0)