package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author czh
 * @desc 默认地址类型
 * @date 2023/6/15
 */
@Getter
public enum AddressDefaultTypeEnum {

    //普通
    NO(0, ""),
    //装货地址
    SHIPMENT(1, "装货"),
    //收货地址
    TAKE(2, "卸货"),
    //装/卸
    BOTH(3, "装/卸");

    private final int code;

    private final String name;

    AddressDefaultTypeEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static AddressDefaultTypeEnum getName(int code){
        for (AddressDefaultTypeEnum addressDefaultTypeEnum : values()) {
            if (addressDefaultTypeEnum.getCode() == code) {
                return addressDefaultTypeEnum;
            }
        }
        return null;
    }

}
