package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: CoverCommunityEnum
 * @Description:覆盖社区(半径500米内）
 * @date 2024-03-26 16:08
 */
public enum CoverCommunityEnum {

    //1.800户以下 2.800-1200户 3.1200-2000户 4.2000户以上
    COVER_COMMUNITY_1(1, "800户以下", 5),
    COVER_COMMUNITY_2(2, "800户-1200户", 10),
    COVER_COMMUNITY_3(3, "1200户-2000户", 12),
    COVER_COMMUNITY_4(4, "2000户以上", 15),
    ;

    private Integer code;

    private String desc;

    private Integer score;

    CoverCommunityEnum(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 CoverCommunityEnum getByCode(Integer code) {
        if(Objects.isNull(code)){
            return null;
        }
        for (CoverCommunityEnum coverCommunityEnum : CoverCommunityEnum.values()) {
            if (coverCommunityEnum.getCode().equals(code)) {
                return coverCommunityEnum;
            }
        }
        return null;
    }

}
