package com.ningdatech.carapi.sys.entity.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author liuxinxin
 * @date 2022/10/17 上午11:15
 */

@AllArgsConstructor
@Getter
public enum RoleEnum {
    /**
     * 駕駛員
     */
    DRIVER("DRIVER");

    private final String key;

    public static boolean contains(String key) {
        if (StringUtils.isBlank(key)) {
            return false;
        }
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.key.equals(key)) {
                return true;
            }
        }
        return false;
    }

}
