Kaynağa Gözat

docs: 删除文件

ChenSiTong 6 yıl önce
ebeveyn
işleme
69ebca48ff

+ 0 - 29
src/main/java/nju/seec/helper/util/enums/ExceptionType.java

@@ -1,29 +0,0 @@
-package nju.seec.helper.util.enums;
-
-import lombok.Getter;
-import org.springframework.http.HttpStatus;
-
-/**
- * @author cst
- */
-
-@Getter
-public enum ExceptionType {
-    // http code
-    PARAM_ERROR(HttpStatus.BAD_REQUEST), NOT_LOGIN(HttpStatus.UNAUTHORIZED), FORBIDDEN(HttpStatus.FORBIDDEN), NOT_FOUND(HttpStatus.NOT_FOUND), CONFLICT(HttpStatus.CONFLICT), ERROR(HttpStatus.INTERNAL_SERVER_ERROR);
-
-    private HttpStatus status;
-
-    ExceptionType(HttpStatus status) {
-        this.status = status;
-    }
-
-    public static ExceptionType valueOf(HttpStatus status) {
-        for (ExceptionType exceptionType : ExceptionType.values()) {
-            if (exceptionType.getStatus().equals(status)) {
-                return exceptionType;
-            }
-        }
-        return ExceptionType.ERROR;
-    }
-}

+ 0 - 27
src/main/java/nju/seec/helper/util/enums/MessageType.java

@@ -1,27 +0,0 @@
-package nju.seec.helper.util.enums;
-
-/**
- * @author cst
- */
-public enum MessageType {
-    /**
-     * 课件开课
-     */
-    SLIDE_IN_CLASS,
-    /**
-     * 新的评论
-     */
-    COMMENT_NEW,
-    /**
-     * 评论被老师回复
-     */
-    COMMENT_REPLY,
-    /**
-     * 新公告
-     */
-    NOTICE_NEW,
-    /**
-     * 新测试
-     */
-    QUIZ_NEW
-}

+ 0 - 37
src/main/java/nju/seec/helper/util/enums/QuestionType.java

@@ -1,37 +0,0 @@
-package nju.seec.helper.util.enums;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-
-/**
- * @author cst
- */
-public enum QuestionType {
-    /**
-     * 单选
-     */
-    CHOICE("choice"),
-    /**
-     * 判断
-     */
-    TRUE_FALSE("true_false");
-
-    private String value;
-
-    QuestionType(String value) {
-        this.value = value;
-    }
-
-    @JsonValue
-    public String getValue() {
-        return value;
-    }
-
-    public static QuestionType getQuestionType(String value) {
-        for (QuestionType questionType : QuestionType.values()) {
-            if (questionType.getValue().equals(value)) {
-                return questionType;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 53
src/main/java/nju/seec/helper/util/enums/QuizState.java

@@ -1,53 +0,0 @@
-package nju.seec.helper.util.enums;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import lombok.NonNull;
-import lombok.val;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author xst
- * <p>
- * updated by cst
- */
-public enum QuizState {
-    NOT_STARTED("未开始"), ONGOING("正在进行"), CLOSED("已结束");
-    private String name;
-
-    QuizState(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    private static final Map<SlideState, Map<QuizState, Set<QuizType>>> MAP = ImmutableMap.of(
-            SlideState.DRAFT, ImmutableMap.of(NOT_STARTED, ImmutableSet.of(QuizType.BEFORE_CLASS, QuizType.IN_CLASS, QuizType.AFTER_CLASS)),
-            SlideState.BEFORE_CLASS, ImmutableMap.of(NOT_STARTED, ImmutableSet.of(QuizType.IN_CLASS, QuizType.AFTER_CLASS),
-                    ONGOING, ImmutableSet.of(QuizType.BEFORE_CLASS)),
-            SlideState.IN_CLASS, ImmutableMap.of(NOT_STARTED, ImmutableSet.of(QuizType.AFTER_CLASS),
-                    ONGOING, ImmutableSet.of(QuizType.IN_CLASS),
-                    CLOSED, ImmutableSet.of(QuizType.BEFORE_CLASS)),
-            SlideState.AFTER_CLASS, ImmutableMap.of(ONGOING, ImmutableSet.of(QuizType.AFTER_CLASS),
-                    CLOSED, ImmutableSet.of(QuizType.BEFORE_CLASS, QuizType.IN_CLASS)),
-            SlideState.FINISH, ImmutableMap.of(CLOSED, ImmutableSet.of(QuizType.BEFORE_CLASS, QuizType.IN_CLASS, QuizType.AFTER_CLASS))
-    );
-
-    public static QuizState getQuizStateBySlideStateAndQuizType(@NonNull SlideState slideState, @NonNull QuizType quizType) {
-        Map<QuizState, Set<QuizType>> map = MAP.get(slideState);
-        for (val entry : map.entrySet()) {
-            if (entry.getValue().contains(quizType)) {
-                return entry.getKey();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 39
src/main/java/nju/seec/helper/util/enums/QuizType.java

@@ -1,39 +0,0 @@
-package nju.seec.helper.util.enums;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import lombok.NonNull;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author cst
- */
-public enum QuizType {
-    /**
-     * 课前测试
-     */
-    BEFORE_CLASS,
-    /**
-     * 课中测试
-     */
-    IN_CLASS,
-    /**
-     * 课后测试
-     */
-    AFTER_CLASS;
-
-    private final static Map<SlideState, Set<QuizType>> SLIDE_QUIZ_MAP = ImmutableMap.of(
-            SlideState.DRAFT, ImmutableSet.of(BEFORE_CLASS, IN_CLASS, AFTER_CLASS),
-            SlideState.BEFORE_CLASS, ImmutableSet.of(BEFORE_CLASS, IN_CLASS, AFTER_CLASS),
-            SlideState.IN_CLASS, ImmutableSet.of(IN_CLASS, AFTER_CLASS),
-            SlideState.AFTER_CLASS, ImmutableSet.of(AFTER_CLASS),
-            SlideState.FINISH, Collections.emptySet()
-    );
-
-    public static Set<QuizType> getQuizTypesBySlideState(@NonNull SlideState slideState) {
-        return SLIDE_QUIZ_MAP.get(slideState);
-    }
-}

+ 0 - 17
src/main/java/nju/seec/helper/util/enums/SlideState.java

@@ -1,17 +0,0 @@
-package nju.seec.helper.util.enums;
-
-/**
- * @author cst
- */
-public enum SlideState {
-    DRAFT(1), BEFORE_CLASS(2), IN_CLASS(3), AFTER_CLASS(4), FINISH(5);
-    private Integer num;
-
-    SlideState(Integer num) {
-        this.num = num;
-    }
-
-    public Integer getNum() {
-        return num;
-    }
-}

+ 0 - 9
src/main/java/nju/seec/helper/util/enums/UserType.java

@@ -1,9 +0,0 @@
-package nju.seec.helper.util.enums;
-
-/**
- * @author cst
- */
-
-public enum UserType {
-    TEACHER, STUDENT
-}

+ 0 - 20
src/main/java/nju/seec/helper/util/exception/HelperException.java

@@ -1,20 +0,0 @@
-package nju.seec.helper.util.exception;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import nju.seec.helper.util.enums.ExceptionType;
-
-/**
- * @author cst
- */
-@Getter
-@AllArgsConstructor(staticName = "of")
-public class HelperException extends RuntimeException {
-    private final ExceptionType type;
-    private final String msg;
-
-    @Override
-    public String getMessage() {
-        return msg;
-    }
-}