package cn.reghao.tnb.content.app.mall.model.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author reghao
 * @date 2024-09-19 11:27:40
 */
public enum LogisticsStatus {
    status1(1, "已发货"),
    status2(2, "已揽件"),
    status3(3, "运输中"),
    status4(4, "派送中"),
    status5(5, "待取件"),
    status6(6, "已签收");

    private final int code;
    private final String desc;

    private static Map<Integer, LogisticsStatus> map = new HashMap<>();
    static {
        for (LogisticsStatus status : LogisticsStatus.values()) {
            map.put(status.code, status);
        }
    }
    LogisticsStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static LogisticsStatus getByCode(int code) {
        return map.get(code);
    }
}
