package com.yuchen.saas.park.api.enums;

import lombok.AllArgsConstructor;

/**
 * @author 颜艺波
 * @date 2022/6/16 17:16
 * @Description
 */
@AllArgsConstructor
public enum PassEnum {

    FORBIDDEN(0, "禁止通行"),

    PASS(1, "请通行");


    private Integer code;

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    private String description;

    public static String getDescByCode(Integer code) {
        PassEnum[] enumArray = PassEnum.values();
        for (PassEnum e : enumArray) {
            if (e.getCode().equals(code)) {
                return e.getDescription();
            }
        }
        return "";
    }
}
