package jnpf.controller;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
import jnpf.fileStorage.dms.DmsFileDownloadStorageService;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.UUID;
|
|
@RestController
|
@RequestMapping("/Dms/Download")
|
@RequiredArgsConstructor
|
public class DmsFileDownloadController {
|
private final DmsFileDownloadStorageService downloadService;
|
|
@GetMapping("/{fileVersionId}")
|
public void stream(@PathVariable("fileVersionId") UUID fileVersionId,
|
@RequestParam("ticket") String accessTicket,
|
@RequestParam(value = "format", required = false) String format,
|
HttpServletResponse response) {
|
downloadService.stream(fileVersionId, accessTicket, format, response);
|
}
|
}
|