diff --git a/src/main/java/xyz/zhouxy/plusone/commons/model/Gender.java b/src/main/java/xyz/zhouxy/plusone/commons/model/Gender.java index 24dbeb9..7922305 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/model/Gender.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/model/Gender.java @@ -16,6 +16,7 @@ package xyz.zhouxy.plusone.commons.model; +import xyz.zhouxy.plusone.commons.base.IWithIntCode; import xyz.zhouxy.plusone.commons.util.AssertTools; /** @@ -23,7 +24,7 @@ import xyz.zhouxy.plusone.commons.util.AssertTools; * * @author ZhouXY */ -public enum Gender { +public enum Gender implements IWithIntCode { UNKNOWN(0, "Unknown", "未知"), MALE(1, "Male", "男"), FEMALE(2, "Female", "女"), @@ -60,4 +61,9 @@ public enum Gender { return displayNameZh; } + @Override + public int getCode() { + return getValue(); + } + }