package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: PointDirectionEnum
 * @Description:店铺方位
 * @date 2024-03-26 16:08
 */
public enum PointDirectionEnum {

    //1.主要动线  2.次要动线
    POINT_DIRECTION_1(1, "主要动线"),
    POINT_DIRECTION_2(2, "次要动线"),
    ;

    private Integer code;

    private String desc;

    PointDirectionEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static PointDirectionEnum getByCode(Integer code) {
        if(Objects.isNull(code)){
            return null;
        }
        for (PointDirectionEnum value : PointDirectionEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
