package com.yonge.cooleshow.mall.common.courier.enums;

/**
 * Description
 *
 * @author liujunchi
 * @date 2022-10-26
 */
public enum CompanyEnum {

    SHUNFENG("shunfeng","顺丰快递"),
    ZHONGTONG("zhongtong","中通快递"),
    YUANTONG("yuantong","圆通快递"),
    HUITONGKUAIDI("huitongkuaidi","汇通"),
    SHENTONG("shentong","申通"),
    YUNDA("yunda","韵达快递"),
    EMS("ems","ems"),
    JD("jd","京东"),
    ZHAIJISONG("zhaijisong","宅急送"),
    DEBANGKUAIDI("debangkuaidi","德邦快递"),
    ;


    // 快递100对应编号
    private String code;

    // 公司描述
    private String desc;

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

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static CompanyEnum codeOf(String s) {
        for (CompanyEnum value : CompanyEnum.values()) {
            if (value.getCode().equals(s)) {
                return value;
            }
        }
        return null;
    }


    public static CompanyEnum descOf(String s) {
        for (CompanyEnum value : CompanyEnum.values()) {
            if (value.getDesc().equals(s)) {
                return value;
            }
        }
        return null;
    }
}
