Răsfoiți Sursa

rename cache keys.

deason 2 ani în urmă
părinte
comite
24b64bd29b

+ 2 - 1
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamControlController.java

@@ -8,6 +8,7 @@ import cn.com.qmth.examcloud.core.oe.student.bean.*;
 import cn.com.qmth.examcloud.core.oe.student.bean.client.CourseInfo;
 import cn.com.qmth.examcloud.core.oe.student.service.*;
 import cn.com.qmth.examcloud.starters.crypto.common.CryptoConstant;
+import cn.com.qmth.examcloud.support.CacheConstants;
 import cn.com.qmth.examcloud.support.Constants;
 import cn.com.qmth.examcloud.support.enums.FileAnswerAcknowledgeStatus;
 import cn.com.qmth.examcloud.support.examing.ExamFileAnswer;
@@ -477,7 +478,7 @@ public class ExamControlController extends ControllerSupport {
     @PostMapping("/switchScreen")
     public SwitchScreenCountInfo switchScreen(@RequestParam @ApiParam(value = "考试记录id") Long examRecordDataId) {
         User user = getAccessUser();
-        String sequenceLockKey = Constants.EXAM_CONTROL_LOCK_PREFIX + user.getUserId();
+        String sequenceLockKey = CacheConstants.LOCK_EXAM_CONTROL + user.getUserId();
         // 开始考试上锁,分布式锁,系统在请求结束后会,自动释放锁,无需手动解锁
         SequenceLockHelper.getLock(sequenceLockKey);
         Check.isNull(examRecordDataId, "examRecordDataId不能为空");

+ 5 - 5
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamControlServiceImpl.java

@@ -184,7 +184,7 @@ public class ExamControlServiceImpl implements ExamControlService {
         Check.isNull(examStudentId, "examStudentId不能为空");
         Check.isNull(userId, "userId不能为空");
 
-        String sequenceLockKey = Constants.EXAM_CONTROL_LOCK_PREFIX + userId;
+        String sequenceLockKey = CacheConstants.LOCK_EXAM_CONTROL + userId;
         // 开始考试上锁,分布式锁,系统在请求结束后会,自动释放锁,无需手动解锁
         SequenceLockHelper.getLock(sequenceLockKey);
 
@@ -342,7 +342,7 @@ public class ExamControlServiceImpl implements ExamControlService {
         Check.isNull(examRecordDataId, "examRecordDataId不能为空");
         Check.isNull(userId, "userId不能为空");
 
-        String sequenceLockKey = Constants.EXAM_CONTROL_LOCK_PREFIX + userId;
+        String sequenceLockKey = CacheConstants.LOCK_EXAM_CONTROL + userId;
         // 开始考试上锁,分布式锁,系统在请求结束后会,自动释放锁,无需手动解锁
         SequenceLockHelper.getLock(sequenceLockKey);
 
@@ -779,7 +779,7 @@ public class ExamControlServiceImpl implements ExamControlService {
 
     @Override
     public void manualEndExam(Long studentId, String ip, Boolean force) {
-        String sequenceLockKey = Constants.EXAM_CONTROL_LOCK_PREFIX + studentId;
+        String sequenceLockKey = CacheConstants.LOCK_EXAM_CONTROL + studentId;
         //系统在请求结束后会,自动释放锁,无需手动解锁
         SequenceLockHelper.getLock(sequenceLockKey);
 
@@ -801,7 +801,7 @@ public class ExamControlServiceImpl implements ExamControlService {
     @Override
     public void handInExam(Long examRecordDataId, HandInExamType handInExamType, String ip, Boolean force) {
         // 此锁是为了避免自动交卷服务与断点续考交卷或活检失败交卷,同一时刻交卷争抢资源导致死锁
-        String sequenceLockKey = Constants.HAND_IN_EXAM_LOCK_PREFIX + examRecordDataId;
+        String sequenceLockKey = CacheConstants.LOCK_HAND_IN_EXAM + examRecordDataId;
         // 系统在请求结束后会,自动释放锁,无需手动解锁
         SequenceLockHelper.getLock(sequenceLockKey);
 
@@ -1644,7 +1644,7 @@ public class ExamControlServiceImpl implements ExamControlService {
 
     @Override
     public ExamProcessResultInfo checkExamInProgress2(Long studentId, String ip) {
-        String sequenceLockKey = Constants.EXAM_CONTROL_LOCK_PREFIX + studentId;
+        String sequenceLockKey = CacheConstants.LOCK_EXAM_CONTROL + studentId;
         // 系统在请求结束后会,自动释放锁,无需手动解锁
         SequenceLockHelper.getLock(sequenceLockKey);