소스 검색

考试断点记录

wangliang 4 년 전
부모
커밋
05638cd7aa

+ 14 - 18
themis-backend/src/main/java/com/qmth/themis/backend/start/StartRunning.java

@@ -1,7 +1,12 @@
 package com.qmth.themis.backend.start;
 
-import javax.annotation.Resource;
-
+import com.qmth.themis.business.constant.SpringContextHolder;
+import com.qmth.themis.business.constant.SystemConstant;
+import com.qmth.themis.mq.enums.MqGroupEnum;
+import com.qmth.themis.mq.enums.MqTagEnum;
+import com.qmth.themis.mq.enums.MqTopicEnum;
+import com.qmth.themis.mq.listener.RocketMessageConsumer;
+import com.qmth.themis.mq.templete.impl.*;
 import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -9,18 +14,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
 
-import com.qmth.themis.business.constant.SpringContextHolder;
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.mq.enums.MqGroupEnum;
-import com.qmth.themis.mq.enums.MqTagEnum;
-import com.qmth.themis.mq.enums.MqTopicEnum;
-import com.qmth.themis.mq.listener.RocketMessageConsumer;
-import com.qmth.themis.mq.templete.impl.CalculateObjectiveScoreConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.FaceVerifyConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.SessionConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.TaskConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.UserLogConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.WebsocketUnNormalConcurrentlyImpl;
+import javax.annotation.Resource;
 
 /**
  * @Description: 服务启动时初始化运行,哪个微服务模块需要则拿此模版去用
@@ -84,13 +78,15 @@ public class StartRunning implements CommandLineRunner {
          */
         //计算客观分
         rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.calculateObjectiveScoreGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.calculateObjectiveScore.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(CalculateObjectiveScoreConcurrentlyImpl.class));
-        
+
         //人脸验证保存
         rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.faceVerifySaveGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.faceVerifySave.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(FaceVerifyConcurrentlyImpl.class));
-        
+
         //活体验证保存
-        rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.livenessVerifySaveGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.livenessVerifySave.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(FaceVerifyConcurrentlyImpl.class));
-        
+        rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.livenessVerifySaveGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.livenessVerifySave.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(LivenessVerifyConcurrentlyImpl.class));
+
+        //考试断点记录
+        rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.examBreakHistoryGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.examBreakHistory.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(ExamBreakHistoryConcurrentlyImpl.class));
         SystemConstant.initTempFiles();
         log.info("服务器启动时执行 end");
     }

+ 8 - 6
themis-backend/src/main/resources/application.properties

@@ -109,14 +109,16 @@ spring.jackson.time-zone=GMT+8
 
 #\u963F\u91CC\u4E91OSS\u914D\u7F6E
 aliyun.oss.name=oss-cn-shenzhen.aliyuncs.com
-aliyun.oss.endpoint=http://${aliyun.oss.name}
-aliyun.oss.accessKeyId=LTAI4Fi8jVRYT49QBXU9x5QX
-aliyun.oss.accessKeySecret=97aBLBfkQR5mzCiQa82yWLAH57eUd8
-aliyun.oss.bucket=teachcloud-test
-aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
+#aliyun.oss.endpoint=http://${aliyun.oss.name}
+aliyun.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+aliyun.oss.accessKeyId=LTAI4FnJ2pgV6aGceYcCkeEi
+aliyun.oss.accessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
+aliyun.oss.bucket=qmth-test
+#aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
+aliyun.oss.url=http://qmth-test.oss-cn-shenzhen.aliyuncs.com
 
 #\u7CFB\u7EDF\u914D\u7F6E
-sys.config.oss=false
+sys.config.oss=true
 sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip
 sys.config.serverUpload=/Users/king/git/themis-server/
 #\u7F51\u5173accessKey\u548Csecret,\u6D4B\u8BD5\u7528

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/config/SystemConfig.java

@@ -68,7 +68,7 @@ public class SystemConfig {
      */
     public Map<String, Object> getOssEnv(Integer type) {
         Map<String, Object> mapParameter = new HashMap<>();
-        mapParameter.put(SystemConstant.END_POINT, props.getProperty("aliyun.oss.endpoint"));
+        mapParameter.put(SystemConstant.END_POINT, props.getProperty("aliyun.oss.endpoint","aliyun.oss.name"));
         mapParameter.put(SystemConstant.ACCESS_KEY_ID, props.getProperty("aliyun.oss.accessKeyId"));
         mapParameter.put(SystemConstant.ACCESS_KEY_SECRET, props.getProperty("aliyun.oss.accessKeySecret"));
         mapParameter.put(SystemConstant.BUCKET, props.getProperty("aliyun.oss.bucket"));

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -84,14 +84,14 @@ public class TaskImportCommon {
      * @return
      */
     public File getUploadFile() {
-        StringJoiner localPath = new StringJoiner("").add(
-                System.getProperty(SystemConstant.USER_DIR)).add(File.separator).add(path);
         File file = null;
         if (Objects.nonNull(this.type) && Objects.equals(this.type, SystemConstant.LOCAL)) {
+            StringJoiner localPath = new StringJoiner("").add(
+                    System.getProperty(SystemConstant.USER_DIR)).add(File.separator).add(this.path);
             file = new File(localPath.toString());
         } else {
             try {
-                file = this.ossUtil.ossDownload(this.ossEnv, localPath.toString(), localPath.toString());
+                file = this.ossUtil.ossDownload(this.ossEnv, this.path, this.path);
             } catch (IOException e) {
                 e.printStackTrace();
             }

+ 8 - 6
themis-exam/src/main/resources/application.properties

@@ -121,14 +121,16 @@ rocketmq.producer.customized-trace-topic=my-trace-topic
 
 #\u963F\u91CC\u4E91OSS\u914D\u7F6E
 aliyun.oss.name=oss-cn-shenzhen.aliyuncs.com
-aliyun.oss.endpoint=http://${aliyun.oss.name}
-aliyun.oss.accessKeyId=LTAI4Fi8jVRYT49QBXU9x5QX
-aliyun.oss.accessKeySecret=97aBLBfkQR5mzCiQa82yWLAH57eUd8
-aliyun.oss.bucket=teachcloud-test
-aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
+#aliyun.oss.endpoint=http://${aliyun.oss.name}
+aliyun.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+aliyun.oss.accessKeyId=LTAI4FnJ2pgV6aGceYcCkeEi
+aliyun.oss.accessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
+aliyun.oss.bucket=qmth-test
+#aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
+aliyun.oss.url=http://qmth-test.oss-cn-shenzhen.aliyuncs.com
 
 #\u7CFB\u7EDF\u914D\u7F6E
-sys.config.oss=false
+sys.config.oss=true
 sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip
 sys.config.serverUpload=/Users/king/git/themis-server/
 #sys.config.serverUpload=/Users/king/git/themis-service/

+ 4 - 7
themis-task/src/main/java/com/qmth/themis/task/start/StartRunning.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import javax.annotation.Resource;
 
+import com.qmth.themis.mq.templete.impl.*;
 import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -17,12 +18,6 @@ import com.qmth.themis.mq.enums.MqGroupEnum;
 import com.qmth.themis.mq.enums.MqTagEnum;
 import com.qmth.themis.mq.enums.MqTopicEnum;
 import com.qmth.themis.mq.listener.RocketMessageConsumer;
-import com.qmth.themis.mq.templete.impl.CalculateObjectiveScoreConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.FaceVerifyConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.SessionConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.TaskConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.UserLogConcurrentlyImpl;
-import com.qmth.themis.mq.templete.impl.WebsocketUnNormalConcurrentlyImpl;
 import com.qmth.themis.task.enums.QuartzTaskEnum;
 import com.qmth.themis.task.listener.QuartzOrderlyImpl;
 import com.qmth.themis.task.quartz.MqJob;
@@ -105,7 +100,7 @@ public class StartRunning implements CommandLineRunner {
         rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.faceVerifySaveGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.faceVerifySave.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(FaceVerifyConcurrentlyImpl.class));
         
         //活体验证保存
-        rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.livenessVerifySaveGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.livenessVerifySave.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(FaceVerifyConcurrentlyImpl.class));
+        rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.livenessVerifySaveGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.livenessVerifySave.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(LivenessVerifyConcurrentlyImpl.class));
         
         /**
          * quartz mq start
@@ -114,6 +109,8 @@ public class StartRunning implements CommandLineRunner {
         /**
          * quartz mq end
          */
+        //考试断点记录
+        rocketMessageConsumer.setRocketMQConsumer(nameServer, MqGroupEnum.examBreakHistoryGroup.getCode(), MqTopicEnum.themisTopic.getCode(), MqTagEnum.examBreakHistory.name(), MessageModel.CLUSTERING, SpringContextHolder.getBean(ExamBreakHistoryConcurrentlyImpl.class));
         log.info("服务器启动时执行 end");
     }
 }

+ 8 - 6
themis-task/src/main/resources/application.properties

@@ -94,18 +94,20 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.jackson.time-zone=GMT+8
 
 #\u7CFB\u7EDF\u914D\u7F6E
-sys.config.oss=false
+sys.config.oss=true
 sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip
 sys.config.serverUpload=/Users/king/git/themis-server/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 
 #\u963F\u91CC\u4E91OSS\u914D\u7F6E
 aliyun.oss.name=oss-cn-shenzhen.aliyuncs.com
-aliyun.oss.endpoint=http://${aliyun.oss.name}
-aliyun.oss.accessKeyId=LTAI4Fi8jVRYT49QBXU9x5QX
-aliyun.oss.accessKeySecret=97aBLBfkQR5mzCiQa82yWLAH57eUd8
-aliyun.oss.bucket=teachcloud-test
-aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
+#aliyun.oss.endpoint=http://${aliyun.oss.name}
+aliyun.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+aliyun.oss.accessKeyId=LTAI4FnJ2pgV6aGceYcCkeEi
+aliyun.oss.accessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
+aliyun.oss.bucket=qmth-test
+#aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
+aliyun.oss.url=http://qmth-test.oss-cn-shenzhen.aliyuncs.com
 #============================================================================
 # \u914D\u7F6EJobStore
 #============================================================================