Quellcode durchsuchen

代码格式化.

nieqiurong vor 1 Jahr
Ursprung
Commit
3b8cf849b2

+ 3 - 1
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/BlockAttackInnerInterceptor.java

@@ -54,7 +54,9 @@ public class BlockAttackInnerInterceptor extends JsqlParserSupport implements In
         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);
         }

+ 3 - 1
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/IllegalSQLInnerInterceptor.java

@@ -99,7 +99,9 @@ public class IllegalSQLInnerInterceptor extends JsqlParserSupport implements Inn
         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);

+ 3 - 1
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/AutoGenerator.java

@@ -60,7 +60,9 @@ public class AutoGenerator {
     private PackageConfig packageInfo;
     /**
      * 模板 相关配置
+     * @deprecated 3.5.6 {@link #strategy}
      */
+    @Deprecated
     private TemplateConfig template;
     /**
      * 全局 相关配置
@@ -123,7 +125,7 @@ public class AutoGenerator {
      *
      * @param templateConfig 模板配置
      * @return this
-     * @see #strategy
+     * @deprecated 3.5.6 {@link #strategy(StrategyConfig)}
      * @since 3.5.0
      */
     @Deprecated

+ 10 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/FastAutoGenerator.java

@@ -60,7 +60,9 @@ public final class FastAutoGenerator {
 
     /**
      * 模板配置 Builder
+     * @deprecated 3.5.6 {@link #strategyConfigBuilder}
      */
+    @Deprecated
     private final TemplateConfig.Builder templateConfigBuilder;
 
     /**
@@ -191,12 +193,20 @@ public final class FastAutoGenerator {
      *
      * @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;

+ 2 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/TemplateConfig.java

@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author tzg hubin
  * @since 2017-06-17
+ * @deprecated 3.5.6 {@link StrategyConfig}
  */
 @Deprecated
 public class TemplateConfig {
@@ -175,6 +176,7 @@ public class TemplateConfig {
      * 模板路径配置构建者
      *
      * @author nieqiurong 3.5.0
+     * @deprecated 3.5.6 {@link StrategyConfig}
      */
     @Deprecated
     public static class Builder implements IConfigBuilder<TemplateConfig> {

+ 8 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/builder/ConfigBuilder.java

@@ -35,6 +35,8 @@ public class ConfigBuilder {
 
     /**
      * 模板路径配置信息
+     *
+     * @deprecated 3.5.6
      */
     @Deprecated
     private final TemplateConfig templateConfig;
@@ -142,6 +144,12 @@ public class ConfigBuilder {
         return this;
     }
 
+    /**
+     * 获取模板配置
+     *
+     * @return 模板配置
+     * @deprecated 3.5.6 {@link #strategyConfig}
+     */
     @NotNull
     @Deprecated
     public TemplateConfig getTemplateConfig() {

+ 0 - 6
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/builder/CustomFile.java

@@ -60,12 +60,6 @@ public class CustomFile {
      */
     private boolean fileOverride;
 
-    /**
-     * 是否生成
-     */
-    @Getter
-    private boolean generate;
-
     /**
      * 构建者
      */

+ 4 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/builder/GeneratorBuilder.java

@@ -83,7 +83,9 @@ public class GeneratorBuilder {
      * 模板路径配置项
      *
      * @return TemplateConfig
+     * @deprecated 3.5.6 {@link #strategyConfig()}
      */
+    @Deprecated
     public static TemplateConfig templateConfig() {
         return new TemplateConfig.Builder().build();
     }
@@ -92,7 +94,9 @@ public class GeneratorBuilder {
      * 模板路径配置项 Builder
      *
      * @return TemplateConfig.Builder
+     * @deprecated 3.5.6 {@link #strategyConfigBuilder()}
      */
+    @Deprecated
     public static TemplateConfig.Builder templateConfigBuilder() {
         return new TemplateConfig.Builder();
     }

+ 3 - 1
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/converts/TypeConverts.java

@@ -92,7 +92,9 @@ public class TypeConverts {
     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;
         });

+ 0 - 1
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/po/TableField.java

@@ -267,7 +267,6 @@ public class TableField {
     }
 
     public TableField setComment(String comment) {
-        //TODO 暂时挪动到这
         this.comment = this.globalConfig.isSwagger()
             && StringUtils.isNotBlank(comment) ? comment.replace("\"", "\\\"") : comment;
         return this;

+ 0 - 2
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/po/TableInfo.java

@@ -171,7 +171,6 @@ public class TableInfo {
      */
     public TableInfo setEntityName(@NotNull String entityName) {
         this.entityName = entityName;
-        //TODO 先放置在这里
         setConvert();
         return this;
     }
@@ -211,7 +210,6 @@ public class TableInfo {
      * 转换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(", "));
         }

+ 1 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/engine/AbstractTemplateEngine.java

@@ -206,6 +206,7 @@ public abstract class AbstractTemplateEngine {
      * @param function function
      * @return 模板路径
      * @since 3.5.0
+     * @deprecated 3.5.6
      */
     @NotNull
     @Deprecated