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

import lombok.AllArgsConstructor;

/**
 * @author 颜艺波
 * @date 2022/6/16 17:09
 * @Description
 */
@AllArgsConstructor
public enum HealthCodeEnum {
    NoRequest(0, "未请求"),

    NOAPPLY(1, "未申领"),

    GREEN(2, "绿码"),

    YELLOW(3, "黄码"),
    RED(4, "红码"),

    NOPERSON(5, "无此人员"),

    OTHER(6, "其他错误信息"),

    OVERTIME(7, "查询健康码超时");

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    private String description;

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