| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.junit.Test; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param snumber 人员编码 |
| | | * @param rid 路线id |
| | | * @param regionId 区域id |
| | |
| | | |
| | | /** |
| | | * 图片上传 |
| | | * |
| | | * @param file |
| | | * @return |
| | | * @throws IOException |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/deletefeed") |
| | |
| | | |
| | | /** |
| | | *APP警单反馈图片,视频 |
| | | * |
| | | * @param file |
| | | */ |
| | | @PostMapping("put-objects") |
| | |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName ="upload/fk/"+UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | String urls = "https://web.byisf.com/minio/jfpt/" + newName; |
| | | System.out.println("开始"); |
| | | Thread thread = new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); //获取file的inputStream |
| | | minioClient.putObject("jfpt", newName, inputStream, "application/octet-stream");//上传 |
| | | inputStream.close(); |
| | | String url = minioClient.getObjectUrl("jfpt", newName); //文件访问路径 |
| | | String substring = url.substring(25, url.length()); |
| | | String urls="https://web.byisf.com/minio"+substring; |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidKeyException e) { |
| | | e.printStackTrace(); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (NoResponseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (XmlPullParserException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (InvalidArgumentException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (InvalidBucketNameException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (ErrorResponseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (InternalException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (InsufficientDataException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | | thread.start(); |
| | | System.out.println("结束"); |
| | | return R.data(urls); |
| | | } |
| | | |
| | |
| | | return R.data(urls); |
| | | } |
| | | |
| | | |
| | | } |