package com.jsowell.common.enums.ykc;

/**
 * 远程停止充电失败原因enum
 *
 * @author JS-ZZA
 * @date 2022/11/16 8:31
 */
public enum StopChargingFailedReasonEnum {
    NULL("00", "无"),
    EQUIPMENT_CODE_NOT_MATCH("01", "设备编号不匹配"),
    CONNECTOR_NOT_IN_CHARGING("02", "枪未处于充电状态"),
    OTHER("03","其他"),


    ;
    private String code;
    private String msg;

    StopChargingFailedReasonEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 根据code获取msg
     * @param code
     * @return
     */
    public static String getMsgByCode(String code) {
        for (StopChargingFailedReasonEnum item : StopChargingFailedReasonEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getMsg();
            }
        }
        return null;
    }

}
