package com.sundot.airport.common.enums;

import lombok.Getter;

/**
 * 奖牌类型枚举
 */
@Getter
public enum MedalTypeEnum {

    GOLD(1, "金牌"),
    SILVER(2, "银牌"),
    BRONZE(3, "铜牌"),
    CRY_RED(4, "哭脸红"),
    CRY_ORANGE(5, "哭脸橙"),
    CRY_YELLOW(6, "哭脸黄");

    private final Integer code;
    private final String desc;

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

    public static MedalTypeEnum getByCode(Integer code) {
        for (MedalTypeEnum medalType : values()) {
            if (medalType.getCode().equals(code)) {
                return medalType;
            }
        }
        return null;
    }
}