package com.sckw.core.model.enums;

import lombok.Getter;

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

    /**
     * 普通
     */
    NO(0, ""),

    /**
     * 装货
     */
    SHIPMENT(1, "装货"),

    /**
     * 卸货
     */
    TAKE(2, "卸货"),

    /**
     *
     */
    BOTH(3, "装/卸");

    private final int code;

    private final String name;

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

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

}
