duhuizhe
2024-04-19 64c4fd3c7067c7626dc960a70b4bc2c3662bc653
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
package com.yqzx.generator.engine.config;
 
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
 
import java.util.Date;
 
/**
 * @description: 全局配置
 * @author: chaoyapeng
 * @time: 2020/8/18 16:06
 */
@Data
public class ContextConfig {
 
    private String templatePrefixPath = "template";
 
    /**
     * 模板输出的项目目录
     */
    private String projectPath = "d:\\";
 
    /**
     * 包名
     */
    private String packageName;
 
    /**
     * 作者
     */
    private String author = "system";
 
    /**
     * 表名
     */
    private String tableName;
 
    /**
     * 时间
     */
    private String dateTime;
 
    /**
     * 中文业务名
     */
    private String bizChName;
 
    /**
     * Mapping名称
     */
    private String bizMappingName;
 
    /**
     * 小写
     */
    private String bizEnName;
 
    /**
     * 大写
     */
    private String bizEnBigName;
 
    /**
     * 是否生成控制器代码开关
     */
    private Boolean controllerSwitch = false;
 
    /**
     * service
     */
    private Boolean serviceSwitch = false;
 
    /**
     * mapper的开关
     */
    private Boolean mapperSwitch = false;
 
    /**
     * 实体类的开关
     */
    private Boolean modelSwitch = false;
 
    /**
     * 查询实体类的开关
     */
    private Boolean querySwitch = false;
 
    public void init() {
        dateTime = DateUtil.formatDateTime(new Date());
        bizMappingName = tableName.replace("_", "/");
        bizEnName = StrUtil.toCamelCase(tableName);
        bizEnBigName = StrUtil.upperFirst(bizEnName);
    }
 
}