| | |
| | | |
| | | /** |
| | | * 读取代码生成相关配置 |
| | | * |
| | | * |
| | | * @author zhitan |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "gen") |
| | | @PropertySource(value = { "classpath:generator.yml" }) |
| | | public class GenConfig |
| | | { |
| | | /** 作者 */ |
| | | @PropertySource(value = {"classpath:generator.yml"}) |
| | | public class GenConfig { |
| | | /** |
| | | * 作者 |
| | | */ |
| | | public static String author; |
| | | |
| | | /** 生成包路径 */ |
| | | /** |
| | | * 生成包路径 |
| | | */ |
| | | public static String packageName; |
| | | |
| | | /** 自动去除表前缀,默认是false */ |
| | | /** |
| | | * 自动去除表前缀,默认是false |
| | | */ |
| | | public static boolean autoRemovePre; |
| | | |
| | | /** 表前缀(类名不会包含表前缀) */ |
| | | /** |
| | | * 表前缀(类名不会包含表前缀) |
| | | */ |
| | | public static String tablePrefix; |
| | | |
| | | public static String getAuthor() |
| | | { |
| | | public static String getAuthor() { |
| | | return author; |
| | | } |
| | | |
| | | @Value("${author}") |
| | | public void setAuthor(String author) |
| | | { |
| | | public void setAuthor(String author) { |
| | | GenConfig.author = author; |
| | | } |
| | | |
| | | public static String getPackageName() |
| | | { |
| | | public static String getPackageName() { |
| | | return packageName; |
| | | } |
| | | |
| | | @Value("${packageName}") |
| | | public void setPackageName(String packageName) |
| | | { |
| | | public void setPackageName(String packageName) { |
| | | GenConfig.packageName = packageName; |
| | | } |
| | | |
| | | public static boolean getAutoRemovePre() |
| | | { |
| | | public static boolean getAutoRemovePre() { |
| | | return autoRemovePre; |
| | | } |
| | | |
| | | @Value("${autoRemovePre}") |
| | | public void setAutoRemovePre(boolean autoRemovePre) |
| | | { |
| | | public void setAutoRemovePre(boolean autoRemovePre) { |
| | | GenConfig.autoRemovePre = autoRemovePre; |
| | | } |
| | | |
| | | public static String getTablePrefix() |
| | | { |
| | | public static String getTablePrefix() { |
| | | return tablePrefix; |
| | | } |
| | | |
| | | @Value("${tablePrefix}") |
| | | public void setTablePrefix(String tablePrefix) |
| | | { |
| | | public void setTablePrefix(String tablePrefix) { |
| | | GenConfig.tablePrefix = tablePrefix; |
| | | } |
| | | } |