Added password field

- Added download error modal
- Added password field show logic
- Redesigned UI
This commit is contained in:
2024-02-17 00:14:43 +01:00
parent 374d4dc40d
commit f30961f1f0
5 changed files with 83 additions and 22 deletions

View File

@ -75,10 +75,13 @@ public class Download extends ApiRestController {
public ResponseEntity<Object> getDownloadInfo(@RequestParam String fileId) {
FileUpload fileUpload = fileService.getFileUploadByFileId(fileId);
boolean downloadable = !fileUpload.isSingleDownload() || fileUpload.getDownloadCount() == 0;
Map<String, Object> response = new HashMap<>();
response.put("fileId", fileUpload.getFileId());
response.put("passwordProtected", fileUpload.isPasswordProtected());
response.put("singleDownload", fileUpload.isSingleDownload());
response.put("downloadable", downloadable);
return new ResponseEntity<>(response, HttpStatus.OK);
}