package cn.novalon.gym.manage.groupcourse.enums;

/**
 * 团课状态枚举
 * 
 * @author 张翔
 * @date 2026-06-02
 */
public enum CourseStatus {
    
    NORMAL(0L, "正常"),
    CANCELLED(1L, "已取消"),
    ENDED(2L, "已结束"),
    IN_PROGRESS(3L, "进行中");

    private final Long value;
    private final String desc;

    CourseStatus(Long value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Long getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据值获取枚举
     */
    public static CourseStatus fromValue(Long value) {
        for (CourseStatus status : values()) {
            if (status.value.equals(value)) {
                return status;
            }
        }
        return NORMAL;
    }
}