Browse Source

添加考试记录常用属性缓存

lideyin 6 years ago
parent
commit
7f47586d4b

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

@@ -1,6 +1,7 @@
 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.SysPropertyCacheBean;
 import cn.com.qmth.examcloud.web.cache.ObjectRedisCacheProcessor;
 
@@ -36,5 +37,22 @@ public class CacheHelper {
 				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");
+	}
 
+	public static void main(String[] args) {
+		ExamRecordPropertyCacheBean b = getExamRecordProperty(80505L);
+		System.out.println(b.getExamId()); 
+	}
 }

+ 29 - 0
src/main/java/cn/com/qmth/examcloud/support/cache/bean/ExamRecordPropertyCacheBean.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.support.cache.bean;
+
+import cn.com.qmth.examcloud.web.cache.RandomCacheBean;
+
+/**
+ * 考试记录相关常用属性缓存
+ * @author lideyin
+ * @date 2019年5月21日 下午4:26:19
+ * @description 可根据需求扩展属性
+ */
+public class ExamRecordPropertyCacheBean extends RandomCacheBean {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 4325869001570331457L;
+
+	//考试id
+	private Long examId;
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+}