派生自 projectDept/qhighschool

yn147
2023-11-23 bccada7cbf7eea3c37c0243d95426d1a29d9121f
src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java
@@ -75,13 +75,17 @@
         String destPath = getDestPath(name);
         String fullPath = config.getResRootPath() + "/" + destPath;
         //截取上传华为云的编码
         File fileRoot = new File(fullPath.substring(0, fullPath.lastIndexOf("/")));
         if (!fileRoot.exists()) {
            fileRoot.mkdirs();
         }
         //压缩
         FileUtils.copyInputStreamToFile(in, new File(fullPath));
         //华为云编码存入数据库
         ResFile file = insertFileToDB(name, fullPath, destPath, getFileType(name));
         return new Result(true, "success",
@@ -239,4 +243,32 @@
      }
      return null;
   }
   @Override
   public Result checkMd5(String md5, String fileName) {
//      if(StringUtils.isBlank(md5)){
//         return Result.FAIL;
//      }
//
//
//         Boolean objectExist;
//         objectExist = authOssService.doseObjectExist(resFile.getPath());
//
//         if (objectExist) {
//
//            ResFileDO resFileToDB = new ResFileDO();
//            BeanUtils.copyProperties(resFile, resFileToDB);
//            resFileToDB.setId(null);
//            TraceUtils.setCreateTrace(resFileToDB);
//            ResFileDO resFileDB = save(resFileToDB);
//
//            Result result = new Result(true, "fileId", resFileDB.getId(), "path", resFileDB.getPath(),"fileName",fileName,
//                  "fileSize",resFileToDB.getSize(),"fileType",resFileToDB.getFileType(),"hit",true);
//            result.setResultCode(201);
//            return result;
//
//      }
      return Result.FAIL;
   }
}