WANG hace 6 años
padre
commit
1a2653bfba

+ 0 - 41
examcloud-exchange-base/src/main/java/cn/com/qmth/examcloud/exchange/base/enums/ExamType.java

@@ -1,41 +0,0 @@
-package cn.com.qmth.examcloud.exchange.base.enums;
-
-/**
- * @author ting.yin
- * @Description: 考试类型
- * @date 2017年1月5日
- */
-public enum ExamType {
-    /**
-     * 传统考试
-     */
-    TRADITION,
-    /**
-     * 在线考试
-     */
-    ONLINE,
-    /**
-     * 在线练习
-     */
-    PRACTICE,
-
-    /**
-     * 离线考试
-     */
-    OFFLINE,
-
-    /**
-     * 分布式印刷考试
-     */
-    PRINT_EXAM;
-
-    public static ExamType strToEnum(String str) {
-        for (ExamType examType : ExamType.values()) {
-            if (examType.name().equals(str)) {
-                return examType;
-            }
-        }
-        return null;
-    }
-
-}

+ 4 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/bean/ExamReq.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean;
 
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
 
 /**
@@ -25,7 +26,7 @@ public class ExamReq implements JsonSerializable {
 	/**
 	 * 考试类型
 	 */
-	private String examType;
+	private ExamType examType;
 
 	/**
 	 * 考试开始时间
@@ -58,11 +59,11 @@ public class ExamReq implements JsonSerializable {
 		this.name = name;
 	}
 
-	public String getExamType() {
+	public ExamType getExamType() {
 		return examType;
 	}
 
-	public void setExamType(String examType) {
+	public void setExamType(ExamType examType) {
 		this.examType = examType;
 	}
 

+ 1 - 1
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/StudentExamInfoController.java

@@ -90,7 +90,7 @@ public class StudentExamInfoController extends ControllerSupport {
 				saveExamReq.setDuration(exam.getDuration());
 				saveExamReq
 						.setEndTime(DateUtil.parse(exam.getEndTime(), DatePatterns.CHINA_DEFAULT));
-				saveExamReq.setExamType(exam.getExamType().name());
+				saveExamReq.setExamType(exam.getExamType());
 				saveExamReq.setName(exam.getName());
 				saveExamReq.setRemark(exam.getRemark());
 				saveExamReq.setRootOrgId(rootOrgId);

+ 1 - 1
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/bean/OutletExam.java

@@ -5,7 +5,7 @@ import java.util.Date;
 
 import javax.validation.constraints.NotNull;
 
-import cn.com.qmth.examcloud.exchange.base.enums.ExamType;
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 import cn.com.qmth.examcloud.exchange.base.enums.MarkingType;
 import cn.com.qmth.examcloud.exchange.base.enums.PracticeType;
 

+ 2 - 1
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ExamOuterServiceProvider.java

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
@@ -61,7 +62,7 @@ public class ExamOuterServiceProvider extends ControllerSupport implements ExamO
 		Date beginTime = req.getBeginTime();
 		Integer duration = req.getDuration();
 		Date endTime = req.getEndTime();
-		String examType = req.getExamType();
+		ExamType examType = req.getExamType();
 		String name = req.getName();
 		String remark = req.getRemark();
 		Long rootOrgId = req.getRootOrgId();

+ 4 - 3
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveExamReq.java

@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.exchange.outer.api.request;
 import java.util.Date;
 import java.util.Map;
 
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 import cn.com.qmth.examcloud.api.commons.exchange.EnterpriseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -30,7 +31,7 @@ public class OuterSaveExamReq extends EnterpriseRequest {
 	private String name;
 
 	@ApiModelProperty(value = " 考试类型(ONLINE:网考;TRADITION:传统;OFFLINE:离线;PRACTICE:练习;PRINT_EXAM:PRINT_EXAM.)", example = "ONLINE", required = true)
-	private String examType;
+	private ExamType examType;
 
 	@ApiModelProperty(value = "考试时长(单位:分钟)", example = "120", required = true)
 	private Integer duration;
@@ -76,11 +77,11 @@ public class OuterSaveExamReq extends EnterpriseRequest {
 		this.name = name;
 	}
 
-	public String getExamType() {
+	public ExamType getExamType() {
 		return examType;
 	}
 
-	public void setExamType(String examType) {
+	public void setExamType(ExamType examType) {
 		this.examType = examType;
 	}