|
@@ -40,6 +40,8 @@ public class UploadController {
|
|
|
BaseCameraManagementService baseCameraManagementService;
|
|
|
@Autowired
|
|
|
BaseRailwayManagementService baseRailwayManagementService;
|
|
|
+ @Value("${base.imgUrl}")
|
|
|
+ private String imgUrl;
|
|
|
|
|
|
@PostMapping("/upLoadImage")
|
|
|
public AjaxResult upLoadImage(@RequestParam("file") MultipartFile image,
|
|
@@ -102,7 +104,7 @@ public class UploadController {
|
|
|
String filename = IdUtils.fastSimpleUUID() + image.getOriginalFilename().substring(image.getOriginalFilename().lastIndexOf("."));
|
|
|
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String format1 = dateFormat1.format(new Date());
|
|
|
- String imgName = "cameraVersion" + format1 + "/" + filename;
|
|
|
+ String imgName = "cameraVersion" + "/" + format1 + "/" + filename;
|
|
|
minioUtils.minIoClientUpload(image.getInputStream(), imgName);
|
|
|
uploadFile = "/cameraVersion/" + format1 + "/" + filename;
|
|
|
}
|
|
@@ -110,7 +112,7 @@ public class UploadController {
|
|
|
return AjaxResult.error("上传功能出错");
|
|
|
}
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("url", uploadFile);
|
|
|
+ map.put("url", imgUrl + uploadFile);
|
|
|
map.put("md5", fileMd5Str);
|
|
|
return AjaxResult.success(map);
|
|
|
}
|