Blame view

src/main/java/com/huaheng/framework/config/GenConfig.java 1.62 KB
tangying authored
1
2
package com.huaheng.framework.config;
mahuandong authored
3
import org.springframework.beans.factory.annotation.Value;
tangying authored
4
import org.springframework.boot.context.properties.ConfigurationProperties;
mahuandong authored
5
import org.springframework.context.annotation.PropertySource;
tangying authored
6
7
8
9
import org.springframework.stereotype.Component;

/**
 * 读取代码生成相关配置
mahuandong authored
10
11
 *
 * @author ruoyi
tangying authored
12
13
14
 */
@Component
@ConfigurationProperties(prefix = "gen")
mahuandong authored
15
@PropertySource(value = {"classpath:generator.yml"})
16
17
public class
GenConfig {
mahuandong authored
18
19
20
    /**
     * 作者
     */
tangying authored
21
    public static String author;
mahuandong authored
22
23
24
25

    /**
     * 生成包路径
     */
tangying authored
26
    public static String packageName;
mahuandong authored
27
28
29
30
31
32
33
34
35

    /**
     * 自动去除表前缀,默认是false
     */
    public static boolean autoRemovePre;

    /**
     * 表前缀(类名不会包含表前缀)
     */
tangying authored
36
37
    public static String tablePrefix;
mahuandong authored
38
    public static String getAuthor() {
tangying authored
39
40
41
        return author;
    }
mahuandong authored
42
43
    @Value("${author}")
    public void setAuthor(String author) {
tangying authored
44
45
46
        GenConfig.author = author;
    }
mahuandong authored
47
    public static String getPackageName() {
tangying authored
48
49
50
        return packageName;
    }
mahuandong authored
51
52
    @Value("${packageName}")
    public void setPackageName(String packageName) {
tangying authored
53
54
55
        GenConfig.packageName = packageName;
    }
mahuandong authored
56
    public static boolean getAutoRemovePre() {
tangying authored
57
58
59
        return autoRemovePre;
    }
mahuandong authored
60
61
    @Value("${autoRemovePre}")
    public void setAutoRemovePre(boolean autoRemovePre) {
tangying authored
62
63
64
        GenConfig.autoRemovePre = autoRemovePre;
    }
mahuandong authored
65
    public static String getTablePrefix() {
tangying authored
66
67
68
        return tablePrefix;
    }
mahuandong authored
69
70
    @Value("${tablePrefix}")
    public void setTablePrefix(String tablePrefix) {
tangying authored
71
72
73
        GenConfig.tablePrefix = tablePrefix;
    }
}