package com.ruoyi.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum ExamineeStatus {
    Init(1, "空卷"), Sign(2, "签到"), Exam(3, "考试"), Commit(4, "交卷"),
    Review(5, "阅卷"), Publish(6, "发布"), Close(7, "关卷");

    private final Integer val;
    private final String title;

    private static final Map<Integer, ExamineeStatus> valMap = Arrays.stream(ExamineeStatus.values()).collect(Collectors.toMap(ExamineeStatus::getVal, Function.identity()));

    public static ExamineeStatus of(Integer vol) {
        return valMap.get(vol);
    }
}

