package com.ruixuan.isc.enums;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;

public enum CompanyEnum {
    yuantong("yuantong", "圆通速递"),
    yunda("yunda", "韵达快递"),
    zhongtong("zhongtong", "中通快递"),
    shentong("shentong", "申通快递"),
    jtexpress("jtexpress", "极兔速递"),
    youzhengguonei("youzhengguonei", "邮政快递包裹"),
    shunfeng("shunfeng", "顺丰速运"),
    ems("ems", "EMS"),
    jd("jd", "京东物流"),
    youzhengbk("youzhengbk", "邮政标准快递"),
    fengwang("fengwang", "丰网速运"),
    debangkuaidi("debangkuaidi", "德邦快递"),
    debangwuliu("debangwuliu", "德邦"),
    zhongtongkuaiyun("zhongtongkuaiyun", "中通快运"),
    jingdongkuaiyun("jingdongkuaiyun", "京东快运"),
    tiantian("tiantian", "天天快递"),
    huitongkuaidi("huitongkuaidi", "百世快递");


    private String code;
    private String name;


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

    public static List<JSONObject> companyList() {
        List<JSONObject> list = new ArrayList<>();
        for (CompanyEnum em : CompanyEnum.values()) {
            JSONObject json = new JSONObject();
            json.put("name", em.getName());
            json.put("code", em.getCode());
            list.add(json);
        }
        return list;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
