package com.ssj.service.kmt.exercisesys.enums;

import java.util.Objects;

/**
 * @author yrf
 * @date 2020/6/2 11:44
 */
public enum ExportExerciseBookStatusEnum {

    Processing(1, "加工中"),
    Auditing(2, "加工审核中"),
    AnalysisProcessing(3, "解析加工中"),
    AnalysisAuditing(4, "解析审核中"),
    Published(5, "已发布发布");

    private int code;
    private String description;

    ExportExerciseBookStatusEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static String getDescriptionByCode(Integer code) {
        for (ExportExerciseBookStatusEnum value : ExportExerciseBookStatusEnum.values()) {
            if (Objects.equals(value.getCode(), code)) {
                return value.getDescription();
            }
        }
        return "";
    }
}
