Skip to content

Commit

Permalink
代码格式化.
Browse files Browse the repository at this point in the history
  • Loading branch information
nieqiurong committed Mar 28, 2024
1 parent dc6c1c3 commit 3b8cf84
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public void beforePrepare(StatementHandler sh, Connection connection, Integer tr
MappedStatement ms = handler.mappedStatement();
SqlCommandType sct = ms.getSqlCommandType();
if (sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) {
if (InterceptorIgnoreHelper.willIgnoreBlockAttack(ms.getId())) return;
if (InterceptorIgnoreHelper.willIgnoreBlockAttack(ms.getId())) {
return;
}
BoundSql boundSql = handler.boundSql();
parserMulti(boundSql.getSql(), null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ public void beforePrepare(StatementHandler sh, Connection connection, Integer tr
PluginUtils.MPStatementHandler mpStatementHandler = PluginUtils.mpStatementHandler(sh);
MappedStatement ms = mpStatementHandler.mappedStatement();
SqlCommandType sct = ms.getSqlCommandType();
if (sct == SqlCommandType.INSERT || InterceptorIgnoreHelper.willIgnoreIllegalSql(ms.getId())) return;
if (sct == SqlCommandType.INSERT || InterceptorIgnoreHelper.willIgnoreIllegalSql(ms.getId())) {
return;
}
BoundSql boundSql = mpStatementHandler.boundSql();
String originalSql = boundSql.getSql();
logger.debug("检查SQL是否合规,SQL:" + originalSql);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public class AutoGenerator {
private PackageConfig packageInfo;
/**
* 模板 相关配置
* @deprecated 3.5.6 {@link #strategy}
*/
@Deprecated
private TemplateConfig template;
/**
* 全局 相关配置
Expand Down Expand Up @@ -123,7 +125,7 @@ public AutoGenerator packageInfo(@NotNull PackageConfig packageConfig) {
*
* @param templateConfig 模板配置
* @return this
* @see #strategy
* @deprecated 3.5.6 {@link #strategy(StrategyConfig)}
* @since 3.5.0
*/
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public final class FastAutoGenerator {

/**
* 模板配置 Builder
* @deprecated 3.5.6 {@link #strategyConfigBuilder}
*/
@Deprecated
private final TemplateConfig.Builder templateConfigBuilder;

/**
Expand Down Expand Up @@ -191,12 +193,20 @@ public FastAutoGenerator injectionConfig(BiConsumer<Function<String, String>, In
*
* @param consumer 自定义模板配置
* @return FastAutoGenerator
* @deprecated 3.5.6 {@link #strategyConfig(Consumer)}
*/
@Deprecated
public FastAutoGenerator templateConfig(Consumer<TemplateConfig.Builder> consumer) {
consumer.accept(this.templateConfigBuilder);
return this;
}

/**
* @param biConsumer
* @return FastAutoGenerator
* @deprecated 3.5.6 {@link #strategyConfig(BiConsumer)}
*/
@Deprecated
public FastAutoGenerator templateConfig(BiConsumer<Function<String, String>, TemplateConfig.Builder> biConsumer) {
biConsumer.accept(this::scannerNext, this.templateConfigBuilder);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*
* @author tzg hubin
* @since 2017-06-17
* @deprecated 3.5.6 {@link StrategyConfig}
*/
@Deprecated
public class TemplateConfig {
Expand Down Expand Up @@ -175,6 +176,7 @@ public TemplateConfig disable() {
* 模板路径配置构建者
*
* @author nieqiurong 3.5.0
* @deprecated 3.5.6 {@link StrategyConfig}
*/
@Deprecated
public static class Builder implements IConfigBuilder<TemplateConfig> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class ConfigBuilder {

/**
* 模板路径配置信息
*
* @deprecated 3.5.6
*/
@Deprecated
private final TemplateConfig templateConfig;
Expand Down Expand Up @@ -142,6 +144,12 @@ public ConfigBuilder setInjectionConfig(@NotNull InjectionConfig injectionConfig
return this;
}

/**
* 获取模板配置
*
* @return 模板配置
* @deprecated 3.5.6 {@link #strategyConfig}
*/
@NotNull
@Deprecated
public TemplateConfig getTemplateConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ public class CustomFile {
*/
private boolean fileOverride;

/**
* 是否生成
*/
@Getter
private boolean generate;

/**
* 构建者
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public static StrategyConfig.Builder strategyConfigBuilder() {
* 模板路径配置项
*
* @return TemplateConfig
* @deprecated 3.5.6 {@link #strategyConfig()}
*/
@Deprecated
public static TemplateConfig templateConfig() {
return new TemplateConfig.Builder().build();
}
Expand All @@ -92,7 +94,9 @@ public static TemplateConfig templateConfig() {
* 模板路径配置项 Builder
*
* @return TemplateConfig.Builder
* @deprecated 3.5.6 {@link #strategyConfigBuilder()}
*/
@Deprecated
public static TemplateConfig.Builder templateConfigBuilder() {
return new TemplateConfig.Builder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ static BranchBuilder<String, IColumnType> contains(CharSequence value) {
static BranchBuilder<String, IColumnType> containsAny(CharSequence... values) {
return BranchBuilder.of(s -> {
for (CharSequence value : values) {
if (s.contains(value)) return true;
if (s.contains(value)) {
return true;
}
}
return false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ public TableField setType(String type) {
}

public TableField setComment(String comment) {
//TODO 暂时挪动到这
this.comment = this.globalConfig.isSwagger()
&& StringUtils.isNotBlank(comment) ? comment.replace("\"", "\\\"") : comment;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ public String getEntityPath() {
*/
public TableInfo setEntityName(@NotNull String entityName) {
this.entityName = entityName;
//TODO 先放置在这里
setConvert();
return this;
}
Expand Down Expand Up @@ -211,7 +210,6 @@ public TableInfo addImportPackages(@NotNull List<String> pkgList) {
* 转换filed实体为 xml mapper 中的 base column 字符串信息
*/
public String getFieldNames() {
//TODO 感觉这个也啥必要,不打算公开set方法了
if (StringUtils.isBlank(fieldNames)) {
this.fieldNames = this.fields.stream().map(TableField::getColumnName).collect(Collectors.joining(", "));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ protected void outputFile(@NotNull File file, @NotNull Map<String, Object> objec
* @param function function
* @return 模板路径
* @since 3.5.0
* @deprecated 3.5.6
*/
@NotNull
@Deprecated
Expand Down

0 comments on commit 3b8cf84

Please sign in to comment.