style: 代码格式更新。

This commit is contained in:
Suomm 2023-05-18 12:33:11 +08:00
parent 51acb6df3f
commit 6729860e03
3 changed files with 47 additions and 40 deletions

View File

@ -234,7 +234,14 @@ public class GlobalConfig {
return packageInfoGenerateEnable;
}
public void addCustomConfig(String key, Object value) {
public Object getCustomConfig(String key) {
if (customConfig != null) {
return customConfig.get(key);
}
return null;
}
public void setCustomConfig(String key, Object value) {
if (customConfig == null) {
customConfig = new HashMap<>();
}

View File

@ -70,7 +70,7 @@ public class StrategyConfig {
*/
private Set<String> unGenerateTables;
public void addTableConfig(TableConfig tableConfig) {
public void setTableConfig(TableConfig tableConfig) {
if (tableConfigMap == null) {
tableConfigMap = new HashMap<>();
}
@ -81,19 +81,19 @@ public class StrategyConfig {
return tableConfigMap == null ? null : tableConfigMap.get(tableName);
}
public void addColumnConfig(ColumnConfig columnConfig) {
public void setColumnConfig(ColumnConfig columnConfig) {
if (columnConfigMap == null) {
columnConfigMap = new HashMap<>();
}
columnConfigMap.put(columnConfig.getColumnName(), columnConfig);
}
public void addColumnConfig(String tableName, ColumnConfig columnConfig) {
public void setColumnConfig(String tableName, ColumnConfig columnConfig) {
TableConfig tableConfig = getTableConfig(tableName);
if (tableConfig == null) {
tableConfig = new TableConfig();
tableConfig.setTableName(tableName);
addTableConfig(tableConfig);
setTableConfig(tableConfig);
}
tableConfig.addColumnConfig(columnConfig);
@ -129,7 +129,7 @@ public class StrategyConfig {
return columnConfig;
}
public void addGenerateTable(String... tables) {
public void setGenerateTable(String... tables) {
if (generateTables == null) {
generateTables = new HashSet<>();
}
@ -141,7 +141,7 @@ public class StrategyConfig {
}
}
public void addUnGenerateTable(String... tables) {
public void setUnGenerateTable(String... tables) {
if (unGenerateTables == null) {
unGenerateTables = new HashSet<>();
}

View File

@ -1,17 +1,17 @@
/**
* Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
/*
* Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mybatisflex.codegen.generator;
@ -26,26 +26,26 @@ import com.mybatisflex.codegen.entity.Table;
*/
public interface IGenerator {
/**
* 获取模板文件位置
*
* @return 路径
*/
String getTemplatePath();
/**
* 获取模板文件位置
*
* @return 路径
*/
String getTemplatePath();
/**
* 设置模板文件位置
*
* @param templatePath
*/
void setTemplatePath(String templatePath);
/**
* 设置模板文件位置
*
* @param templatePath
*/
void setTemplatePath(String templatePath);
/**
* 根据模板生成文件
*
* @param table 表内容
* @param globalConfig 全局配置
*/
void generate(Table table, GlobalConfig globalConfig);
/**
* 根据模板生成文件
*
* @param table 表内容
* @param globalConfig 全局配置
*/
void generate(Table table, GlobalConfig globalConfig);
}