浏览代码

rename cache keys.

deason 2 年之前
父节点
当前提交
0734b53c76

+ 25 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/CacheConstants.java

@@ -14,6 +14,11 @@ public interface CacheConstants {
      */
     String CACHE_B_APP = "$B:APP:";
 
+    /**
+     * 缓存 - 第三方接入信息:{rootOrgId}_{appId}
+     */
+    String CACHE_B_THIRD_PARTY_ACCESS = "$B:THIRD_PARTY_ACCESS:";
+
     /**
      * 缓存 - 机构拥有的权限信息:{rootOrgId}
      */
@@ -39,6 +44,21 @@ public interface CacheConstants {
      */
     String CACHE_B_SMS_PROP = "$B:SMS_PROP:";
 
+    /**
+     * 缓存 - 顶级机构信息:{domain}
+     */
+    String CACHE_B_ROOT_ORG = "$B:ROOT_ORG:";
+
+    /**
+     * 缓存 - 机构信息:{orgId}
+     */
+    String CACHE_B_ORG = "$B:ORG:";
+
+    /**
+     * 缓存 - 机构属性信息:{orgId}_{key}
+     */
+    String CACHE_B_ORG_PROP = "$B:ORG_PROP:";
+
     /**
      * 缓存 - 课程信息:{courseId}
      */
@@ -173,6 +193,11 @@ public interface CacheConstants {
      */
     String CACHE_OE_FILE_ANSWER = "$OE:FILE_ANSWER:";
 
+    /**
+     * 缓存 - 网考考生信息:{examStudentId}
+     */
+    String CACHE_OE_EXAM_STUDENT = "$OE:EXAM_STUDENT:";
+
     /**
      * 缓存 - 考试成绩统计状态:{examId}_{courseId}
      */

+ 5 - 5
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/cache/CacheHelper.java

@@ -270,7 +270,7 @@ public class CacheHelper implements CacheConstants {
      * @author WANGWEI
      */
     public static OrgCacheBean getOrg(Long orgId) {
-        return ObjectRedisCacheProcessor.get("B_ORG:", new Object[]{orgId}, OrgCacheBean.class,
+        return ObjectRedisCacheProcessor.get(CACHE_B_ORG, new Object[]{orgId}, OrgCacheBean.class,
                 "EC-CORE-BASIC", "cn.com.qmth.examcloud.core.basic.service.cache.OrgCache");
     }
 
@@ -282,7 +282,7 @@ public class CacheHelper implements CacheConstants {
      * @author WANGWEI
      */
     public static RootOrgCacheBean getRootOrg(String domain) {
-        return ObjectRedisCacheProcessor.get("B_ROOT_ORG:", new Object[]{domain},
+        return ObjectRedisCacheProcessor.get(CACHE_B_ROOT_ORG, new Object[]{domain},
                 RootOrgCacheBean.class, "EC-CORE-BASIC",
                 "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgCache");
     }
@@ -296,7 +296,7 @@ public class CacheHelper implements CacheConstants {
      * @author WANGWEI
      */
     public static OrgPropertyCacheBean getOrgProperty(Long orgId, String key) {
-        return ObjectRedisCacheProcessor.get("B_ORG_PROP:", new Object[]{orgId, key},
+        return ObjectRedisCacheProcessor.get(CACHE_B_ORG_PROP, new Object[]{orgId, key},
                 OrgPropertyCacheBean.class, "EC-CORE-BASIC",
                 "cn.com.qmth.examcloud.core.basic.service.cache.OrgPropertyCache");
     }
@@ -310,7 +310,7 @@ public class CacheHelper implements CacheConstants {
      * @author WANGWEI
      */
     public static ThirdPartyAccessCacheBean getThirdPartyAccess(Long rootOrgId, String appId) {
-        return ObjectRedisCacheProcessor.get("B_THIRD_PARTY_ACCESS:",
+        return ObjectRedisCacheProcessor.get(CACHE_B_THIRD_PARTY_ACCESS,
                 new Object[]{rootOrgId, appId}, ThirdPartyAccessCacheBean.class, "EC-CORE-BASIC",
                 "cn.com.qmth.examcloud.core.basic.service.cache.ThirdPartyAccessCache");
     }
@@ -323,7 +323,7 @@ public class CacheHelper implements CacheConstants {
      * @author WANGWEI
      */
     public static ExamStudentCacheBean getExamStudent(Long examStudentId) {
-        return ObjectRedisCacheProcessor.get("OE_ES:", new Object[]{examStudentId},
+        return ObjectRedisCacheProcessor.get(CACHE_OE_EXAM_STUDENT, new Object[]{examStudentId},
                 ExamStudentCacheBean.class, "EC-CORE-OE-ADMIN",
                 "cn.com.qmth.examcloud.core.oe.admin.service.cache.ExamStudentCache");
     }