package com.bonus.sgzb.common.core.enums;

public enum PartTypeEnum {


    NOT_CHARGE("0", "不收费"),
    CHARGE("1", "收费");

    private final String code;
    private final String info;

    PartTypeEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }


    public static String getCodeByInfo(String info){
        for (PartTypeEnum type : PartTypeEnum.values()) {
            if (type.info.equals(info)) {
                return type.code;
            }
        }
        return null;
    }

    public static String getInfoByCode(String code){
        for (PartTypeEnum type : PartTypeEnum.values()) {
            if (type.code.equals(code)) {
                return type.info;
            }
        }
        return null;
    }

}
