package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: GatherGuestHospitalEnum
 * @Description:聚客点医院
 * @date 2024-03-26 16:08
 */
public enum GatherGuestHospitalEnum {

    //1.甲等医院  2.市级医院  3.县区级医院  4.无医院
    GATHER_GUEST_HOSPITAL_1(1, "甲等医院", 5),
    GATHER_GUEST_HOSPITAL_2(2, "市级医院", 3),
    GATHER_GUEST_HOSPITAL_3(3, "县区级医院", 2),
    GATHER_GUEST_HOSPITAL_4(4, "无医院", 1)
    ;

    private Integer code;

    private String desc;

    private Integer score;

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

}
