package com.diagbot.enums;


/**
 * @author dsYun
 * @date
 */
public enum BehospitalStatusEnum {
    BE_REVIEWED("1", "待审核"),
    ALREADY_PASSED("2", "已通过"),
    REJECTED("3", "已驳回"),
    NO_APPEAL("4", "未申诉"),
    APPEALED("5", "已申诉"),
    UNKNOWN("-1", "未知状态"); // 兜底枚举

    private final String code;
    private final String desc;

    BehospitalStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 根据 code 查找枚举
    public static BehospitalStatusEnum fromCode(String code) {
        for (BehospitalStatusEnum status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return UNKNOWN; // 未匹配时返回兜底值
    }

    public String getDesc() {
        return desc;
    }
}

