package com.everyday.word.entity.user;
|
|
/**
|
* @author hxh
|
* @title: IdentityType
|
* @description: 表示类型
|
* @date 2025/2/11 10:40
|
*/
|
public enum IdentityType {
|
// 手机号登录
|
PHONE("phone"),
|
// 微信登录
|
WECHAT("wechat"),
|
// QQ登录
|
QQ("qq");
|
|
private final String value;
|
|
IdentityType(String value) {
|
this.value = value;
|
}
|
|
public String getValue() {
|
return value;
|
}
|
// 根据字符串值获取枚举
|
public static IdentityType fromValue(String value) {
|
for (IdentityType type : IdentityType.values()) {
|
if (type.getValue().equals(value)) {
|
return type;
|
}
|
}
|
throw new IllegalArgumentException("Unknown identity type: " + value);
|
}
|
}
|