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 PaperType {
    Real(10, "真题卷"), Simulated(20, "定向模拟卷"), Test(30, "批次测试卷"), Course(45, "同步知识点"), Practice(50, "知识点"),
    Custom(51, "自组卷"), WrongQuestions(52, "错题"), KeyQuestions(53, "必刷题");

    private final Integer val;
    private final String title;

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

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

