提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.gen.core.generator.guns.html; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.gen.core.generator.base.AbstractCustomGenerator; |
|
4 |
import org.beetl.core.Template; |
|
5 |
|
|
6 |
import java.io.File; |
|
7 |
import java.util.Map; |
|
8 |
|
|
9 |
/** |
|
10 |
* Guns添加页面生成器 |
|
11 |
* |
|
12 |
* @author fengshuonan |
|
13 |
* @date 2018-12-13-2:20 PM |
|
14 |
*/ |
|
15 |
public class GunsPageAddGenerator extends AbstractCustomGenerator { |
|
16 |
|
|
17 |
public GunsPageAddGenerator(Map<String, Object> tableContext) { |
|
18 |
super(tableContext); |
|
19 |
} |
|
20 |
|
|
21 |
@Override |
|
22 |
public void bindingOthers(Template template) { |
|
23 |
super.bindingInputsParams(template); |
|
24 |
} |
|
25 |
|
|
26 |
@Override |
|
27 |
public String getTemplateResourcePath() { |
|
28 |
return "/gunsTemplates/page_add.html.btl"; |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
public String getGenerateFileTempPath() { |
|
33 |
String lowerEntity = (String) this.tableContext.get("lowerEntity"); |
|
34 |
File file = new File(contextParam.getOutputPath() + "/html/" + lowerEntity + "/" + lowerEntity + "_add.html"); |
|
35 |
return file.getAbsolutePath(); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
public String getGenerateFileDirectPath() { |
|
40 |
String lowerEntity = (String) this.tableContext.get("lowerEntity"); |
|
41 |
File file = new File(contextParam.getOutputPath() + "/webapp/pages/" + lowerEntity + "/" + lowerEntity + "_add.html"); |
|
42 |
return file.getAbsolutePath(); |
|
43 |
} |
|
44 |
} |