|
@@ -88,7 +88,7 @@ public class ObjectUploadController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping(value = "/")
|
|
@PostMapping(value = "/")
|
|
|
- public String postObject(MultipartFile file, String sha256sum, Integer channelId) throws Exception {
|
|
|
|
|
|
|
+ public String postObject(MultipartFile file, String objectName, String sha256sum, Integer channelId) throws Exception {
|
|
|
String contentId = UUID.randomUUID().toString().replace("-", "");
|
|
String contentId = UUID.randomUUID().toString().replace("-", "");
|
|
|
long size = file.getSize();
|
|
long size = file.getSize();
|
|
|
File savedFile = fileStoreService.saveFile(file.getInputStream(), contentId, size);
|
|
File savedFile = fileStoreService.saveFile(file.getInputStream(), contentId, size);
|
|
@@ -98,9 +98,6 @@ public class ObjectUploadController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String sha256sum1 = DigestUtil.sha256sum(savedFile.getAbsolutePath());
|
|
String sha256sum1 = DigestUtil.sha256sum(savedFile.getAbsolutePath());
|
|
|
- /*if (!sha256sum.equals(sha256sum1)) {
|
|
|
|
|
- return WebResult.failWithMsg("sha256sum not match");
|
|
|
|
|
- }*/
|
|
|
|
|
ObjectProp objectProp = objectNameService.getObjectProp(channelId);
|
|
ObjectProp objectProp = objectNameService.getObjectProp(channelId);
|
|
|
String originalFilename = file.getOriginalFilename();
|
|
String originalFilename = file.getOriginalFilename();
|
|
|
ObjectResult objectResult = putObjectService.putObject(objectProp, contentId, savedFile, originalFilename, sha256sum1);
|
|
ObjectResult objectResult = putObjectService.putObject(objectProp, contentId, savedFile, originalFilename, sha256sum1);
|