package org.springblade.modules.app.common.enums;

public enum ProblemBackStateEnum {

    NOT_VIEWED(0, "未查看"),
    VIEWED(1, "已查看"),
    ;
    private int code;
    private String text;

    ProblemBackStateEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static ProblemBackStateEnum findByCode(int code) {
        for (ProblemBackStateEnum demoEnum : values()) {
            if (code == demoEnum.getCode()) {
                return demoEnum;
            }
        }
        return null;
    }

}
