From 0af72c16fb480ca9b2e91a86b3e8afd55aa3b278 Mon Sep 17 00:00:00 2001 From: Ugur Alpay Cenar Date: Wed, 7 Aug 2024 16:41:22 +0200 Subject: [PATCH] Rtf endepunkt --- .../nav/bidrag/dokument/controller/DokumentController.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/no/nav/bidrag/dokument/controller/DokumentController.kt b/src/main/java/no/nav/bidrag/dokument/controller/DokumentController.kt index bde2f068..7879fff2 100644 --- a/src/main/java/no/nav/bidrag/dokument/controller/DokumentController.kt +++ b/src/main/java/no/nav/bidrag/dokument/controller/DokumentController.kt @@ -75,11 +75,12 @@ class DokumentController(private val dokumentService: DokumentService) { @PathVariable(required = false) dokumentreferanse: String?, @RequestParam(required = false) resizeToA4: Boolean, @RequestParam(required = false, defaultValue = "true") optimizeForPrint: Boolean, - ): ResponseEntity { - log.info("Henter dokument med journalpostId=$journalpostId og dokumentreferanse=$dokumentreferanse, resizeToA4=$resizeToA4") + @RequestParam("rtf", required = false) rtfFile: Boolean = false, + ): ResponseEntity { + log.info("Henter dokument med journalpostId=$journalpostId og dokumentreferanse=$dokumentreferanse, resizeToA4=$resizeToA4, rtfFile=$rtfFile") val dokument = DokumentRef(journalpostId, dokumentreferanse, null) val response = - dokumentService.hentDokument(dokument, DocumentProperties(resizeToA4, optimizeForPrint)) + if (rtfFile) dokumentService.hentDokumentRTF(dokument) else dokumentService.hentDokument(dokument, DocumentProperties(resizeToA4, optimizeForPrint)) response.body ?.also {