package jnpf.enums.training;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yanglei
 * @version V1.0
 * @date 2023/7/20 2:03
 */
public class CourseEnums {

    @Getter
    @AllArgsConstructor
    public enum CourseGroundingType{
        UNDER(0, "未上架"),
        UP(1, "已上架"),
        ;
        private final Integer code;
        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum EnabledMarkType{
        INVALID(0, "无效"),
        VALID(1, "有效"),
        ;
        private final Integer code;
        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum IsRightAnswer{
        NO(0, "否"),
        YES(1, "是"),
        ;
        private final Integer code;
        private final String desc;
    }


    @Getter
    @AllArgsConstructor
    //考试状态
    public enum ExamStatus{
        //待考试
        WAIT(0),
        //待批阅
        WAIT_CHECK(1),
        //已逾期
        OVERDUE(2),
        //合格
        PASS(3),
        //不合格
        NO_PASS(4),
        //优秀
        VERY_PASS(5),
        ;
        private final Integer code;

    }
    //场景类型
    @Getter
    public enum ExamMapType{
        //统考
        ALL(1),
        //岗位
        POSITION(2),
        ;
        private final int code;

        ExamMapType(int code) {
            this.code = code;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum QuestionType{
        SINGLE(1, "单选题"),
        MULTI(2, "多选题"),
        JUDGE(3, "判断题"),
        FILL(4, "填空题"),
        INPUT(5, "问答题"),
        COMBINE(6, "组合题"),
        ;
        private final Integer code;
        private final String desc;

        public static QuestionType getByDesc(String desc){
            QuestionType[] values = QuestionType.values();
            for (QuestionType value : values) {
                if (value.getDesc().equals(desc)){
                    return value;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum QuestionDifficulty{
        EASY(1, "易"),
        MIDDLE(2, "中"),
        MAX(3, "难"),
        ;
        private final Integer code;
        private final String desc;

        public static QuestionDifficulty getByDesc(String desc){
            QuestionDifficulty[] values = QuestionDifficulty.values();
            for (QuestionDifficulty value : values) {
                if (value.getDesc().equals(desc)){
                    return value;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum CertExpireType{
        MONTH(1, "按月"),
        DAY(2, "按天"),
        NEVER(3, "永久"),
        ;
        private final Integer code;
        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum CertStatus{
        DOWN(0, "已下架"),
        UP(1, "上架中"),
        ;
        private final Integer code;
        private final String desc;
    }
    @Getter
    @AllArgsConstructor
    public enum CertUserStatus{
        USING(0, "生效中"),
        UN_USE(1, "已失效"),
        REVOKED(2, "已吊销"),
        ;
        private final Integer code;
        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum LearningType{
        COURSE(1, "课程"),
        EXAM(2, "考试"),
        IDENTIFY(3, "鉴定"),
        ;
        private final Integer code;
        private final String desc;

        public static LearningType getByCode(Integer code){
            LearningType[] values = LearningType.values();
            for (LearningType value : values) {
                if (value.getCode().equals(code)){
                    return value;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum LearningStatus{
        ING(0, "学习部分"),
        FINISH(1, "已学完"),
        NO_START(2, "未开始"),
        NO_PASS(3, "未通过"),
        ;
        private final Integer code;
        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum PaperType{
        FIX(1, "固定"),
        RANDOM(2, "随机"),
        ;
        private final Integer code;
        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum IdentifyStatus{
        UNDO(0, "待鉴定"),
        PASS(1, "已通过"),
        FAIL(2, "未通过"),
        ;
        private final Integer code;
        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum IdentifyType{
        YES_NO(1, "是/否"),
        OTHER(2, "熟悉/一般/了解"),
        ;
        private final Integer code;
        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum IdentifyOption{
        YES(1, "是"),
        NO(2, "否"),
        GOOD_AT(11, "熟悉"),
        COMMON(12, "一般"),
        KNOW(13, "了解"),
        ;
        private final Integer code;
        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum StudyType{
        POSITION(1, "岗位学习"),
        BASE(2, "知识库"),
        ;
        private final Integer code;
        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum StudyStatus{
        ING(0, "学习中"),
        FINISH(1, "已学习"),
        NO_START(2, "未学习"),
        ;
        private final Integer code;
        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum FollowStatus{
        //关注状态,0.取消关注,1.相互关注.2关注
        FALSE(0, "取消关注"),
        C_T_C_TRUE(1, "相互关注"),
        TRUE(2, "关注"),
        ;
        private final Integer code;
        private final String desc;
    }
}
