@Component public class CodeBuilder extends Object
| 构造器和说明 |
|---|
CodeBuilder() |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,Map<String,Object>> |
build(String schemeName,
String datasource,
List<String> tables)
主构建方法,基于指定方案、数据源和表列表生成所有相关代码的内容映射。
|
void |
buildFile(String path,
String schemeName,
String datasource,
List<String> tables)
构建多个文件到指定路径下,根据提供的方案、数据源及表列表批量生成代码文件。
|
String |
getFileName(String packageName,
com.alibaba.fastjson.JSONObject templateObject,
CodeVO codeVO)
根据模板类型和代码配置计算输出文件的相对路径。
|
public void buildFile(String path, String schemeName, String datasource, List<String> tables) throws Exception
path - 输出根路径schemeName - 使用的模板方案名称datasource - 数据源标识符tables - 需要处理的表名列表Exception - 当IO操作或模板解析失败时抛出异常public Map<String,Map<String,Object>> build(String schemeName, String datasource, List<String> tables) throws Exception
schemeName - 使用的模板方案名称datasource - 数据源标识符tables - 待处理的表名列表Exception - 当模板读取、脚本执行或渲染失败时抛出异常Copyright © 2026. All rights reserved.