package com.seer.teach.common.enums.teacher;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ReportTypeEnum {

    DAILY(0, "今天"),
    WEEKLY(1, "本周"),
    MONTHLY(2, "本月");

    private final Integer type;

    private final String desc;

    @JsonCreator
    public static ReportTypeEnum fromType(Integer type) {
        for (ReportTypeEnum e : values()) {
            if (e.type.equals(type)) {
                return e;
            }
        }
        throw new IllegalArgumentException("非法报告类型type:" + type);
    }

    @JsonValue
    public Integer getType() {
        return type;
    }
}


