wangwei há 7 anos atrás
pai
commit
3080f1665c

+ 16 - 16
examcloud-core-examwork-api-client/src/main/java/cn/com/qmth/examcloud/examwork/api/client/ExamCloudClient.java

@@ -5,37 +5,37 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-import cn.com.qmth.examcloud.examwork.api.request.ExamReq;
-import cn.com.qmth.examcloud.examwork.api.response.ExamResp;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
 
 /**
- * @author  	chenken
- * @date    	2018年5月3日 上午9:18:19
- * @company 	QMTH
+ * @author chenken
+ * @date 2018年5月3日 上午9:18:19
+ * @company QMTH
  * @description ExamClient.java
  */
 @Service
-public class ExamCloudClient extends BasicCloudClientSupport implements ExamCloudService{
-	
+public class ExamCloudClient extends BasicCloudClientSupport implements ExamCloudService {
+
 	private static final long serialVersionUID = -2880611326177571371L;
-	
+
 	@Autowired
 	RestTemplate restTemplate;
-	
+
 	@Override
 	protected RestTemplate getRestTemplate() {
 		return restTemplate;
 	}
-	
+
 	@Override
-	public void saveExam(ExamReq exam) {
-		post("exam", exam, ExamReq.class);
+	public void saveExam(SaveExamReq exam) {
+		post("exam", exam, SaveExamReq.class);
 	}
 
 	@Override
-	public ExamResp findExamByExamReq(ExamReq examReq) {
-		return post("exam/findExam", examReq, ExamResp.class);
+	public GetExamResp getExam(GetExamReq examReq) {
+		return post("exam/findExam", examReq, GetExamResp.class);
 	}
-	
-}
 
+}

+ 3 - 3
examcloud-core-examwork-api-client/src/main/java/cn/com/qmth/examcloud/examwork/api/client/ExamStudentCloudClient.java

@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.client.RestTemplate;
 
 import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
-import cn.com.qmth.examcloud.examwork.api.request.ExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
 
 public class ExamStudentCloudClient extends BasicCloudClientSupport implements ExamStudentCloudService{
 
@@ -12,8 +12,8 @@ public class ExamStudentCloudClient extends BasicCloudClientSupport implements E
 	private RestTemplate restTemplate;
 	
 	@Override
-	public void saveExamStudent(ExamStudentReq examStudentReq) {
-		post("examStudent", examStudentReq, ExamStudentReq.class);
+	public void saveExamStudent(SaveExamStudentReq examStudentReq) {
+		post("examStudent", examStudentReq, SaveExamStudentReq.class);
 	}
 
 	@Override

+ 6 - 5
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamCloudServiceProvider.java

@@ -11,8 +11,9 @@ import org.springframework.web.bind.annotation.RestController;
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-import cn.com.qmth.examcloud.examwork.api.request.ExamReq;
-import cn.com.qmth.examcloud.examwork.api.response.ExamResp;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
 import cn.com.qmth.examcloud.service.examwork.entity.Exam;
 import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
 import cn.com.qmth.examcloud.service.examwork.service.ExamService;
@@ -36,7 +37,7 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
 	@ApiOperation(value = "新增考试批次", notes = "新增")
 	@PostMapping
 	@Override
-	public void saveExam(@RequestBody ExamReq examReq) {
+	public void saveExam(@RequestBody SaveExamReq examReq) {
 		Exam exam = new Exam();
 		exam.setName(examReq.getName());
 		exam.setRemark(examReq.getRemark());
@@ -58,10 +59,10 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
 	@ApiOperation(value = "根据名称和机构ID查询考试", notes = "根据名称和机构ID查询考试")
 	@PostMapping("/findExam")
 	@Override
-	public ExamResp findExamByExamReq(ExamReq examReq) {
+	public GetExamResp getExam(@RequestBody GetExamReq examReq) {
 		Exam exam = examService.findExamByNameAndRootOrgId(examReq.getName(),
 				examReq.getRootOrgId());
-		ExamResp examResp = new ExamResp();
+		GetExamResp examResp = new GetExamResp();
 		examResp.setId(exam.getId());
 		examResp.setName(exam.getName());
 		return examResp;

+ 2 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamStudentCloudServiceProvider.java

@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
 import cn.com.qmth.examcloud.commons.base.util.BeanCopierUtil;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
-import cn.com.qmth.examcloud.examwork.api.request.ExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
 import cn.com.qmth.examcloud.service.examwork.dao.ExamStudentRepo;
 import cn.com.qmth.examcloud.service.examwork.dto.ExamStudentDTO;
 import cn.com.qmth.examcloud.service.examwork.entity.ExamStudent;
@@ -35,7 +35,7 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
 	private ExamStudentRepo examStudentRepo;
 
 	@Override
-	public void saveExamStudent(ExamStudentReq examStudentReq) {
+	public void saveExamStudent(SaveExamStudentReq examStudentReq) {
 		ExamStudentDTO examStudentDto = new ExamStudentDTO();
 		examStudentDto.setExamId(examStudentReq.getExamId());
 		examStudentDto.setCourseCode(examStudentReq.getCourseCode());

+ 13 - 11
examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/ExamCloudService.java

@@ -1,29 +1,31 @@
 package cn.com.qmth.examcloud.examwork.api;
 
 import cn.com.qmth.examcloud.commons.web.cloud.api.CloudService;
-import cn.com.qmth.examcloud.examwork.api.request.ExamReq;
-import cn.com.qmth.examcloud.examwork.api.response.ExamResp;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
 
 /**
- * @author  	chenken
- * @date    	2018年5月3日 上午9:20:02
- * @company 	QMTH
+ * @author chenken
+ * @date 2018年5月3日 上午9:20:02
+ * @company QMTH
  * @description ExamService.java
  */
 public interface ExamCloudService extends CloudService {
-	
+
 	/**
 	 * 保存考试
+	 * 
 	 * @param exam
 	 */
-	public void saveExam(ExamReq exam);
-	
+	public void saveExam(SaveExamReq req);
+
 	/**
 	 * 查询考试
+	 * 
 	 * @param name
 	 * @return
 	 */
-	public ExamResp findExamByExamReq(ExamReq exam);
-	
-}
+	public GetExamResp getExam(GetExamReq req);
 
+}

+ 9 - 7
examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/ExamStudentCloudService.java

@@ -1,20 +1,22 @@
 package cn.com.qmth.examcloud.examwork.api;
 
-import cn.com.qmth.examcloud.examwork.api.request.ExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
 
 /**
  * 考生信息服务
- * @author  	chenken
- * @date    	2018年5月4日 下午2:01:15
- * @company 	QMTH
+ * 
+ * @author chenken
+ * @date 2018年5月4日 下午2:01:15
+ * @company QMTH
  * @description ExamStudentCloudService.java
  */
 public interface ExamStudentCloudService {
-	
+
 	/**
 	 * 保存考生信息、机构、课程
+	 * 
 	 * @param examStudentReq
 	 */
-	public void saveExamStudent(ExamStudentReq examStudentReq);
-	
+	public void saveExamStudent(SaveExamStudentReq req);
+
 }

+ 1 - 1
examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/request/ExamReq.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/request/GetExamReq.java

@@ -10,7 +10,7 @@ import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
  * @company 	QMTH
  * @description ExamReq.java
  */
-public class ExamReq extends BaseRequest {
+public class GetExamReq extends BaseRequest {
 
 	private static final long serialVersionUID = -5832266903859887508L;
 	/**

+ 103 - 0
examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/request/SaveExamReq.java

@@ -0,0 +1,103 @@
+package cn.com.qmth.examcloud.examwork.api.request;
+
+import java.util.Date;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+
+/**
+ * @author  	chenken
+ * @date    	2018年5月2日 下午3:44:54
+ * @company 	QMTH
+ * @description ExamReq.java
+ */
+public class SaveExamReq extends BaseRequest {
+
+	private static final long serialVersionUID = -5832266903859887508L;
+	/**
+	 * 机构ID
+	 */
+	private Long rootOrgId;
+	/**
+	 * 考试名称
+	 */
+	private String name;
+	/**
+	 * 考试类型
+	 */
+	private String examType;
+	/**
+	 * 考试开始时间
+	 */
+	private Date beginTime;
+	/**
+	 * 考试结束时间
+	 */
+	private Date endTime;
+	/**
+	 * 考试时长(分钟)
+	 */
+	private Integer duration;
+	/**
+	 * 备注
+	 */
+	private String remark;
+
+	
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getExamType() {
+		return examType;
+	}
+
+	public void setExamType(String examType) {
+		this.examType = examType;
+	}
+
+	public Date getBeginTime() {
+		return beginTime;
+	}
+
+	public void setBeginTime(Date beginTime) {
+		this.beginTime = beginTime;
+	}
+
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+
+	public Integer getDuration() {
+		return duration;
+	}
+
+	public void setDuration(Integer duration) {
+		this.duration = duration;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+	
+}
+

+ 1 - 1
examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/request/ExamStudentReq.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/request/SaveExamStudentReq.java

@@ -2,7 +2,7 @@ package cn.com.qmth.examcloud.examwork.api.request;
 
 import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
 
-public class ExamStudentReq extends BaseRequest {
+public class SaveExamStudentReq extends BaseRequest {
 	
 	private static final long serialVersionUID = -8455805881947392754L;
 	/**

+ 1 - 1
examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/response/ExamResp.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/examwork/api/response/GetExamResp.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.examwork.api.response;
 
-public class ExamResp {
+public class GetExamResp {
 
 	private Long id;