package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: SiteConditionsEnum
 * @Description:立地条件
 * @date 2024-03-26 16:08
 */
public enum SiteConditionsEnum {

    //1.单门面 2.双门面 3.多门面 4.转角
    SITE_CONDITIONS_1(1, "单门面"),
    SITE_CONDITIONS_2(2, "双门面"),
    SITE_CONDITIONS_3(3, "多门面"),
    SITE_CONDITIONS_4(4, "转角"),
    ;

    private Integer code;

    private String desc;

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

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


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

}
