|
@@ -1,6 +1,5 @@
|
|
package com.qmth.themis.business.constant;
|
|
package com.qmth.themis.business.constant;
|
|
|
|
|
|
-import com.qmth.themis.business.config.SystemConfig;
|
|
|
|
import com.qmth.themis.common.contanst.Constants;
|
|
import com.qmth.themis.common.contanst.Constants;
|
|
import com.qmth.themis.common.enums.Platform;
|
|
import com.qmth.themis.common.enums.Platform;
|
|
import com.qmth.themis.common.enums.Source;
|
|
import com.qmth.themis.common.enums.Source;
|
|
@@ -71,6 +70,7 @@ public class SystemConstant {
|
|
public static final String TXT_PREFIX = ".txt";
|
|
public static final String TXT_PREFIX = ".txt";
|
|
public static final String GLOBAL = "global";
|
|
public static final String GLOBAL = "global";
|
|
public static final String OK = "ok";
|
|
public static final String OK = "ok";
|
|
|
|
+ public static String FILES_DIR;
|
|
/**
|
|
/**
|
|
* session过期时间
|
|
* session过期时间
|
|
*/
|
|
*/
|
|
@@ -93,7 +93,7 @@ public class SystemConstant {
|
|
public static final String REDIS_LOCK_STUDENT_PREFIX = "lock:student:student_id_";
|
|
public static final String REDIS_LOCK_STUDENT_PREFIX = "lock:student:student_id_";
|
|
//计算客观分总分锁
|
|
//计算客观分总分锁
|
|
public static final String REDIS_LOCK_TOTAL_OBJECTIVE_SCORE_PREFIX = "lock:total_objective_score:record_id_";
|
|
public static final String REDIS_LOCK_TOTAL_OBJECTIVE_SCORE_PREFIX = "lock:total_objective_score:record_id_";
|
|
-
|
|
|
|
|
|
+
|
|
//考试记录数据持久化锁
|
|
//考试记录数据持久化锁
|
|
public static final String REDIS_LOCK_EXAM_RECORD_PERSISTED_PREFIX = "lock:exam_record_persisted:record_id_";
|
|
public static final String REDIS_LOCK_EXAM_RECORD_PERSISTED_PREFIX = "lock:exam_record_persisted:record_id_";
|
|
/**
|
|
/**
|
|
@@ -136,7 +136,7 @@ public class SystemConstant {
|
|
public static final String WEBSOCKET_ADMIN_ONLINE_COUNT = "websocket:admin:online:count";
|
|
public static final String WEBSOCKET_ADMIN_ONLINE_COUNT = "websocket:admin:online:count";
|
|
public static final String GET = "get";
|
|
public static final String GET = "get";
|
|
public static final long WEBSOCKET_MAX_TIME_OUT = 3 * 60 * 1000;
|
|
public static final long WEBSOCKET_MAX_TIME_OUT = 3 * 60 * 1000;
|
|
-// public static final long WEBSOCKET_MAX_TIME_OUT = 1 * 60 * 1000;
|
|
|
|
|
|
+ // public static final long WEBSOCKET_MAX_TIME_OUT = 1 * 60 * 1000;
|
|
// public static final long WEBSOCKET_MAX_TIME_OUT = 10 * 1000;
|
|
// public static final long WEBSOCKET_MAX_TIME_OUT = 10 * 1000;
|
|
public static final String ACK_MESSAGE = "ackMessage";
|
|
public static final String ACK_MESSAGE = "ackMessage";
|
|
/**
|
|
/**
|
|
@@ -240,12 +240,17 @@ public class SystemConstant {
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 初始化附件文件路径
|
|
|
|
+ */
|
|
public static void initTempFiles() {
|
|
public static void initTempFiles() {
|
|
- SystemConfig systemConfig = SpringContextHolder.getBean(SystemConfig.class);
|
|
|
|
- String tempDir = systemConfig.getProperty("sys.config.tempDataDir");
|
|
|
|
- File dir = new File(tempDir);
|
|
|
|
|
|
+ StringJoiner localPath = new StringJoiner("").add(
|
|
|
|
+ System.getProperty(SystemConstant.USER_DIR));
|
|
|
|
+ String mkdir = localPath.toString().substring(0, localPath.toString().lastIndexOf(File.separator));
|
|
|
|
+ File dir = new File(mkdir + File.separator + "themis-files");
|
|
if (!dir.exists()) {
|
|
if (!dir.exists()) {
|
|
dir.mkdirs();
|
|
dir.mkdirs();
|
|
}
|
|
}
|
|
|
|
+ FILES_DIR = dir.getPath();
|
|
}
|
|
}
|
|
}
|
|
}
|