Explorar o código

Merge branch 'master' of http://git.qmth.com.cn/themis/backend-service

luoshi %!s(int64=4) %!d(string=hai) anos
pai
achega
f15f9f2331

+ 1 - 1
themis-backend/src/main/resources/application.properties

@@ -120,7 +120,7 @@ aliyun.oss.privateEndpoint=http://${aliyun.oss.privateName}
 aliyun.oss.privateAccessKeyId=LTAI4FnJ2pgV6aGceYcCkeEi
 aliyun.oss.privateAccessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
 aliyun.oss.privateBucket=qmth-test
-aliyun.oss.privateUrl=http://${aliyun.oss.privateBucket}.${aliyun.oss.privateName}
+aliyun.oss.privateUrl=http://static-test.qmth.com.cn
 
 #\u817E\u8BAF\u4E91\u914D\u7F6E
 tencentyun.sdk.appId=1400411036

+ 6 - 6
themis-business/src/main/java/com/qmth/themis/business/service/impl/TBAttachmentServiceImpl.java

@@ -60,7 +60,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
     @Override
     @Transactional
     public TBAttachment saveAttachment(MultipartFile file, String md5, String path, Map<String, Object> map,
-            UploadFileEnum type, Long orgId, Long userId) throws IOException {
+                                       UploadFileEnum type, Long orgId, Long userId) throws IOException {
         log.info("ossMap:{}", JacksonUtil.parseJson(map));
         TBAttachment tbAttachment = null;
         try {
@@ -118,10 +118,10 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
                 throw new BusinessException(ExceptionResultEnum.ATTACHMENT_TYPE_IS_NULL);
             } else if (Objects.equals(uploadType, UploadFileEnum.base_photo.name())) {
                 stringJoiner.add(uploadType).add(File.separator).add(String.valueOf(orgId));
-            } else {
-                stringJoiner.add(uploadType);
+            } else if (!Objects.equals(uploadType, UploadFileEnum.file.name())) {
+                stringJoiner.add(uploadType).add(File.separator);
             }
-            stringJoiner.add(File.separator).add(String.valueOf(nowTime.getYear())).add(File.separator)
+            stringJoiner.add(String.valueOf(nowTime.getYear())).add(File.separator)
                     .add(String.valueOf(nowTime.getMonthValue())).add(File.separator)
                     .add(String.valueOf(nowTime.getDayOfMonth()));
             if (oss) {//上传至oss
@@ -165,7 +165,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
     @Override
     @Transactional
     public TBAttachment saveAttachment(File file, String md5, String path, Map<String, Object> map, UploadFileEnum type,
-            Long orgId, Long userId) throws IOException {
+                                       Long orgId, Long userId) throws IOException {
         log.info("ossMap:{}", JacksonUtil.parseJson(map));
         TBAttachment tbAttachment = null;
         try {
@@ -255,7 +255,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
 
     @Override
     public TBAttachment saveAttachment(String path, Map<String, Object> map, UploadFileEnum type, Long orgId,
-            Long userId) throws IOException {
+                                       Long userId) throws IOException {
         return null;
     }
 

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskExamStudentExportTemplete.java

@@ -57,8 +57,7 @@ public class TaskExamStudentExportTemplete implements TaskExportTemplete {
                 stringJoiner.add(SystemConstant.FILES_DIR).add(File.separator);
             }
             LocalDateTime nowTime = LocalDateTime.now();
-            String uploadType = String.valueOf(taskExportCommon.getOssEnv().get(SystemConstant.UPLOAD_TYPE));
-            stringJoiner.add(uploadType).add(File.separator).add(String.valueOf(nowTime.getYear()))
+            stringJoiner.add(String.valueOf(nowTime.getYear()))
                     .add(File.separator).add(String.valueOf(nowTime.getMonthValue()))
                     .add(File.separator).add(String.valueOf(nowTime.getDayOfMonth()));
             mkdir = new File(stringJoiner.toString());

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskMarkResultSimpleExportTemplete.java

@@ -103,8 +103,7 @@ public class TaskMarkResultSimpleExportTemplete implements TaskExportTemplete {
                 stringJoiner.add(SystemConstant.FILES_DIR).add(File.separator);
             }
             LocalDateTime nowTime = LocalDateTime.now();
-            String uploadType = String.valueOf(taskExportCommon.getOssEnv().get(SystemConstant.UPLOAD_TYPE));
-            stringJoiner.add(uploadType).add(File.separator).add(String.valueOf(nowTime.getYear()))
+            stringJoiner.add(String.valueOf(nowTime.getYear()))
                     .add(File.separator).add(String.valueOf(nowTime.getMonthValue()))
                     .add(File.separator).add(String.valueOf(nowTime.getDayOfMonth()));
             mkdir = new File(stringJoiner.toString());

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskMarkResultStandardExportTemplete.java

@@ -189,8 +189,7 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
                 stringJoiner.add(SystemConstant.FILES_DIR).add(File.separator);
             }
             LocalDateTime nowTime = LocalDateTime.now();
-            String uploadType = String.valueOf(taskExportCommon.getOssEnv().get(SystemConstant.UPLOAD_TYPE));
-            stringJoiner.add(uploadType).add(File.separator).add(String.valueOf(nowTime.getYear()))
+            stringJoiner.add(String.valueOf(nowTime.getYear()))
                     .add(File.separator).add(String.valueOf(nowTime.getMonthValue()))
                     .add(File.separator).add(String.valueOf(nowTime.getDayOfMonth()));
             mkdir = new File(stringJoiner.toString());

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskRoomCodeExportTemplete.java

@@ -72,8 +72,7 @@ public class TaskRoomCodeExportTemplete implements TaskExportTemplete {
                 stringJoiner.add(SystemConstant.FILES_DIR).add(File.separator);
             }
             LocalDateTime nowTime = LocalDateTime.now();
-            String uploadType = String.valueOf(taskExportCommon.getOssEnv().get(SystemConstant.UPLOAD_TYPE));
-            stringJoiner.add(uploadType).add(File.separator).add(String.valueOf(nowTime.getYear()))
+            stringJoiner.add(String.valueOf(nowTime.getYear()))
                     .add(File.separator).add(String.valueOf(nowTime.getMonthValue()))
                     .add(File.separator).add(String.valueOf(nowTime.getDayOfMonth()));
             mkdir = new File(stringJoiner.toString());

+ 1 - 1
themis-exam/src/main/resources/application.properties

@@ -132,7 +132,7 @@ aliyun.oss.privateEndpoint=http://${aliyun.oss.privateName}
 aliyun.oss.privateAccessKeyId=LTAI4FnJ2pgV6aGceYcCkeEi
 aliyun.oss.privateAccessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
 aliyun.oss.privateBucket=qmth-test
-aliyun.oss.privateUrl=http://${aliyun.oss.privateBucket}.${aliyun.oss.privateName}
+aliyun.oss.privateUrl=http://static-test.qmth.com.cn
 
 #\u817E\u8BAF\u4E91\u914D\u7F6E
 tencentyun.sdk.appId=1400411036

+ 1 - 1
themis-task/src/main/resources/application.properties

@@ -112,7 +112,7 @@ aliyun.oss.privateEndpoint=http://${aliyun.oss.privateName}
 aliyun.oss.privateAccessKeyId=LTAI4FnJ2pgV6aGceYcCkeEi
 aliyun.oss.privateAccessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
 aliyun.oss.privateBucket=qmth-test
-aliyun.oss.privateUrl=http://${aliyun.oss.privateBucket}.${aliyun.oss.privateName}
+aliyun.oss.privateUrl=http://static-test.qmth.com.cn
 #============================================================================
 # \u914D\u7F6EJobStore
 #============================================================================