java110
2020-03-29 96ad9499385c9b57f9758d6447fa873c76af039c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.java110.code.web;
 
 
import com.alibaba.fastjson.JSONObject;
import com.java110.code.back.BaseGenerator;
 
public class GeneratorFlow extends BaseGenerator {
 
    public void generator(JSONObject data) {
 
        //处理组件
        generatorComponentHtml(data);
 
 
 
 
    }
 
    /**
     * 生成 html js java 类
     *
     * @param data
     */
    private void generatorComponentHtml(JSONObject data) {
 
        StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/flow.html").getFile());
        String fileContext = sb.toString();
 
        fileContext = super.replaceTemplateContext(fileContext, data);
 
 
        String writePath = this.getClass().getResource("/").getPath()
                + "out/web/" + data.getString("templateCode") + "/" + data.getString("templateCode") + "Flow.html";
        System.out.printf("writePath: " + writePath);
        writeFile(writePath,
                fileContext);
 
 
    }
 
 
 
 
}