feat(auth): 添加 UserType 枚举常量,区分 ADMIN 和 MEMBER 用户类型

This commit is contained in:
张翔
2026-06-03 11:17:25 +08:00
parent 08cf82ac83
commit 005c09c99c
@@ -0,0 +1,22 @@
package cn.novalon.gym.manage.common.constants;
/**
* 用户类型枚举
* 用于区分后台管理用户和前台会员用户
*/
public enum UserType {
ADMIN,
MEMBER;
public static UserType fromString(String value) {
if (value == null) {
throw new IllegalArgumentException("userType 不能为空");
}
for (UserType type : values()) {
if (type.name().equalsIgnoreCase(value)) {
return type;
}
}
throw new IllegalArgumentException("未知的用户类型: " + value);
}
}