package com.prolog.rdc.tms.constant.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 站点类型枚举
 * @author hongbo.pan
 * @date 2022/11/28
 */
@AllArgsConstructor
@Getter
public enum StationTypeEnum {

    SHIPPER(1, "提货"),
    CONSIGNEE(2, "送货"),
    ;

    private static Map<Integer, StationTypeEnum> enumMap = Maps.newHashMap();
    private Integer code;
    private String desc;

    static {
        for(StationTypeEnum as : StationTypeEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static StationTypeEnum getByCode(Integer code) {
        return  enumMap.get(code);
    }

}
