瀏覽代碼

rename oe cache keys..

deason 2 年之前
父節點
當前提交
ac1a212c60

+ 47 - 7
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/CacheConstants.java

@@ -3,14 +3,14 @@ package cn.com.qmth.examcloud.support;
 /**
  * 缓存相关常量
  * 注:cache key 命名规则
- * $模块:关键字_关键字 示例:$OE:SESSION_123
+ * $模块:关键字:参数1_参数2  示例:$OE:XXX:123_abc
  */
 public interface CacheConstants {
 
     /* #################### 考务模块 #################### */
 
     /**
-     * 考试设置
+     * 缓存 - 考试设置信息:{examId}
      */
     String CACHE_E_EXAM = "$E:EXAM:";
 
@@ -19,17 +19,17 @@ public interface CacheConstants {
     /* #################### 题库模块 #################### */
 
     /**
-     * 调卷规则
+     * 缓存 - 调卷规则:{examId}_{courseCode}
      */
     String CACHE_Q_EXTRACT_CONFIG = "$Q:EXTRACT_CONFIG:";
 
     /**
-     * 试卷结构
+     * 缓存 - 试卷结构:{paperStructId}
      */
     String CACHE_Q_PAPER_STRUCT = "$Q:PAPER_STRUCT:";
 
     /**
-     * 随机抽卷模板
+     * 缓存 - 随机抽卷模板:{randomPaperId}
      */
     String CACHE_Q_RANDOM_PAPER = "$Q:RANDOM_PAPER:";
 
@@ -37,8 +37,48 @@ public interface CacheConstants {
     /* #################### 网考模块 #################### */
 
     /**
-     * 考试成绩统计_examId_courseId
+     * 缓存 - 网考考试会话:{studentId}
      */
-    String CACHE_OE_SCORE_STATISTIC = "$OE:SCORE_STATISTIC:%s_%s";
+    String CACHE_OE_SESSION = "$OE:SESSION:";
+
+    /**
+     * 缓存 - 考试次数控制:{examStudentId}
+     */
+    String CACHE_OE_BOSS = "$OE:BOSS:";
+
+    /**
+     * 缓存 - 网考考试记录:{examRecordDataId}
+     */
+    String CACHE_OE_RECORD = "$OE:RECORD:";
+
+    /**
+     * 缓存 - 考试心跳:{examRecordDataId}
+     */
+    String CACHE_OE_HEARTBEAT = "$OE:HEARTBEAT:";
+
+    /**
+     * 缓存 - 考试活动时间:{examRecordDataId}
+     */
+    String CACHE_OE_ACTIVE = "$OE:ACTIVE:";
+
+    /**
+     * 缓存 - 网考试卷结构:{examRecordDataId}
+     */
+    String CACHE_OE_PAPER = "$OE:PAPER:";
+
+    /**
+     * 缓存 - 网考作答:{examRecordDataId}_{order}
+     */
+    String CACHE_OE_ANSWER = "$OE:ANSWER:";
+
+    /**
+     * 缓存 - 网考文件作答:{examRecordDataId}_{order}
+     */
+    String CACHE_OE_FILE_ANSWER = "$OE:FILE_ANSWER:";
+
+    /**
+     * 缓存 - 考试成绩统计状态:{examId}_{courseId}
+     */
+    String CACHE_OE_SCORE_STATISTIC_STATUS = "$OE:SCORE_STATISTIC_STATUS:";
 
 }

+ 18 - 17
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/redis/RedisKeyBuilder.java

@@ -1,36 +1,37 @@
 package cn.com.qmth.examcloud.support.redis;
 
+import cn.com.qmth.examcloud.support.CacheConstants;
+
 /**
  * Redis key构建器接口
  *
  * @author WANGWEI
  * @date 2019年8月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
 public interface RedisKeyBuilder {
 
-	@RedisKeyDefine(value = "网考考试会话", Prefix = "OE_SESSION")
-	String examingSessionKey(Long studentId);
+    @RedisKeyDefine(value = "网考考试会话", Prefix = CacheConstants.CACHE_OE_SESSION)
+    String examingSessionKey(Long studentId);
 
-	@RedisKeyDefine(value = "考试活动时间", Prefix = "OE_ACTIVE")
-	String examingActiveTimeKey(Long examRecordDataId);
+    @RedisKeyDefine(value = "考试次数控制", Prefix = CacheConstants.CACHE_OE_BOSS)
+    String examBossKey(Long examStudentId);
 
-	@RedisKeyDefine(value = "考试心跳", Prefix = "OE_HEARTBEAT")
-	String examingHeartbeatKey(Long examRecordDataId);
+    @RedisKeyDefine(value = "网考考试记录", Prefix = CacheConstants.CACHE_OE_RECORD)
+    String examRecordDataKey(Long examRecordDataId);
 
-	@RedisKeyDefine(value = "网考考试记录", Prefix = "OE_ERD")
-	String examRecordDataKey(Long examRecordDataId);
+    @RedisKeyDefine(value = "考试心跳", Prefix = CacheConstants.CACHE_OE_HEARTBEAT)
+    String examingHeartbeatKey(Long examRecordDataId);
 
-	@RedisKeyDefine(value = "网考试卷结构", Prefix = "OE_PAPER")
-	String studentPaperKey(Long examRecordDataId);
+    @RedisKeyDefine(value = "考试活动时间", Prefix = CacheConstants.CACHE_OE_ACTIVE)
+    String examingActiveTimeKey(Long examRecordDataId);
 
-	@RedisKeyDefine(value = "网考作答", Prefix = "OE_ANSWER")
-	String studentAnswerKey(Long examRecordDataId, Integer order);
+    @RedisKeyDefine(value = "网考试卷结构", Prefix = CacheConstants.CACHE_OE_PAPER)
+    String studentPaperKey(Long examRecordDataId);
 
-	@RedisKeyDefine(value = "文件作答", Prefix = "OE_File_ANSWER")
-	String studentFileAnswerKey(Long examRecordDataId, Integer order);
+    @RedisKeyDefine(value = "网考作答", Prefix = CacheConstants.CACHE_OE_ANSWER)
+    String studentAnswerKey(Long examRecordDataId, Integer order);
 
-	@RedisKeyDefine(value = "考试控制属性", Prefix = "OE_BOSS")
-	String examBossKey(Long examStudentId);
+    @RedisKeyDefine(value = "网考文件作答", Prefix = CacheConstants.CACHE_OE_FILE_ANSWER)
+    String studentFileAnswerKey(Long examRecordDataId, Integer order);
 
 }