diff --git a/src/main/java/com/bside/BSIDE/user/service/EmailServiceImpl.java b/src/main/java/com/bside/BSIDE/user/service/EmailServiceImpl.java index 4c6e621..66ae158 100644 --- a/src/main/java/com/bside/BSIDE/user/service/EmailServiceImpl.java +++ b/src/main/java/com/bside/BSIDE/user/service/EmailServiceImpl.java @@ -260,14 +260,14 @@ public void sendByMonthBlob(String email, String sendEmail, String date, Multipa String fileName = dateArr[0] + "년 " + Integer.parseInt(dateArr[1]) + "월 " + "월간고밍_" + userdto.getUsrNm() + ".png"; helper.addAttachment(fileName, imageData0, "image/png"); - if(!imageData1.isEmpty()) { + if(imageData1 != null) { System.out.println("imageData1 있음"); String fileName1 = dateArr[0] + "년 " + Integer.parseInt(dateArr[1]) + "월 " + "월간고밍_" + userdto.getUsrNm() + "[1].png"; helper.addAttachment(fileName1, imageData1, "image/png"); } - if(!imageData2.isEmpty()) { + if(imageData2 != null) { System.out.println("imageData2 있음"); String fileName2 = dateArr[0] + "년 " + Integer.parseInt(dateArr[1]) + "월 " + "월간고밍_" + userdto.getUsrNm() diff --git a/src/main/java/com/bside/BSIDE/user/web/EmailController.java b/src/main/java/com/bside/BSIDE/user/web/EmailController.java index 195e14b..2ebc747 100644 --- a/src/main/java/com/bside/BSIDE/user/web/EmailController.java +++ b/src/main/java/com/bside/BSIDE/user/web/EmailController.java @@ -68,11 +68,11 @@ public void sendByMonth(@RequestBody EmailDto param) throws Exception { } @PostMapping("/sendByMonthBlob") @Operation(summary = "월간 고밍이미지 이메일로 전송") - public void sendByMonth(@RequestParam String email, @RequestParam String sendEmail, @RequestParam String date ,@RequestParam MultipartFile imageData0,@RequestParam MultipartFile imageData1,@RequestParam MultipartFile imageData2) throws Exception { + public void sendByMonth(@RequestParam String email, @RequestParam String sendEmail, @RequestParam String date ,@RequestParam(required=false) MultipartFile imageData0,@RequestParam(required=false) MultipartFile imageData1 ,@RequestParam(required=false) MultipartFile imageData2 ) throws Exception { System.out.println(email+"+ @#@#@##@#@#@#!@$@$!@$email"); System.out.println(sendEmail+"+ @#@#@##@#@#@#!@$@$!@sendEmail"); System.out.println(imageData0+ "+ @#@#@##@#@#@#!@$@$!@date"); - + System.out.println(imageData1 + "뭐냐 데이터"); emailService.sendByMonthBlob(email,sendEmail,date,imageData0,imageData1,imageData2); }