1
0

APP/小程序用户设备绑定

This commit is contained in:
2025-07-05 15:55:46 +08:00
parent 5322e84a92
commit ad82ab5fca
18 changed files with 376 additions and 98 deletions

View File

@ -0,0 +1,48 @@
package com.fuyuanshen.app.enums;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* 用户类型枚举
*
* @author: 默苍璃
* @date: 2025-06-1811:14
*/
public enum UserType {
APP(0, "APP"), MINI_PROGRAM(1, "小程序");
private final int value;
private final String description;
UserType(int value, String description) {
this.value = value;
this.description = description;
}
@JsonValue
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
/**
* 根据值获取对应的枚举
*
* @param value 枚举值
* @return 对应的枚举对象
*/
public static UserType fromValue(int value) {
for (UserType userType : values()) {
if (userType.getValue() == value) {
return userType;
}
}
throw new IllegalArgumentException("Invalid user type value: " + value);
}
}