|
@@ -1,11 +1,6 @@
|
|
package cn.com.qmth.examcloud.support.cache;
|
|
package cn.com.qmth.examcloud.support.cache;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.AppCacheBean;
|
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.ExamRecordPropertyCacheBean;
|
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.PrivilegeRolesCacheBean;
|
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.RootOrgPrivilegesCacheBean;
|
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.SmsAssemblyCacheBean;
|
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.*;
|
|
import cn.com.qmth.examcloud.web.cache.ObjectRedisCacheProcessor;
|
|
import cn.com.qmth.examcloud.web.cache.ObjectRedisCacheProcessor;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -17,82 +12,124 @@ import cn.com.qmth.examcloud.web.cache.ObjectRedisCacheProcessor;
|
|
*/
|
|
*/
|
|
public class CacheHelper {
|
|
public class CacheHelper {
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取APP
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param appId
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public static AppCacheBean getApp(Long appId) {
|
|
|
|
- return ObjectRedisCacheProcessor.get("$_APP:", new Object[]{appId}, AppCacheBean.class);
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取APP
|
|
|
|
+ *
|
|
|
|
+ * @param appId
|
|
|
|
+ * @return
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ public static AppCacheBean getApp(Long appId) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("$_APP:", new Object[]{appId}, AppCacheBean.class);
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取系统属性<br>
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param propKey
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public static SysPropertyCacheBean getSysProperty(String propKey) {
|
|
|
|
- return ObjectRedisCacheProcessor.get("$_SYS_PROP:", new Object[]{propKey},
|
|
|
|
- SysPropertyCacheBean.class, "EC-CORE-BASIC",
|
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.SystemPropertyCache");
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取系统属性<br>
|
|
|
|
+ *
|
|
|
|
+ * @param propKey
|
|
|
|
+ * @return
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ public static SysPropertyCacheBean getSysProperty(String propKey) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("$_SYS_PROP:", new Object[]{propKey},
|
|
|
|
+ SysPropertyCacheBean.class, "EC-CORE-BASIC",
|
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.SystemPropertyCache");
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 根据考试记录id获取考试信息<br>
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param propKey
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public static ExamRecordPropertyCacheBean getExamRecordProperty(Long examRecordDataId) {
|
|
|
|
- return ObjectRedisCacheProcessor.get("OE_EXAM_RECORD_PROP:", new Object[]{examRecordDataId},
|
|
|
|
- ExamRecordPropertyCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
|
- "cn.com.qmth.examcloud.core.oe.common.cache.ExamRecordPropertyCache");
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据考试记录id获取考试信息<br>
|
|
|
|
+ *
|
|
|
|
+ * @param propKey
|
|
|
|
+ * @return
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ public static ExamRecordPropertyCacheBean getExamRecordProperty(Long examRecordDataId) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("OE_EXAM_RECORD_PROP:", new Object[]{examRecordDataId},
|
|
|
|
+ ExamRecordPropertyCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
|
+ "cn.com.qmth.examcloud.core.oe.common.cache.ExamRecordPropertyCache");
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 根据短信配置代码获取短信配置详情
|
|
|
|
- *
|
|
|
|
- * @param smsAssemblyCode
|
|
|
|
- * 短信配置代码
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public static SmsAssemblyCacheBean getSmsAssembly(String smsAssemblyCode) {
|
|
|
|
- return ObjectRedisCacheProcessor.get("SMS_ASSEMBLY_PROP:", new Object[]{smsAssemblyCode},
|
|
|
|
- SmsAssemblyCacheBean.class, "EC-CORE-BASIC",
|
|
|
|
- "cn.com.qmth.examcloud.core.basic.dao.cache.SmsAssemblyCache");
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据短信配置代码获取短信配置详情
|
|
|
|
+ *
|
|
|
|
+ * @param smsAssemblyCode 短信配置代码
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public static SmsAssemblyCacheBean getSmsAssembly(String smsAssemblyCode) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("SMS_ASSEMBLY_PROP:", new Object[]{smsAssemblyCode},
|
|
|
|
+ SmsAssemblyCacheBean.class, "EC-CORE-BASIC",
|
|
|
|
+ "cn.com.qmth.examcloud.core.basic.dao.cache.SmsAssemblyCache");
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取权限关联的角色集合
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param rootOrgId
|
|
|
|
- * @param privilegeCode
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public static PrivilegeRolesCacheBean getPrivilegeRoles(Long rootOrgId, String privilegeCode) {
|
|
|
|
- return ObjectRedisCacheProcessor.get("$_PRIV_ROLES:",
|
|
|
|
- new Object[]{rootOrgId, privilegeCode}, PrivilegeRolesCacheBean.class,
|
|
|
|
- "EC-CORE-BASIC",
|
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.PrrivilegeRolesCache");
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取权限关联的角色集合
|
|
|
|
+ *
|
|
|
|
+ * @param rootOrgId
|
|
|
|
+ * @param privilegeCode
|
|
|
|
+ * @return
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ public static PrivilegeRolesCacheBean getPrivilegeRoles(Long rootOrgId, String privilegeCode) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("$_PRIV_ROLES:",
|
|
|
|
+ new Object[]{rootOrgId, privilegeCode}, PrivilegeRolesCacheBean.class,
|
|
|
|
+ "EC-CORE-BASIC",
|
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.PrrivilegeRolesCache");
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取顶级机构关联的角色集合
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param rootOrgId
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public static RootOrgPrivilegesCacheBean getRootOrgPrivileges(Long rootOrgId) {
|
|
|
|
- return ObjectRedisCacheProcessor.get("$__ROOT_ORG_PRIVS:", new Object[]{rootOrgId},
|
|
|
|
- PrivilegeRolesCacheBean.class, "EC-CORE-BASIC",
|
|
|
|
- "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgPrrivilegesCache");
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取顶级机构关联的角色集合
|
|
|
|
+ *
|
|
|
|
+ * @param rootOrgId
|
|
|
|
+ * @return
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ public static RootOrgPrivilegesCacheBean getRootOrgPrivileges(Long rootOrgId) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("$__ROOT_ORG_PRIVS:", new Object[]{rootOrgId},
|
|
|
|
+ PrivilegeRolesCacheBean.class, "EC-CORE-BASIC",
|
|
|
|
+ "cn.com.qmth.examcloud.core.basic.service.cache.RootOrgPrrivilegesCache");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @description 获取原始试卷
|
|
|
|
+ * @param examId 考试id
|
|
|
|
+ * @param courseCode 课程代码
|
|
|
|
+ * @param paperType 试卷类型
|
|
|
|
+ * @date 2019/7/30 16:00
|
|
|
|
+ * @author lideyin
|
|
|
|
+ * @return cn.com.qmth.examcloud.support.cache.bean.BasePaperCacheBean
|
|
|
|
+ */
|
|
|
|
+ public static BasePaperCacheBean getBasePaper(Long examId,String courseCode,String paperType) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("OE_BASE_PAPER_PROP:", new Object[]{examId,courseCode,paperType},
|
|
|
|
+ BasePaperCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
|
+ "cn.com.qmth.examcloud.core.oe.common.cache.BasePaperCache");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @description 获取课程信息
|
|
|
|
+ * @param courseId 课程id
|
|
|
|
+ * @param rootOrgId 学校id
|
|
|
|
+ * @date 2019/7/30 15:58
|
|
|
|
+ * @author lideyin
|
|
|
|
+ * @return cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean
|
|
|
|
+ */
|
|
|
|
+ public static CourseCacheBean getCourse(Long courseId,Long rootOrgId) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("OE_COURSE_PROP:", new Object[]{courseId,rootOrgId},
|
|
|
|
+ CourseCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
|
+ "cn.com.qmth.examcloud.core.oe.common.cache.CourseCache");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @description 获取考试信息
|
|
|
|
+ * @param examId 考试id
|
|
|
|
+ * @param orgId 学习中心id
|
|
|
|
+ * @date 2019/7/30 15:51
|
|
|
|
+ * @author lideyin
|
|
|
|
+ * @return cn.com.qmth.examcloud.support.cache.bean.ExamCacheBean
|
|
|
|
+ */
|
|
|
|
+ public static ExamCacheBean getExam(Long examId, Long orgId) {
|
|
|
|
+ return ObjectRedisCacheProcessor.get("OE_EXAM_PROP:", new Object[]{examId, orgId},
|
|
|
|
+ ExamCacheBean.class, "EC-CORE-OE-STUDENT",
|
|
|
|
+ "cn.com.qmth.examcloud.core.oe.common.cache.ExamCache");
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|