智慧保安后台管理-外网项目备份
zhongrj
2022-08-18 f288ed575764a898bb8df1eb06c9b3cba55f3e17
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -194,10 +194,10 @@
   @PostMapping("/put-file-user-avatar")
   public R putFileUserAvatar(@RequestParam MultipartFile file) {
      //填写你文件上传的地址以及相应信息
      String url = "http://61.131.136.25:2081";
      String access = "zhbaadmin";
      String secret = "zhbapassword";
      String bucket = "zhba";
      String url = FileConfig.url;
      String access = FileConfig.access;
      String secret = FileConfig.secret;
      String bucket = FileConfig.bucket;
      MinioClient minioClient =
         MinioClient.builder()
            .endpoint(url)
@@ -228,7 +228,7 @@
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = "http://61.131.136.25:2081/zhba/" + newName;
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      //数据封装
      Map<String, Object> map = new HashMap<>(2);
      map.put("name", newName);
@@ -246,10 +246,10 @@
   @PostMapping("put-file-app")
   public R putFileApp(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException {
      //填写你文件上传的地址以及相应信息
      String url = "http://61.131.136.25:2081";
      String access = "zhbaadmin";
      String secret = "zhbapassword";
      String bucket = "zhba";
      String url = FileConfig.url;
      String access = FileConfig.access;
      String secret = FileConfig.secret;
      String bucket = FileConfig.bucket;
      MinioClient minioClient =
         MinioClient.builder()
            .endpoint(url)
@@ -280,7 +280,7 @@
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = "http://61.131.136.25:2081/zhba/" + newName;
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      return R.data(urls);
   }
@@ -293,10 +293,10 @@
   @PostMapping("put-files")
   public R putFiles(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException {
      //填写你文件上传的地址以及相应信息
      String url = "http://61.131.136.25:2081";
      String access = "zhbaadmin";
      String secret = "zhbapassword";
      String bucket = "zhba";
      String url = FileConfig.url;
      String access = FileConfig.access;
      String secret = FileConfig.secret;
      String bucket = FileConfig.bucket;
      MinioClient minioClient =
         MinioClient.builder()
            .endpoint(url)
@@ -327,7 +327,7 @@
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = "http://61.131.136.25:2081/zhba/" + newName;
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      //数据封装
      Map<String, Object> map = new HashMap<>(2);
      map.put("name", newName);
@@ -346,10 +346,10 @@
   public R putFileZip(@RequestParam MultipartFile file) throws Exception {
      Map<String, Object> map = new HashMap<>(1);
      //填写你文件上传的地址以及相应信息
      String url = "http://61.131.136.25:2081";
      String access = "zhbaadmin";
      String secret = "zhbapassword";
      String bucket = "zhba";
      String url = FileConfig.url;
      String access = FileConfig.access;
      String secret = FileConfig.secret;
      String bucket = FileConfig.bucket;
      MinioClient minioClient =
         MinioClient.builder()
            .endpoint(url)
@@ -367,8 +367,6 @@
      String fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(Locale.US);
      //判断文件是不是zip类型
      if(!fileType.equals("zip")){
//         map.put("data","上传文件类型不符!");
//         return R.data(map);
         throw new ServiceException("上传文件类型不符!必须是 zip 压缩文件格式!");
      }
      //FileConfig.localtion是配置文件和config类生产的,测试demo可以直接把FileConfig.localtion替换成D:/test
@@ -402,7 +400,6 @@
            String idCardNo = compile.matcher(pictrueName).replaceAll("");
            //加入集合
            errorList.add(idCardNo);
         }
         if(multipartFile.getName().toLowerCase().endsWith(".png") || multipartFile.getName().toLowerCase().endsWith(".jpg")) {
            String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf("."));
@@ -419,7 +416,7 @@
                  .headers(headers)
                  .build());
            String urls = "http://61.131.136.25:2081/zhba/" + newName;
            String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
            //内网
            String inUrl = FtpConfig.ip + "/zhba/" + newName;
            //取出身份证号,查询用户信息,更新用户信息
@@ -471,10 +468,10 @@
   public R putFileExamPaymentZip(@RequestParam MultipartFile file) throws Exception {
      Map<String, Object> map = new HashMap<>(1);
      //填写你文件上传的地址以及相应信息
      String url = "http://61.131.136.25:2081";
      String access = "zhbaadmin";
      String secret = "zhbapassword";
      String bucket = "zhba";
      String url = FileConfig.url;
      String access = FileConfig.access;
      String secret = FileConfig.secret;
      String bucket = FileConfig.bucket;
      MinioClient minioClient =
         MinioClient.builder()
            .endpoint(url)
@@ -525,7 +522,7 @@
                  .headers(headers)
                  .build());
            String urls = "http://61.131.136.25:2081/zhba/" + newName;
            String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
            //内网
            String inUrl = FtpConfig.ip +"/zhba/"+ newName;
            //取出身份证号,查询用户信息,更新用户信息
@@ -589,10 +586,10 @@
   @PostMapping("put-files-talk")
   public R putFilestak(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException {
      //填写你文件上传的地址以及相应信息
      String url = "http://61.131.136.25:2081";
      String access = "zhbaadmin";
      String secret = "zhbapassword";
      String bucket = "zhba";
      String url = FileConfig.url;
      String access = FileConfig.access;
      String secret = FileConfig.secret;
      String bucket = FileConfig.bucket;
      MinioClient minioClient =
         MinioClient.builder()
            .endpoint(url)
@@ -625,7 +622,7 @@
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = "http://61.131.136.25:2081/zhba/" + newName;
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      //数据封装
      Map<String, Object> map = new HashMap<>(2);
      map.put("name", newName);