package com.jsowell.common.enums.thirdparty;

import com.jsowell.common.enums.ykc.ChargingFailedReasonEnum;
import com.jsowell.common.util.StringUtils;

/**
 * 第三方对接平台 type
 *
 * @author Lemon
 * @Date 2023/10/23 8:21:33
 */
public enum ThirdPlatformTypeEnum {
    LIAN_LIAN_PLATFORM("1", "联联平台"),
    ZHONG_DIAN_LIAN_PLATFORM("2", "中电联平台"),
    JIANG_SU_PLATFORM("3", "江苏省平台"),
    YONG_CHENG_BO_CHE("4", "甬城泊车平台"),
    ;

    private String code;

    private String label;

    public String getCode() {
        return code;
    }

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

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    ThirdPlatformTypeEnum(String code, String label) {
        this.code = code;
        this.label = label;
    }

    /**
     * 根据code获取停止原因描述
     *
     * @param code 编码
     * @return 停止原因描述
     */
    public static String getMsgByCode(String code) {
        for (ThirdPlatformTypeEnum item : ThirdPlatformTypeEnum.values()) {
            if (StringUtils.equals(item.getCode(), code)) {
                return item.getLabel();
            }
        }
        return null;
    }
}
