|
@@ -0,0 +1,85 @@
|
|
|
+package com.qmth.themis.business.cache;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+import com.qmth.themis.business.constant.SpringContextHolder;
|
|
|
+import com.qmth.themis.business.enums.BreakReasonEnum;
|
|
|
+import com.qmth.themis.business.util.RedisUtil;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 断点缓存hash值操作
|
|
|
+ *
|
|
|
+ * @Description:
|
|
|
+ * @Author: xiatian
|
|
|
+ * @Date: 2020-07-29
|
|
|
+ */
|
|
|
+public class ExamBreakCacheUtil {
|
|
|
+ private static RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
|
+
|
|
|
+ public static void setExamRecordId(Long examBreakId,Long examRecordId) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "examRecordId", examRecordId);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Long getExamRecordId(Long examBreakId) {
|
|
|
+ return (Long) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "examRecordId");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setBreakTime(Long examBreakId,Date breakTime) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "breakTime", breakTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Date getBreakTime(Long examBreakId) {
|
|
|
+ return (Date) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "breakTime");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void setBreakReason(Long examBreakId,BreakReasonEnum breakReason) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "breakReason", breakReason);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static BreakReasonEnum getBreakReason(Long examBreakId) {
|
|
|
+ return (BreakReasonEnum) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "breakReason");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setResumeReason(Long examBreakId,String resumeReason) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "resumeReason", resumeReason);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Long getResumeReason(Long examBreakId) {
|
|
|
+ return (Long) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "resumeReason");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void setPrepareTime(Long examBreakId,Date prepareTime) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "prepareTime", prepareTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Date getPrepareTime(Long examBreakId) {
|
|
|
+ return (Date) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "prepareTime");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void setStartTime(Long examBreakId,Date startTime) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "startTime", startTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Date getStartTime(Long examBreakId) {
|
|
|
+ return (Date) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "startTime");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setEntryAuthenticationResult(Long examBreakId,Boolean entryAuthenticationResult) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "entryAuthenticationResult", entryAuthenticationResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Boolean getEntryAuthenticationResult(Long examBreakId) {
|
|
|
+ return (Boolean) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "entryAuthenticationResult");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void setEntryAuthenticationId(Long examBreakId,Long entryAuthenticationId) {
|
|
|
+ redisUtil.set(RedisKeyHelper.examBreakCacheKey(examBreakId), "entryAuthenticationId", entryAuthenticationId);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Long getEntryAuthenticationId(Long examBreakId) {
|
|
|
+ return (Long) redisUtil.get(RedisKeyHelper.examBreakCacheKey(examBreakId), "entryAuthenticationId");
|
|
|
+ }
|
|
|
+}
|