From 412720800b7721f73bc9cc6c906ed71e5a1300e8 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 14:31:07 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=A8=ED=82=A4=EC=A7=80=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/controller/BasFlightController.java | 2 +- .../template/service/TemplateService.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pav-server/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java b/pav-server/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java index a5bd3b6..bbc9384 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java +++ b/pav-server/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java @@ -410,7 +410,7 @@ public class BasFlightController { @GetMapping("/laanc-pdf/download") public void downloadPDF(int fileSno, HttpServletResponse response){ - // basFlightService.fileDownload(fileSno, response); + templateService.fileDownload(fileSno, response); } } diff --git a/pav-server/src/main/java/com/palnet/biz/api/bas/flight/template/service/TemplateService.java b/pav-server/src/main/java/com/palnet/biz/api/bas/flight/template/service/TemplateService.java index 09b0a7b..a908e6b 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/bas/flight/template/service/TemplateService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/bas/flight/template/service/TemplateService.java @@ -12,6 +12,7 @@ import java.time.Instant; import java.util.Map; import java.util.Map.Entry; +import javax.servlet.http.HttpServletResponse; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +23,8 @@ import com.palnet.biz.api.acnt.jwt.utils.JwtTokenUtil; import com.palnet.biz.api.bas.flight.template.vo.LaancPdfVO; import com.palnet.biz.jpa.entity.ComFileBas; import com.palnet.biz.jpa.repository.com.ComFileBasRepository; +import com.palnet.comn.code.ErrorCode; +import com.palnet.comn.exception.CustomException; import com.palnet.comn.utils.InstantUtils; import com.palnet.comn.utils.PdfUtils; @@ -106,4 +109,18 @@ public class TemplateService { comFileBasRepository.save(comFileBas); } + /** + * 파일 다운로드 + * @param fileSno + * @param response + */ + public void fileDownload(int fileSno, HttpServletResponse response) { + + ComFileBas comFileBas = comFileBasRepository.findById(fileSno).orElse(null); + if(comFileBas == null) throw new CustomException(ErrorCode.DATA_NOTFIND); + + log.info("comFileBas -> {}", comFileBas); + + } + }