dev add tariff and temp flag for files
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-01-30 17:29:25 +07:00
parent 9a8aa498c0
commit 615924ea9e
@@ -5,6 +5,7 @@ import com.vrt.fileprotection.FileProtector;
import com.vrt.fileprotection.NoCopyCheckResult; import com.vrt.fileprotection.NoCopyCheckResult;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource; import org.springframework.core.io.UrlResource;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -285,6 +286,8 @@ public class ApiController {
} }
} }
@Value("${file.storage.base-path}")
private String baseStoragePath;
@GetMapping("/v{version}/files/download/{fileId}") @GetMapping("/v{version}/files/download/{fileId}")
public ResponseEntity<?> downloadFile( public ResponseEntity<?> downloadFile(
@@ -337,7 +340,9 @@ public class ApiController {
errorData)); errorData));
} }
Path filePath = Paths.get(entityResponse.getProtectStatus()); String fullPath = baseStoragePath + "/" + entityResponse.getProtectStatus();
// Path filePath = Paths.get(entityResponse.getProtectStatus());
Path filePath = Paths.get(fullPath);
Resource resource = new UrlResource(filePath.toUri()); Resource resource = new UrlResource(filePath.toUri());
if (!resource.exists()) { if (!resource.exists()) {