Kaynağa Gözat

fix: enum序列化错误

370774330@qq.com 5 yıl önce
ebeveyn
işleme
25738aa575

+ 8 - 2
core/src/main/java/seecoder/devcloud/core/commit/CommitState.java

@@ -1,16 +1,22 @@
 package seecoder.devcloud.core.commit;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+
 /**
  * @author PuHong Weng
  * @date 2021/3/22
  * @description:
  */
 public enum CommitState {
-
-    UNKNOWN(""),
+    @JsonProperty("unknowx")
+    UNKNOWN("unknown"),
+    @JsonProperty("complete")
     COMPLETE("complete"),
+    @JsonProperty("working on")
     WORKING_ON("working on"),
+    @JsonProperty("fix")
     FIX("fix"),
+    @JsonProperty("fixing on")
     FIXING_ON("fixing on");
 
     private final String value;

+ 6 - 1
core/src/main/java/seecoder/devcloud/core/commit/CommitType.java

@@ -1,5 +1,7 @@
 package seecoder.devcloud.core.commit;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+
 /**
  * @author PuHong Weng
  * @date 2021/3/22
@@ -7,9 +9,12 @@ package seecoder.devcloud.core.commit;
  */
 public enum CommitType {
 
+    @JsonProperty("fix")
     FIX("fix"),
+    @JsonProperty("feat")
     FEAT("feat"),
-    UNKNOWN("");
+    @JsonProperty("unknown")
+    UNKNOWN("unknown");
 
     private final String value;