package com.education.common.constants;

/**
 * @author zengjIntegerao
 * @create 2019/3/27 16:09
 * @since 1.0
 **/
public final class EnumConstants {

    public enum CorrectType {
        SYSTEM(1, "系统判分"), TEACHER(2, "教师判分"), SYSTEM_AND_TEACHER(3, "系统加教师判分");
        private Integer value;
        private String name;

        CorrectType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }


    public enum DictType {
        TYPE(1, "字典类型"), VALUE(2, "字典类型值");
        private Integer value;
        private String name;
        DictType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }


    public enum CorrectStatus {
        ERROR(0, "错误"), RIGHT(1, "正确"), CORRECT_RUNNING(2, "待批改"), CORRECTED(3, "已批改");

        private Integer value;
        private String name;
        CorrectStatus(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /**
     * 考试类型
     */
    public enum ExamType {
        ERROR_EXAM(1, "错题纠正考试"), GRADE_EXAM(2, "年级考试"), ENTRANCE_EXAM(3, "入学考试");
        private Integer value;
        private String name;

        ExamType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }


    /**
     * 学校类型
     */
    public enum SchoolType {
        PRIMARY_SCHOOL(1, "小学"), MIDDLE_SCHOOL(2, "初中"), HIGH_SCHOOL(3, "高中");
        private Integer value;
        private String name;

        SchoolType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum PlatformType {

        WEB_ADMIN(1, "后台管理系统"), WEB_FRONT(2, "前端");
        private Integer value;
        private String name;

        PlatformType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum CreateType {
        SYSTEM_CREATE(1, "系统创建"), ADMIN_CREATE(2, "管理员创建");
        private Integer value;
        private String name;

        CreateType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum Sex {
        MAN(1, "男"), WOMAN(2, "女");
        private Integer value;
        private String name;

        Sex(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }


    public enum QuestionType {
        SINGLE_QUESTION(1, "单选题"), MULTIPLE_QUESTION(2, "多选题"),
        FILL_QUESTION(3, "填空题"), SYNTHESIS_QUESTION(4, "综合题"),
        INDEFINITE_ITEM_QUESTION(5, "不定项题"),
        CALCULATION_QUESTION(7, "计算题"),
        JUDGMENT_QUESTION(6, "判断题");
        private Integer value;
        private String name;
        QuestionType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public static String getName(Integer type) {
            QuestionType questionTypes[] = values();
            for (QuestionType questionType : questionTypes) {
                if (questionType.getValue() == type) {
                    return questionType.getName();
                }
            }
            return null;
        }
    }

    /**
     * 登录状态
     */
    public enum LoginStatus {
        LOGIN(1, "登录"), LOGIN_OUT(2, "退出");

        private Integer value;
        private String name;

        LoginStatus(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum CommitAfterType {
        SHOW_MARK_AFTER_CORRECT(1, "批改后显示成绩"),
        SHOW_MARK_NOW(2, "提交立即显示成绩");

        private Integer value;
        private String name;

        CommitAfterType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }


    public enum CourseStatus {
        DRAUGHT(0, "草稿"), GROUNDING(1, "上架"), UNDERCARRIAGE(2, "下架");

        private Integer value;
        private String name;

        CourseStatus(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }
}
