@Service public class GeneratorUtilServiceImpl extends Object implements GeneratorUtilService
| 构造器和说明 |
|---|
GeneratorUtilServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
columnToJava(String type)
column2java type
|
String |
download(List<GeneratorColumn> generatorColumns,
GeneratorTable generatorTable)
下载代码
|
void |
generatorCode(List<GeneratorColumn> generatorColumnInfos,
GeneratorTable generatorTable)
生成代码
|
protected void |
genFile(File file,
cn.hutool.extra.template.Template template,
Map<String,Object> map) |
protected String |
getAdminFilePath(String templateName,
GeneratorTable generatorTable,
String className,
String rootPath)
定义后端文件路径以及名称
|
protected List<String> |
getAdminTemplateNames(GeneratorTable cfg)
获取后端代码模板名称
|
protected cn.hutool.extra.template.TemplateEngine |
getEngine() |
protected String |
getFrontFilePath(String rootPath,
String templateName,
String apiPath,
String path,
String apiName)
定义前端文件路径以及名称
|
protected List<String> |
getFrontTemplateNames(GeneratorTable cfg)
获取前端代码模板名称
|
protected Map<String,Object> |
getGenMap(List<GeneratorColumn> generatorColumnInfos,
GeneratorTable generatorTable) |
protected String |
getServerRouteName()
获取所在的服务,路由前缀,对应contextpath或者gateway中predicates.Path前缀
|
protected String |
getTemplateRoot(GeneratorTable config) |
protected String |
getUiTemplateRoot(GeneratorTable config) |
List<Map<String,Object>> |
preview(List<GeneratorColumn> generatorColumns,
GeneratorTable generatorTable)
预览代码
|
public static final String SYS_TEM_DIR
protected String getServerRouteName()
public List<Map<String,Object>> preview(List<GeneratorColumn> generatorColumns, GeneratorTable generatorTable)
GeneratorUtilServicepreview 在接口中 GeneratorUtilServicepublic void generatorCode(List<GeneratorColumn> generatorColumnInfos, GeneratorTable generatorTable) throws IOException
GeneratorUtilServicegeneratorCode 在接口中 GeneratorUtilServiceIOExceptionpublic String columnToJava(String type)
GeneratorUtilServicecolumnToJava 在接口中 GeneratorUtilServicepublic String download(List<GeneratorColumn> generatorColumns, GeneratorTable generatorTable) throws IOException
GeneratorUtilServicedownload 在接口中 GeneratorUtilServiceIOExceptionprotected List<String> getAdminTemplateNames(GeneratorTable cfg)
protected List<String> getFrontTemplateNames(GeneratorTable cfg)
protected cn.hutool.extra.template.TemplateEngine getEngine()
protected String getTemplateRoot(GeneratorTable config)
protected String getUiTemplateRoot(GeneratorTable config)
protected Map<String,Object> getGenMap(List<GeneratorColumn> generatorColumnInfos, GeneratorTable generatorTable)
protected String getAdminFilePath(String templateName, GeneratorTable generatorTable, String className, String rootPath)
protected String getFrontFilePath(String rootPath, String templateName, String apiPath, String path, String apiName)
protected void genFile(File file, cn.hutool.extra.template.Template template, Map<String,Object> map) throws IOException
IOExceptionCopyright © 2022 Anji-Plus. All rights reserved.