package com.seer.teach.mp.enums;

import lombok.Getter;

/**
 * <p>
 * 活动时间状态枚举
 * </p>
 *
 * @author Lingma
 * @since 2026-01-21
 */
@Getter
public enum ActivityTimeStatusEnum {

    NOT_STARTED(-1, "未开始"),
    IN_PROGRESS(1, "进行中"),
    ENDED(2, "已结束");

    private final Integer code;
    private final String description;

    ActivityTimeStatusEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * 根据code获取枚举
     */
    public static ActivityTimeStatusEnum fromCode(Integer code) {
        for (ActivityTimeStatusEnum status : ActivityTimeStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}