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
16
17
18
19
@PropertySource(value = {"classpath:generator.yml"})
public class GenConfig {
    /**
     * 作者
     */
tangying authored
20
    public static String author;
mahuandong authored
21
22
23
24

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

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

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