makeHtml改名为makeFile
This commit is contained in:
parent
2490c388d9
commit
c014c9e90f
|
|
@ -26,31 +26,31 @@ import com.smallchill.core.toolbox.kit.FileKit;
|
|||
/**
|
||||
* Beetl静态化生成工具类
|
||||
*/
|
||||
public abstract class BeetlMaker {
|
||||
public class BeetlMaker {
|
||||
|
||||
/**
|
||||
* 生成静态html
|
||||
* 生成文件
|
||||
*
|
||||
* @param ftlPath 模板路径
|
||||
* @param tlPath 模板路径
|
||||
* @param paras 参数
|
||||
* @param htmlPath html文件保存路径
|
||||
* @param filePath 文件保存路径
|
||||
*/
|
||||
public static void makeHtml(String tlPath, Map<String, Object> paras, String htmlPath) {
|
||||
makeHtml(tlPath, paras, htmlPath, CharsetKit.UTF_8);
|
||||
public static void makeFile(String tlPath, Map<String, Object> paras, String filePath) {
|
||||
makeFile(tlPath, paras, filePath, CharsetKit.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成静态html
|
||||
* 生成文件
|
||||
*
|
||||
* @param ftlPath 模板路径
|
||||
* @param tlPath 模板路径
|
||||
* @param paras 参数
|
||||
* @param htmlPath html文件保存路径
|
||||
* @param filePath 文件保存路径
|
||||
* @param charsetName 编码
|
||||
*/
|
||||
public static void makeHtml(String tlPath, Map<String, Object> paras, String htmlPath, String charsetName) {
|
||||
public static void makeFile(String tlPath, Map<String, Object> paras, String filePath, String charsetName) {
|
||||
PrintWriter pw = null;
|
||||
try {
|
||||
pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(htmlPath), charsetName));
|
||||
pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(filePath), charsetName));
|
||||
BeetlTemplate.buildTo(FileKit.readString(tlPath, charsetName), paras, pw);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -180,20 +180,20 @@ public class GenerateController extends CurdController<Generate> {
|
|||
ps.set("pkName", pkName);
|
||||
|
||||
//java
|
||||
BeetlMaker.makeHtml(controllerTemplatePath, ps, controllerPath);
|
||||
BeetlMaker.makeHtml(serviceTemplatePath, ps, servicePath);
|
||||
BeetlMaker.makeHtml(serviceimplTemplatePath, ps, serviceimplPath);
|
||||
BeetlMaker.makeFile(controllerTemplatePath, ps, controllerPath);
|
||||
BeetlMaker.makeFile(serviceTemplatePath, ps, servicePath);
|
||||
BeetlMaker.makeFile(serviceimplTemplatePath, ps, serviceimplPath);
|
||||
setParasAttr(tableName, ps);
|
||||
BeetlMaker.makeHtml(modelTemplatePath, ps, modelPath);
|
||||
BeetlMaker.makeFile(modelTemplatePath, ps, modelPath);
|
||||
|
||||
//resources
|
||||
BeetlMaker.makeHtml(sqlTemplatePath, ps, sqlPath);
|
||||
BeetlMaker.makeFile(sqlTemplatePath, ps, sqlPath);
|
||||
|
||||
//webapp
|
||||
BeetlMaker.makeHtml(indexTemplatePath, ps, indexPath);
|
||||
BeetlMaker.makeHtml(addTemplatePath, ps, addPath);
|
||||
BeetlMaker.makeHtml(editTemplatePath, ps, editPath);
|
||||
BeetlMaker.makeHtml(viewTemplatePath, ps, viewPath);
|
||||
BeetlMaker.makeFile(indexTemplatePath, ps, indexPath);
|
||||
BeetlMaker.makeFile(addTemplatePath, ps, addPath);
|
||||
BeetlMaker.makeFile(editTemplatePath, ps, editPath);
|
||||
BeetlMaker.makeFile(viewTemplatePath, ps, viewPath);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user