From 1e4306005ee75cacf45d9e90b55aa775bd1f33e6 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Mon, 16 Dec 2024 09:38:52 +0800 Subject: [PATCH] =?UTF-8?q?Gender=20=E5=AE=9E=E7=8E=B0=20IWithIntCode=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xyz/zhouxy/plusone/commons/model/Gender.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); + } + }