changed jdk on 25 springBoot on 3.5.6 and fix code
This commit is contained in:
@@ -34,10 +34,12 @@ public class FileStorageController {
|
||||
return fileStorageService.downloadFile(key);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{objectName}")
|
||||
@DeleteMapping("/{*objectName}")
|
||||
public ResponseEntity<Void> deleteFile(@PathVariable String objectName) {
|
||||
log.info("deleteFile {}", objectName);
|
||||
fileStorageService.deleteFile(objectName);
|
||||
// objectName может прийти как "/avatars/cf80aebe-...jpg" — обрежем ведущий слэш
|
||||
String key = objectName.startsWith("/") ? objectName.substring(1) : objectName;
|
||||
fileStorageService.deleteFileAsCurrentUser(key);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user