puzhibing
2022-08-22 1421f8e9c308c4741cb396309035009393b5b036
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package com.stylefeng.guns.generator.engine.base;
 
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.stylefeng.guns.generator.engine.config.*;
 
/**
 * 模板生成父类
 *
 * @author fengshuonan
 * @date 2017-05-08 20:17
 */
public class AbstractTemplateEngine {
 
    protected ContextConfig contextConfig;                //全局配置
    protected ControllerConfig controllerConfig;          //控制器的配置
    protected PageConfig pageConfig;                      //页面的控制器
    protected DaoConfig daoConfig;                        //Dao配置
    protected ServiceConfig serviceConfig;                //Service配置
    protected SqlConfig sqlConfig;                        //sql配置
    protected TableInfo tableInfo;                        //表的信息
 
    public void initConfig() {
        if (this.contextConfig == null) {
            this.contextConfig = new ContextConfig();
        }
        if (this.controllerConfig == null) {
            this.controllerConfig = new ControllerConfig();
        }
        if (this.pageConfig == null) {
            this.pageConfig = new PageConfig();
        }
        if (this.daoConfig == null) {
            this.daoConfig = new DaoConfig();
        }
        if (this.serviceConfig == null) {
            this.serviceConfig = new ServiceConfig();
        }
        if (this.sqlConfig == null) {
            this.sqlConfig = new SqlConfig();
        }
        this.contextConfig.init();
 
        this.controllerConfig.setContextConfig(this.contextConfig);
        this.controllerConfig.init();
 
        this.serviceConfig.setContextConfig(this.contextConfig);
        this.serviceConfig.init();
 
        this.daoConfig.setContextConfig(this.contextConfig);
        this.daoConfig.init();
 
        this.pageConfig.setContextConfig(this.contextConfig);
        this.pageConfig.init();
 
        this.sqlConfig.setContextConfig(this.contextConfig);
        this.sqlConfig.init();
    }
 
    public PageConfig getPageConfig() {
        return pageConfig;
    }
 
    public void setPageConfig(PageConfig pageConfig) {
        this.pageConfig = pageConfig;
    }
 
    public ContextConfig getContextConfig() {
        return contextConfig;
    }
 
    public void setContextConfig(ContextConfig contextConfig) {
        this.contextConfig = contextConfig;
    }
 
    public ControllerConfig getControllerConfig() {
        return controllerConfig;
    }
 
    public void setControllerConfig(ControllerConfig controllerConfig) {
        this.controllerConfig = controllerConfig;
    }
 
    public DaoConfig getDaoConfig() {
        return daoConfig;
    }
 
    public void setDaoConfig(DaoConfig daoConfig) {
        this.daoConfig = daoConfig;
    }
 
    public ServiceConfig getServiceConfig() {
        return serviceConfig;
    }
 
    public void setServiceConfig(ServiceConfig serviceConfig) {
        this.serviceConfig = serviceConfig;
    }
 
    public SqlConfig getSqlConfig() {
        return sqlConfig;
    }
 
    public void setSqlConfig(SqlConfig sqlConfig) {
        this.sqlConfig = sqlConfig;
    }
 
    public TableInfo getTableInfo() {
        return tableInfo;
    }
 
    public void setTableInfo(TableInfo tableInfo) {
        this.tableInfo = tableInfo;
    }
}