From 9a00161ce6cd8e6d719676bbabb359927dc349f2 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 11:35:32 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=ED=8B=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/controller/BasFlightController.java | 8 +++++++- .../bas/flight/service/BasFlightService.java | 18 +++++++++++++++++- .../repository/com/ComFileBasRepository.java | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) 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 d2ad9bb4..f693049b 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 @@ -10,6 +10,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.servlet.http.HttpServletResponse; + import com.palnet.biz.api.bas.flight.model.*; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; @@ -388,7 +390,7 @@ public class BasFlightController { } } - @PostMapping("/lance-pdf/create") + @PostMapping("/laanc-pdf/create") @Tag(name = "비행계획서", description = "비행계획서 관련 API") @ApiOperation(value = "Lannc 공문 PDF생성") public void createLancePDF(@RequestBody LanncPdfVO vo) { @@ -404,6 +406,10 @@ public class BasFlightController { pdfUtils.save(comFileBas); } + @GetMapping("/laanc-pdf/download") + public void downloadPDF(int fileSno, HttpServletResponse response){ + basFlightService.fileDownload(fileSno, response); + } } diff --git a/pav-server/src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java b/pav-server/src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java index ee893631..d037bbe1 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java @@ -11,8 +11,11 @@ import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; +import javax.servlet.http.HttpServletResponse; + import com.palnet.biz.api.bas.flight.model.*; import org.apache.commons.lang3.StringUtils; import org.json.simple.JSONObject; @@ -30,11 +33,13 @@ import com.palnet.biz.api.acnt.jwt.model.JwtGroupModel; import com.palnet.biz.api.acnt.jwt.utils.JwtTokenUtil; import com.palnet.biz.api.bas.group.model.BasGroupJoinModel; import com.palnet.biz.api.comn.model.ComnPagingRs; +import com.palnet.biz.jpa.entity.ComFileBas; import com.palnet.biz.jpa.entity.FltPlanArcrft; import com.palnet.biz.jpa.entity.FltPlanArea; import com.palnet.biz.jpa.entity.FltPlanAreaCoord; import com.palnet.biz.jpa.entity.FltPlanBas; import com.palnet.biz.jpa.entity.FltPlanPilot; +import com.palnet.biz.jpa.repository.com.ComFileBasRepository; import com.palnet.biz.jpa.repository.flt.FltPlanArcrftRepository; import com.palnet.biz.jpa.repository.flt.FltPlanAreaCoordRepository; import com.palnet.biz.jpa.repository.flt.FltPlanAreaRepository; @@ -67,6 +72,7 @@ public class BasFlightService { private final FltPlanPilotRepository fltPlanPilotRepository; private final FltPlanQueryRepository fltPlanQueryRepository; private final PtyGroupQueryRepository ptyPlanQueryRepository; + private final ComFileBasRepository comFileBasRepository; private final JwtTokenUtil jwtTokenUtil; private final AreaUtils areaUtils; @@ -78,7 +84,8 @@ public class BasFlightService { FltPlanQueryRepository fltPlanQueryRepository, PtyGroupQueryRepository ptyPlanQueryRepository, JwtTokenUtil jwtTokenUtil, - AreaUtils areaUtils) { + AreaUtils areaUtils, + ComFileBasRepository comFileBasRepository) { this.fltPlanBasRepository = fltPlanBasRepository; this.fltPlanArcrftRepository = fltPlanArcrftRepository; this.fltPlanAreaRepository = fltPlanAreaRepository; @@ -88,6 +95,7 @@ public class BasFlightService { this.ptyPlanQueryRepository = ptyPlanQueryRepository; this.jwtTokenUtil = jwtTokenUtil; this.areaUtils = areaUtils; + this.comFileBasRepository = comFileBasRepository; } // 비행계획서 조회 @@ -747,4 +755,12 @@ public class BasFlightService { return jsonObject; } + + public void fileDownload(int fileSno, HttpServletResponse response) throws CustomException{ + + ComFileBas comFileBas = comFileBasRepository.findById(fileSno).orElse(null); + if(comFileBas == null) throw new CustomException(ErrorCode.DATA_NOTFIND); + + + } } diff --git a/pav-server/src/main/java/com/palnet/biz/jpa/repository/com/ComFileBasRepository.java b/pav-server/src/main/java/com/palnet/biz/jpa/repository/com/ComFileBasRepository.java index db35bd93..552c6620 100644 --- a/pav-server/src/main/java/com/palnet/biz/jpa/repository/com/ComFileBasRepository.java +++ b/pav-server/src/main/java/com/palnet/biz/jpa/repository/com/ComFileBasRepository.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; import com.palnet.biz.jpa.entity.ComFileBas; @Repository -public interface ComFileBasRepository extends JpaRepository{ +public interface ComFileBasRepository extends JpaRepository{ public ComFileBas findFirstByOrderByFileSnoDesc(); } From 412720800b7721f73bc9cc6c906ed71e5a1300e8 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 14:31:07 +0900 Subject: [PATCH 2/7] =?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 a5bd3b69..bbc93848 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 09b0a7b1..a908e6b0 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); + + } + } From 3e03e571015dcf50810365d69be8b8e4b294fb0c Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 15:11:13 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/service/TemplateService.java | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) 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 a908e6b0..f41becc9 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 @@ -1,16 +1,13 @@ package com.palnet.biz.api.bas.flight.template.service; import java.io.File; -import java.io.FileOutputStream; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.StringReader; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.nio.file.Paths; +import java.io.OutputStream; +import java.net.URLEncoder; import java.time.Instant; -import java.util.Map; -import java.util.Map.Entry; +import java.util.Objects; import javax.servlet.http.HttpServletResponse; import javax.transaction.Transactional; @@ -117,9 +114,45 @@ public class TemplateService { 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); + if(comFileBas == null) throw new CustomException(ErrorCode.DATA_NOTFIND); + + InputStream inputStream = null; + OutputStream outputStream = null; + + try { + File pdfFile = new File(comFileBas.getFilePath() + comFileBas.getFileSaveNm()); + inputStream = new FileInputStream(pdfFile); + + String fileOriName = comFileBas.getFileOriNm(); + fileOriName = URLEncoder.encode(comFileBas.getFileOriNm(), "UTF-8"); + + response.setContentType("application/octet-stream"); + response.setCharacterEncoding("UTF-8"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + fileOriName + "\""); + response.setContentLengthLong(Long.parseLong(comFileBas.getFileSize())); + response.setStatus(HttpServletResponse.SC_OK); + + outputStream = response.getOutputStream(); + + byte[] buffer = new byte[1024]; //1KB 설정 + int length; + + while((length = inputStream.read(buffer)) != -1) { + outputStream.write(buffer); + } + + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + Objects.requireNonNull(outputStream).flush(); + outputStream.close(); + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } } From 05c5aff86c0e90f488b1896cf72dc185fcfbd976 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 15:24:41 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=EC=8A=A4=EC=9B=A8=EA=B1=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BasFlightController.java | 6 +- .../template/service/TemplateService.java | 44 ++------------- .../java/com/palnet/comn/utils/PdfUtils.java | 55 ++++++++++++++++++- 3 files changed, 62 insertions(+), 43 deletions(-) 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 bbc93848..46bf3dea 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 @@ -408,9 +408,11 @@ public class BasFlightController { } @GetMapping("/laanc-pdf/download") - public void downloadPDF(int fileSno, HttpServletResponse response){ + @Tag(name = "비행계획서", description = "비행계획서 관련 API") + @ApiOperation(value = "Laanc 공문 다운로드") + public void downloadPDF(int fileSno){ - templateService.fileDownload(fileSno, response); + templateService.fileDownload(fileSno); } } 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 f41becc9..af230e18 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 @@ -111,48 +111,12 @@ public class TemplateService { * @param fileSno * @param response */ - public void fileDownload(int fileSno, HttpServletResponse response) { + public void fileDownload(int fileSno) { ComFileBas comFileBas = comFileBasRepository.findById(fileSno).orElse(null); - if(comFileBas == null) throw new CustomException(ErrorCode.DATA_NOTFIND); - - InputStream inputStream = null; - OutputStream outputStream = null; - - try { - File pdfFile = new File(comFileBas.getFilePath() + comFileBas.getFileSaveNm()); - inputStream = new FileInputStream(pdfFile); - - String fileOriName = comFileBas.getFileOriNm(); - fileOriName = URLEncoder.encode(comFileBas.getFileOriNm(), "UTF-8"); - - response.setContentType("application/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-Disposition", "attachment; filename=\"" + fileOriName + "\""); - response.setContentLengthLong(Long.parseLong(comFileBas.getFileSize())); - response.setStatus(HttpServletResponse.SC_OK); - - outputStream = response.getOutputStream(); - - byte[] buffer = new byte[1024]; //1KB 설정 - int length; - - while((length = inputStream.read(buffer)) != -1) { - outputStream.write(buffer); - } - - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - Objects.requireNonNull(outputStream).flush(); - outputStream.close(); - inputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } + if(comFileBas == null) throw new CustomException(ErrorCode.DATA_NOTFIND); + + pdfUtils.fileDownload(comFileBas); } diff --git a/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java b/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java index 9217365f..2559af30 100644 --- a/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java +++ b/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java @@ -1,16 +1,22 @@ package com.palnet.comn.utils; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.io.StringReader; +import java.net.URLEncoder; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.time.Instant; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; + +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -35,13 +41,16 @@ import com.itextpdf.tool.xml.pipeline.css.CssResolverPipeline; import com.itextpdf.tool.xml.pipeline.end.PdfWriterPipeline; import com.itextpdf.tool.xml.pipeline.html.HtmlPipeline; import com.itextpdf.tool.xml.pipeline.html.HtmlPipelineContext; -import com.palnet.biz.api.acnt.jwt.utils.JwtTokenUtil; import com.palnet.biz.api.bas.flight.template.vo.PdfBaseVO; import com.palnet.biz.jpa.entity.ComFileBas; +import com.palnet.comn.code.ErrorCode; +import com.palnet.comn.exception.CustomException; @Component public class PdfUtils { + @Autowired + private HttpServletResponse response; @Autowired private TemplateEngine templateEngine; @@ -166,4 +175,48 @@ public class PdfUtils { return result; } + + /** + * 파일 Download + * @param comFileBas + */ + public void fileDownload(ComFileBas comFileBas){ + InputStream inputStream = null; + OutputStream outputStream = null; + + try { + File pdfFile = new File(comFileBas.getFilePath() + comFileBas.getFileSaveNm()); + inputStream = new FileInputStream(pdfFile); + + String fileOriName = comFileBas.getFileOriNm(); + fileOriName = URLEncoder.encode(comFileBas.getFileOriNm(), "UTF-8"); + + response.setContentType("application/octet-stream"); + response.setCharacterEncoding("UTF-8"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + fileOriName + "\""); + response.setContentLengthLong(Long.parseLong(comFileBas.getFileSize())); + response.setStatus(HttpServletResponse.SC_OK); + + outputStream = response.getOutputStream(); + + byte[] buffer = new byte[1024]; //1KB 설정 + int length; + + while((length = inputStream.read(buffer)) != -1) { + outputStream.write(buffer); + } + + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + Objects.requireNonNull(outputStream).flush(); + outputStream.close(); + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } + } } From b0b633e8a1651ee61651501e94000462d824ed38 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 15:25:56 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=EC=BD=94=EB=93=9C=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bas/flight/controller/BasFlightController.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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 46bf3dea..e8039436 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 @@ -10,8 +10,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletResponse; - import com.palnet.biz.api.bas.flight.model.*; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; @@ -37,7 +35,6 @@ import com.palnet.biz.jpa.entity.ComFileBas; import com.palnet.biz.scheduler.ctr.service.CtrTrnsLctnService; import com.palnet.comn.exception.CustomException; import com.palnet.comn.utils.AreaUtils; -import com.palnet.comn.utils.PdfUtils; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -55,18 +52,14 @@ public class BasFlightController { private final CtrTrnsLctnService ctrTrnsLctnService; private final AreaUtils utils; private final TemplateService templateService; - private final PdfUtils pdfUtils; - - @Autowired - public BasFlightController(BasFlightService basFlightService, Environment env, CtrTrnsLctnService ctrTrnsLctnService, AreaUtils AreaUtils, TemplateService templateService, PdfUtils pdfUtils) { + public BasFlightController(BasFlightService basFlightService, Environment env, CtrTrnsLctnService ctrTrnsLctnService, AreaUtils AreaUtils, TemplateService templateService) { this.basFlightService = basFlightService; this.env = env; this.ctrTrnsLctnService = ctrTrnsLctnService; this.utils = AreaUtils; - this.templateService = templateService; - this.pdfUtils = pdfUtils; + this.templateService = templateService; } @GetMapping("/area") From 273f2a20396a0e199734ff724c6df05405641c27 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Thu, 21 Sep 2023 15:33:50 +0900 Subject: [PATCH 6/7] =?UTF-8?q?Exception=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/palnet/comn/utils/PdfUtils.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java b/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java index 2559af30..b88bea2f 100644 --- a/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java +++ b/pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java @@ -2,6 +2,7 @@ package com.palnet.comn.utils; import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.access.method.P; import org.springframework.stereotype.Component; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; @@ -206,13 +208,20 @@ public class PdfUtils { outputStream.write(buffer); } - } catch (Exception e) { + } catch (FileNotFoundException e) { + throw new CustomException(ErrorCode.DATA_NO); + } catch (IOException e){ e.printStackTrace(); - } finally { + } finally { try { - Objects.requireNonNull(outputStream).flush(); - outputStream.close(); - inputStream.close(); + if(outputStream != null){ + Objects.requireNonNull(outputStream).flush(); + outputStream.close(); + } + + if(inputStream != null){ + inputStream.close(); + } } catch (IOException e) { e.printStackTrace(); } From c42d2b5e7585465dbe97a31bee97a390a1ab0c88 Mon Sep 17 00:00:00 2001 From: lkd9125 Date: Fri, 22 Sep 2023 11:53:39 +0900 Subject: [PATCH 7/7] =?UTF-8?q?Instant=20Convert=20Log=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../palnet/biz/config/convert/StringToInstantBinding.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pav-server/src/main/java/com/palnet/biz/config/convert/StringToInstantBinding.java b/pav-server/src/main/java/com/palnet/biz/config/convert/StringToInstantBinding.java index 4d765b75..47d87cbf 100644 --- a/pav-server/src/main/java/com/palnet/biz/config/convert/StringToInstantBinding.java +++ b/pav-server/src/main/java/com/palnet/biz/config/convert/StringToInstantBinding.java @@ -17,10 +17,8 @@ public class StringToInstantBinding implements Converter { private final String ZONE = "Asia/Seoul"; @Override - public Instant convert(String date) { - log.error("StringToInstantBinding - convert()"); - log.error("date -> {}", date); - + public Instant convert(String date) { + if(InstantUtils.isValidFormat(date, DATETIME_FORMAT)) { return InstantUtils.fromDatetimeString(date); } else if(InstantUtils.isValidFormat(date, DATE_FORMAT)){ @@ -32,7 +30,6 @@ public class StringToInstantBinding implements Converter { log.error("ERROR : ", e); } } - return null; }