Przeglądaj źródła

提供阅卷后端服务接口:MarkerCloudService 和 StudentPaperCloudService

nikang 6 lat temu
rodzic
commit
83348b1d14

+ 4 - 0
examcloud-core-marking-api-client/src/main/java/cn/com/qmth/examcloud/marking/api/client/BasicCloudClientSupport.java

@@ -10,4 +10,8 @@ import cn.com.qmth.examcloud.commons.web.support.CloudClientSupport;
  * @Version 2.0
  */
 public abstract class BasicCloudClientSupport extends CloudClientSupport {
+    @Override
+    public String getUrlPrefix() {
+        return "http://EC-CORE-MARKING/api/core/marking/";
+    }
 }

+ 40 - 0
examcloud-core-marking-api-client/src/main/java/cn/com/qmth/examcloud/marking/api/client/MarkerCloudServiceClient.java

@@ -0,0 +1,40 @@
+package cn.com.qmth.examcloud.marking.api.client;
+
+import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
+import cn.com.qmth.examcloud.marking.api.MarkerCloudService;
+import cn.com.qmth.examcloud.marking.api.request.GetMarkerReq;
+import cn.com.qmth.examcloud.marking.api.response.GetMarkerResp;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @ClassName MarkerCloudServiceClient
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 15:47
+ * @Version 3.0
+ */
+@Service
+public class MarkerCloudServiceClient extends BasicCloudClientSupport implements MarkerCloudService {
+    @Autowired
+    RestTemplate restTemplate;
+
+    @Autowired
+    private RedisClient redisClient;
+
+    @Override
+    protected RedisClient getRedisClient() {
+        return redisClient;
+    }
+
+    @Override
+    protected RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    @Override
+    public GetMarkerResp getMarker(GetMarkerReq getMarkerReq) {
+        return post("marker/getAll",getMarkerReq,GetMarkerResp.class);
+    }
+}

+ 41 - 0
examcloud-core-marking-api-client/src/main/java/cn/com/qmth/examcloud/marking/api/client/StudentPaperCloudServiceClient.java

@@ -0,0 +1,41 @@
+package cn.com.qmth.examcloud.marking.api.client;
+
+import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
+import cn.com.qmth.examcloud.marking.api.StudentPaperCloudService;
+import cn.com.qmth.examcloud.marking.api.request.GetStudentPaperReq;
+import cn.com.qmth.examcloud.marking.api.response.GetStudentPaperResp;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @ClassName StudentPaperCloudServiceClient
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 18:25
+ * @Version 3.0
+ */
+public class StudentPaperCloudServiceClient extends BasicCloudClientSupport implements StudentPaperCloudService {
+
+    private static final long serialVersionUID = -8711706052966399720L;
+
+    @Autowired
+    RestTemplate restTemplate;
+
+    @Autowired
+    private RedisClient redisClient;
+
+    @Override
+    protected RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    @Override
+    protected RedisClient getRedisClient() {
+        return redisClient;
+    }
+
+    @Override
+    public GetStudentPaperResp getStudentPaper(GetStudentPaperReq req) {
+        return post("",req,GetStudentPaperResp.class);
+    }
+}

+ 17 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/MarkerCloudService.java

@@ -0,0 +1,17 @@
+package cn.com.qmth.examcloud.marking.api;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.CloudService;
+import cn.com.qmth.examcloud.marking.api.request.GetMarkerReq;
+import cn.com.qmth.examcloud.marking.api.response.GetMarkerResp;
+
+/**
+ * @ClassName MarkerCloudService
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 11:44
+ * @Version 3.0
+ */
+public interface MarkerCloudService extends CloudService {
+    //获取 获取评卷员
+    GetMarkerResp getMarker(GetMarkerReq getMarkerReq);
+}

+ 19 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/StudentPaperCloudService.java

@@ -0,0 +1,19 @@
+package cn.com.qmth.examcloud.marking.api;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.CloudService;
+import cn.com.qmth.examcloud.marking.api.request.GetStudentPaperReq;
+import cn.com.qmth.examcloud.marking.api.response.GetStudentPaperResp;
+
+/**
+ * @ClassName StudentPaperCloudService
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 18:19
+ * @Version 3.0
+ */
+public interface StudentPaperCloudService extends CloudService {
+    /**
+     * 获取下一张待评试卷(或获取指定答卷)
+     */
+    GetStudentPaperResp getStudentPaper(GetStudentPaperReq req);
+}

+ 117 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/bean/MarkerBean.java

@@ -0,0 +1,117 @@
+package cn.com.qmth.examcloud.marking.api.bean;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+
+
+/**
+ * @ClassName Marker
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 11:48
+ * @Version 3.0
+ */
+public class MarkerBean implements JsonSerializable {
+    private static final long serialVersionUID = -4318040324070584283L;
+    private Long userId;
+    private String userName;
+    private String userLoginName;
+    private Long workId;
+    private Long markedCount;
+    private Long courseCount;
+    private Long finishedCount;
+    private double maxScore;
+    private double minScore;
+    private double avgScore;
+    private double stdDev;
+
+    public MarkerBean() {
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getWorkId() {
+        return workId;
+    }
+
+    public void setWorkId(Long workId) {
+        this.workId = workId;
+    }
+
+    public Long getMarkedCount() {
+        return markedCount;
+    }
+
+    public void setMarkedCount(Long markedCount) {
+        this.markedCount = markedCount;
+    }
+
+    public Long getCourseCount() {
+        return courseCount;
+    }
+
+    public void setCourseCount(Long courseCount) {
+        this.courseCount = courseCount;
+    }
+
+    public Long getFinishedCount() {
+        return finishedCount;
+    }
+
+    public void setFinishedCount(Long finishedCount) {
+        this.finishedCount = finishedCount;
+    }
+
+    public double getMaxScore() {
+        return maxScore;
+    }
+
+    public void setMaxScore(double maxScore) {
+        this.maxScore = maxScore;
+    }
+
+    public double getMinScore() {
+        return minScore;
+    }
+
+    public void setMinScore(double minScore) {
+        this.minScore = minScore;
+    }
+
+    public double getAvgScore() {
+        return avgScore;
+    }
+
+    public void setAvgScore(double avgScore) {
+        this.avgScore = avgScore;
+    }
+
+    public double getStdDev() {
+        return stdDev;
+    }
+
+    public void setStdDev(double stdDev) {
+        this.stdDev = stdDev;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getUserLoginName() {
+        return userLoginName;
+    }
+
+    public void setUserLoginName(String userLoginName) {
+        this.userLoginName = userLoginName;
+    }
+}

+ 152 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/bean/StudentPaperBean.java

@@ -0,0 +1,152 @@
+package cn.com.qmth.examcloud.marking.api.bean;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+
+/**
+ * @ClassName StudentPaperBean
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 18:14
+ * @Version 3.0
+ */
+public class StudentPaperBean implements JsonSerializable {
+    private static final long serialVersionUID = 4537371984439448611L;
+
+    private long id;
+
+    private String paperId;
+
+    private String studentId;
+
+    private Long workId;
+
+    private String studentCode;
+
+    private String studentName;
+
+    private String courseCode;
+
+    private String courseName;
+
+    private String orgCode;
+
+    private String identityNumber;
+
+    private String specialtyName;
+
+    private String specialtyCode;
+
+    public StudentPaperBean() {
+    }
+    public StudentPaperBean(Long workId, String paperId, String studentId,
+                        String studentCode,String studentName,String courseCode,String courseName,
+                        String orgCode,String identityNumber, String specialtyName, String specialtyCode) {
+        this.paperId = paperId;
+        this.studentId = studentId;
+        this.workId = workId;
+        this.studentCode = studentCode;
+        this.studentName = studentName;
+        this.courseCode = courseCode;
+        this.courseName = courseName;
+        this.orgCode = orgCode;
+        this.identityNumber = identityNumber;
+        this.specialtyCode = specialtyCode;
+        this.specialtyName = specialtyName;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(String paperId) {
+        this.paperId = paperId;
+    }
+
+    public String getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(String studentId) {
+        this.studentId = studentId;
+    }
+
+    public Long getWorkId() {
+        return workId;
+    }
+
+    public void setWorkId(Long workId) {
+        this.workId = workId;
+    }
+
+    public String getStudentCode() {
+        return studentCode;
+    }
+
+    public void setStudentCode(String studentCode) {
+        this.studentCode = studentCode;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getOrgCode() {
+        return orgCode;
+    }
+
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
+
+    public String getIdentityNumber() {
+        return identityNumber;
+    }
+
+    public void setIdentityNumber(String identityNumber) {
+        this.identityNumber = identityNumber;
+    }
+
+    public String getSpecialtyName() {
+        return specialtyName;
+    }
+
+    public void setSpecialtyName(String specialtyName) {
+        this.specialtyName = specialtyName;
+    }
+
+    public String getSpecialtyCode() {
+        return specialtyCode;
+    }
+
+    public void setSpecialtyCode(String specialtyCode) {
+        this.specialtyCode = specialtyCode;
+    }
+}

+ 26 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/request/GetMarkerReq.java

@@ -0,0 +1,26 @@
+package cn.com.qmth.examcloud.marking.api.request;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+
+/**
+ * @ClassName GetMarkerReq
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 14:49
+ * @Version 3.0
+ */
+public class GetMarkerReq extends BaseRequest {
+    private static final long serialVersionUID = 3317091136678710156L;
+    private long workId;
+
+    public long getWorkId() {
+        return workId;
+    }
+
+    public void setWorkId(long workId) {
+        this.workId = workId;
+    }
+
+    public GetMarkerReq() {
+    }
+}

+ 25 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/request/GetStudentPaperReq.java

@@ -0,0 +1,25 @@
+package cn.com.qmth.examcloud.marking.api.request;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+
+/**
+ * @ClassName StudentPaperReq
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 18:16
+ * @Version 3.0
+ */
+public class GetStudentPaperReq extends BaseRequest {
+
+    private static final long serialVersionUID = -6892765618820908426L;
+
+    private long markTaskId;
+
+    public long getMarkTaskId() {
+        return markTaskId;
+    }
+
+    public void setMarkTaskId(long markTaskId) {
+        this.markTaskId = markTaskId;
+    }
+}

+ 31 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/response/GetMarkerResp.java

@@ -0,0 +1,31 @@
+package cn.com.qmth.examcloud.marking.api.response;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
+import cn.com.qmth.examcloud.marking.api.bean.MarkerBean;
+
+import java.util.List;
+
+/**
+ * @ClassName GetMarkerResp
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 11:45
+ * @Version 3.0
+ */
+public class GetMarkerResp extends BaseResponse {
+    private static final long serialVersionUID = 6101833806539265492L;
+
+    private List<MarkerBean> markerList;
+
+    public List<MarkerBean> getMarkerList() {
+        return markerList;
+    }
+
+    public void setMarkerList(List<MarkerBean> markerList) {
+        this.markerList = markerList;
+    }
+
+    public GetMarkerResp() {
+
+    }
+}

+ 24 - 0
examcloud-core-marking-api/src/main/java/cn/com/qmth/examcloud/marking/api/response/GetStudentPaperResp.java

@@ -0,0 +1,24 @@
+package cn.com.qmth.examcloud.marking.api.response;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
+import cn.com.qmth.examcloud.marking.api.bean.StudentPaperBean;
+
+/**
+ * @ClassName StudentPaperResq
+ * @Description TODO
+ * @Author nikang
+ * @Date 2018/9/20 18:17
+ * @Version 3.0
+ */
+public class GetStudentPaperResp extends BaseResponse {
+    private static final long serialVersionUID = 3983154999704945517L;
+    private StudentPaperBean studentPaperBean;
+
+    public StudentPaperBean getStudentPaperBean() {
+        return studentPaperBean;
+    }
+
+    public void setStudentPaperBean(StudentPaperBean studentPaperBean) {
+        this.studentPaperBean = studentPaperBean;
+    }
+}