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; + } + +}