From cf5cb8970ec5ca5c5334376c82a65cbdecb5e983 Mon Sep 17 00:00:00 2001 From: HyoBin Yang <50162252+HyoBN@users.noreply.github.com> Date: Wed, 18 Oct 2023 20:43:20 +0900 Subject: [PATCH] =?UTF-8?q?feature/213=20=F0=9F=90=9B=20POI=20=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=B6=A9=EB=8F=8C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20(#224)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :sparkles: 비속어 엑셀 파싱 후 db 저장 API 구현, 닉네임 필터링 기능 구현 * :bug: POI 라이브러리 충돌 에러 --- .../zipdabang/server/service/RootService.java | 2 +- .../service/serviceImpl/RootServiceImpl.java | 77 ++++++++++--------- .../server/web/controller/RootController.java | 23 ++---- 3 files changed, 48 insertions(+), 54 deletions(-) diff --git a/src/main/java/zipdabang/server/service/RootService.java b/src/main/java/zipdabang/server/service/RootService.java index 91a052b..3dd8847 100644 --- a/src/main/java/zipdabang/server/service/RootService.java +++ b/src/main/java/zipdabang/server/service/RootService.java @@ -28,7 +28,7 @@ public interface RootService { Optional findPushAlarmById(Long pushAlarmId); - void ParseExcelFile(MultipartFile file) throws IOException; +// void ParseExcelFile(MultipartFile file) throws IOException; public boolean isNicknameContainsSlangWord(String nickname); public boolean isNicknameReservedWord(String nickname); } diff --git a/src/main/java/zipdabang/server/service/serviceImpl/RootServiceImpl.java b/src/main/java/zipdabang/server/service/serviceImpl/RootServiceImpl.java index bc9ae37..b85107e 100644 --- a/src/main/java/zipdabang/server/service/serviceImpl/RootServiceImpl.java +++ b/src/main/java/zipdabang/server/service/serviceImpl/RootServiceImpl.java @@ -151,44 +151,45 @@ public Optional findPushAlarmById(Long pushAlarmId) { return pushAlarmRepository.findById(pushAlarmId); } - @Override - @Transactional - public void ParseExcelFile(MultipartFile inputFile) throws IOException{ - InputStream file = inputFile.getInputStream(); - Workbook workbook = WorkbookFactory.create(file); - Sheet sheet = workbook.getSheetAt(0); - - // 비속어 저장 - for (int i=0;i readPushAlarm(@CheckTempMember } - @Operation(summary = "닉네임 필터링용 엑셀 파싱 API ✔️🔑", description = "닉네임 필터링용 엑셀 파싱 API") - @PostMapping(value = "/excel", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE}) -// @Parameters({ -// @Parameter(name = "member", hidden = true) +// @Operation(summary = "닉네임 필터링용 엑셀 파싱 API ✔️", description = "닉네임 필터링용 엑셀 파싱 API") +// @PostMapping(value = "/excel", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE}) +// @ApiResponses({ +// @ApiResponse(responseCode = "2000", description = "OK 성공"), // }) - @ApiResponses({ - @ApiResponse(responseCode = "2000", description = "OK 성공"), - }) - public ResponseDto parsingExcelFile(@ModelAttribute MultipartFile file) throws IOException{ - // 멤버 id가 3이면 가능하도록 넣기 - // resources에 엑셀 파일 넣고 해당 경로로 파일 찾기. - // 파싱해서 닉네임들 다 db 만들어서 저장하기. - // valid 어노테이션에서 필터링. - rootService.ParseExcelFile(file); - return null; - } +// public ResponseDto parsingExcelFile(@ModelAttribute MultipartFile file) throws IOException{ +// rootService.ParseExcelFile(file); +// return null; +// } }