package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: GatherGuestSchoolEnum
 * @Description:聚客点学校
 * @date 2024-03-26 16:08
 */
public enum GatherGuestSchoolEnum {

    // 1.幼儿园/小学 2.大学/学院 3.初中/高中 4.无学校
    GATHER_GUEST_SCHOOL_1(1, "幼儿园/小学", 4),
    GATHER_GUEST_SCHOOL_2(2, "大学/学院", 3),
    GATHER_GUEST_SCHOOL_3(3, "初中/高中", 2),
    GATHER_GUEST_SCHOOL_4(4, "无学校", 1)
    ;

    private Integer code;

    private String desc;

    private Integer score;

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


}
