package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: IntendPositionEnum
 * @Description:意向店所处位置
 * @date 2024-03-26 16:08
 */
public enum IntendPositionEnum {

    //1.十字路口 2.居民生活中心 3.社区出入口
    INTEND_POSITION_1(1, "十字路口", 6),
    INTEND_POSITION_2(2, "居民生活中心", 5),
    INTEND_POSITION_3(3, "社区出入口", 5),
    ;

    private Integer code;

    private String desc;

    private Integer score;

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

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getScore() {
        return score;
    }


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


}
