diff --git a/src/main/java/com/Nunbody/domain/Mail/domain/MailBody.java b/src/main/java/com/Nunbody/domain/Mail/domain/MailBody.java index 9e81c3d..8237025 100644 --- a/src/main/java/com/Nunbody/domain/Mail/domain/MailBody.java +++ b/src/main/java/com/Nunbody/domain/Mail/domain/MailBody.java @@ -7,6 +7,7 @@ import org.hibernate.annotations.Fetch; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Field; +import org.springframework.data.mongodb.core.mapping.FieldType; @Data @@ -18,7 +19,7 @@ public class MailBody { private String id; @Field(name = "mailId") private Long mailId; - @Field(name = "content") + @Field(name = "content", targetType = FieldType.STRING) private String content; diff --git a/src/main/java/com/Nunbody/domain/mail/controller/MailController.java b/src/main/java/com/Nunbody/domain/mail/controller/MailController.java index 9dc2293..fe0a581 100644 --- a/src/main/java/com/Nunbody/domain/mail/controller/MailController.java +++ b/src/main/java/com/Nunbody/domain/mail/controller/MailController.java @@ -51,7 +51,7 @@ public ResponseEntity> validate(@RequestBody ValidateRequestD final String string= mailManageService.validateConnect(validateRequestDto); return SuccessResponse.ok(string); } - @GetMapping("{id}") + @GetMapping("/header/{id}") public ResponseEntity> getMailBody(@PathVariable("id") Long mailId){ final MailBodyResponseDto mailBody = mailService.getMailBody(mailId); diff --git a/src/main/java/com/Nunbody/domain/mail/service/MailService.java b/src/main/java/com/Nunbody/domain/mail/service/MailService.java index e8b6e50..6bc6766 100644 --- a/src/main/java/com/Nunbody/domain/mail/service/MailService.java +++ b/src/main/java/com/Nunbody/domain/mail/service/MailService.java @@ -111,7 +111,7 @@ public MailList mailSetting(Long userId,String platformHost, String platformId, MailHeader mailHeaderData; - for (int i = 0; i <10 ; i++) { + for (int i = 80; i <90 ; i++) { matcher = pattern.matcher(messages[i].getFrom()[0].toString()); if (matcher.find()) { String fromPerson = matcher.group(1); @@ -163,7 +163,7 @@ public MailBody extractMailBody(Message messages, Long mailId) throws MessagingE MailBody mailBody = MailBody.builder() .mailId(mailId) - .content(contentBytes != null ? new String(contentBytes, StandardCharsets.UTF_8) : null) + .content(contentBytes != null ? new String(contentBytes, StandardCharsets.UTF_8) : " ") .build(); return mailBody;