package com.lesingle.creation.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 奖项等级枚举
 */
@Getter
@AllArgsConstructor
public enum AwardLevelEnum {

    FIRST("first", "一等奖"),
    SECOND("second", "二等奖"),
    THIRD("third", "三等奖"),
    EXCELLENT("excellent", "优秀奖"),
    NONE("none", "无奖项");

    private final String code;
    private final String desc;

    public static AwardLevelEnum getByCode(String code) {
        if (code == null) {
            return NONE;
        }
        for (AwardLevelEnum level : values()) {
            if (level.getCode().equals(code)) {
                return level;
            }
        }
        return NONE;
    }
}
