| | |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.common.config.TraceabilityCodeConfig; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | |
| | | // } |
| | | // } |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = "http://dev.jxpskj.com:9000"; |
| | | String access = "pskj"; |
| | | String secret = "pskj@2021"; |
| | | String bucket = "zhnc"; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | .build()); |
| | | in.close(); |
| | | //url |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = TraceabilityCodeConfig.getUploadPath() + newName; |
| | | //返回 |
| | | return urls; |
| | | } |
| | |
| | | @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 = "http://dev.jxpskj.com:9000"; |
| | | String access = "pskj"; |
| | | String secret = "pskj@2021"; |
| | | String bucket = "zhnc"; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = TraceabilityCodeConfig.getUploadPath() + newName; |
| | | //数据封装 |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | map.put("name", newName); |