ソースを参照

style: annotation包引入lombok并格式

小锅盖 7 年 前
コミット
24321eb80d

+ 1 - 0
mybatis-plus-annotation/build.gradle

@@ -4,5 +4,6 @@ sourceCompatibility = 1.8
 
 dependencies {
     testCompile 'junit:junit:4.12'
+    compileOnly rootProject.ext.dependencies["lombok"]
 
 }

+ 3 - 8
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/FieldFill.java

@@ -15,6 +15,8 @@
  */
 package com.baomidou.mybatisplus.annotation;
 
+import lombok.Getter;
+
 /**
  * <p>
  * 字段填充策略枚举类
@@ -23,6 +25,7 @@ package com.baomidou.mybatisplus.annotation;
  * @author hubin
  * @Date 2017-06-27
  */
+@Getter
 public enum FieldFill {
     DEFAULT(0, "默认不处理"),
     INSERT(1, "插入填充字段"),
@@ -54,12 +57,4 @@ public enum FieldFill {
         return FieldFill.DEFAULT;
     }
 
-    public int getKey() {
-        return this.key;
-    }
-
-    public String getDesc() {
-        return this.desc;
-    }
-
 }

+ 3 - 8
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/FieldStrategy.java

@@ -15,6 +15,8 @@
  */
 package com.baomidou.mybatisplus.annotation;
 
+import lombok.Getter;
+
 /**
  * <p>
  * 字段策略枚举类
@@ -23,6 +25,7 @@ package com.baomidou.mybatisplus.annotation;
  * @author hubin
  * @Date 2016-09-09
  */
+@Getter
 public enum FieldStrategy {
     IGNORED(0, "忽略判断"),
     NOT_NULL(1, "非 NULL 判断"),
@@ -53,12 +56,4 @@ public enum FieldStrategy {
         return FieldStrategy.NOT_NULL;
     }
 
-    public int getKey() {
-        return this.key;
-    }
-
-    public String getDesc() {
-        return this.desc;
-    }
-
 }

+ 3 - 8
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/IdType.java

@@ -15,6 +15,8 @@
  */
 package com.baomidou.mybatisplus.annotation;
 
+import lombok.Getter;
+
 /**
  * <p>
  * 生成ID类型枚举类
@@ -23,6 +25,7 @@ package com.baomidou.mybatisplus.annotation;
  * @author hubin
  * @Date 2015-11-10
  */
+@Getter
 public enum IdType {
     AUTO(0, "数据库ID自增"), INPUT(1, "用户输入ID"),
 
@@ -63,12 +66,4 @@ public enum IdType {
         return ID_WORKER;
     }
 
-    public int getKey() {
-        return this.key;
-    }
-
-    public String getDesc() {
-        return this.desc;
-    }
-
 }