package org.dromara.common.core.enums;

import org.dromara.common.core.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备类型
 * 针对多套 用户体系
 *
 * @author Lion Li
 */
@Getter
@AllArgsConstructor
public enum UserType {


    /**
     *系统用户
     */
    SYS_USER("sys_user"),
    /**
     * pc端
     */
    PC_USER("pc_user"),

    /**
     * 用户端
     */
    APP_USER("app_user"),

    /**
     * 物管端
     */
    APP_STAFF("app_staff");

    private final String userType;

    public static UserType getUserType(String str) {
        for (UserType value : values()) {
            if (StringUtils.contains(str, value.getUserType())) {
                return value;
            }
        }
        throw new RuntimeException("'UserType' not found By " + str);
    }
}
