From 1c63c752fbe54f770e7cf90ee91f8d85d828064d Mon Sep 17 00:00:00 2001 From: yangjie <1179743470@qq.com> Date: Tue, 8 Jun 2021 16:23:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E5=AE=B6=E8=B4=A6=E5=8F=B7=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yipin/liuwanr/entity/UserIdEnum.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/com/yipin/liuwanr/entity/UserIdEnum.java diff --git a/src/main/java/com/yipin/liuwanr/entity/UserIdEnum.java b/src/main/java/com/yipin/liuwanr/entity/UserIdEnum.java new file mode 100644 index 0000000..92be97d --- /dev/null +++ b/src/main/java/com/yipin/liuwanr/entity/UserIdEnum.java @@ -0,0 +1,41 @@ +package com.yipin.liuwanr.entity; + +public enum UserIdEnum { + + USER_ONE(1504,"10000000"), + USER_TWO(1505,"10000000"), + USER_THREE(1506,"10000000"), + USER_FOUR(1507,"10000000"), + USER_FIVE(1508,"10000000"), + USER_SIX(1509,"10000000"), + USER_SEVEN(1510,"10000000"), + USER_EIGHT(1511,"10000000"), + USER_NINE(1512,"10000000"), + USER_TEN(1513,"10000000"); + + private final Integer userId; + private final String name; + + UserIdEnum(Integer value, String name) { + this.userId = value; + this.name = name; + } + + public static Integer getUserId(int userValue){ + for (UserIdEnum value : UserIdEnum.values()) { + if (value.userId==userValue){ + return value.userId; + } + } + return 0; + } + + public Integer getUserId() { + return userId; + } + + public String getName() { + return name; + } + +}