Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/uz/javadev/controller/FileController.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,22 @@ public CommonResultData<FileDto> uploadFile(@RequestParam(name = "file")
return service.uploadFile(file, bucketName);
}

@Operation(summary = "Download file", description = "This api for download files")
@GetMapping("/download/{id}")
public CommonResultData<String> downloadFile(@PathVariable UUID id,
HttpServletResponse response) {
log.info("REQUEST download file with id {}", id);
return service.downloadFile(id, response);
}

@Operation(summary = "Preview image", description = "This Api for preview image only images")
@GetMapping("/preview/{fileId}")
public void previewPhoto(@PathVariable UUID fileId, HttpServletResponse response) {
log.info("REQUEST preview file with id {}", fileId);
service.preview(fileId, response);
}

@Operation(summary = "Delete file",description = "This api for delete files")
@DeleteMapping("/delete/{id}")
public CommonResultData<String> deleteFile(@PathVariable UUID id) {
log.info("REQUEST delete file with id {}", id);
Expand Down