|
@@ -2,6 +2,7 @@ package com.qmth.themis.exam.websocketTemplete;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
+import com.qmth.themis.business.dto.WebsocketDto;
|
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
@@ -40,7 +41,7 @@ public class WebSocketOeMessageTemplete {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public Result clientPaperDownload(String body) {
|
|
|
+ public WebsocketDto clientPaperDownload(String body) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
log.info("clientPaperDownload jsonObject:{}", jsonObject.toJSONString());
|
|
|
if (Objects.isNull(jsonObject.get("recordId")) || Objects.equals(jsonObject.get("recordId"), "")) {
|
|
@@ -54,7 +55,7 @@ public class WebSocketOeMessageTemplete {
|
|
|
tOeExamRecord.setPaperDownload(0);
|
|
|
tOeExamRecordService.updateById(tOeExamRecord);
|
|
|
//todo 更新redis考试记录缓存
|
|
|
- return ResultUtil.ok(JacksonUtil.parseJson(SystemConstant.SUCCESS));
|
|
|
+ return new WebsocketDto(SystemConstant.SUCCESS);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -64,7 +65,7 @@ public class WebSocketOeMessageTemplete {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public Result syncStatus(String body) {
|
|
|
+ public WebsocketDto syncStatus(String body) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
log.info("syncStatus jsonObject:{}", jsonObject.toJSONString());
|
|
|
if (Objects.isNull(jsonObject.get("recordId")) || Objects.equals(jsonObject.get("recordId"), "")) {
|
|
@@ -94,10 +95,11 @@ public class WebSocketOeMessageTemplete {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public Result syncAck() {
|
|
|
+ public WebsocketDto syncAck() {
|
|
|
Map map = new HashMap<>();
|
|
|
map.put(SystemConstant.ACK_MESSAGE, System.currentTimeMillis());
|
|
|
- return ResultUtil.ok(map);
|
|
|
+ WebsocketDto websocketDto = new WebsocketDto(this.getClass().getEnclosingMethod().getName(), map);
|
|
|
+ return websocketDto;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -106,7 +108,7 @@ public class WebSocketOeMessageTemplete {
|
|
|
* @param body
|
|
|
* @return
|
|
|
*/
|
|
|
- public Result invigilateLivenessVerify(String body) {
|
|
|
+ public WebsocketDto invigilateLivenessVerify(String body) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -116,7 +118,7 @@ public class WebSocketOeMessageTemplete {
|
|
|
* @param body
|
|
|
* @return
|
|
|
*/
|
|
|
- public Result invigilateNotice(String body) {
|
|
|
+ public WebsocketDto invigilateNotice(String body) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -125,10 +127,11 @@ public class WebSocketOeMessageTemplete {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public Result invigilateNoticeAck() {
|
|
|
+ public WebsocketDto invigilateNoticeAck() {
|
|
|
Map map = new HashMap<>();
|
|
|
map.put(SystemConstant.ACK_MESSAGE, System.currentTimeMillis());
|
|
|
- return ResultUtil.ok(map);
|
|
|
+ WebsocketDto websocketDto = new WebsocketDto(this.getClass().getEnclosingMethod().getName(), map);
|
|
|
+ return websocketDto;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -137,7 +140,7 @@ public class WebSocketOeMessageTemplete {
|
|
|
* @param body
|
|
|
* @return
|
|
|
*/
|
|
|
- public Result invigilateStopExam(String body) {
|
|
|
+ public WebsocketDto invigilateStopExam(String body) {
|
|
|
return null;
|
|
|
}
|
|
|
}
|