From 0cbbd7cd75a10146723d7bd41b371b9875cfe45d Mon Sep 17 00:00:00 2001 From: Bae Hyeonseo Date: Mon, 4 Dec 2023 16:21:41 +0900 Subject: [PATCH] =?UTF-8?q?[chore]:=20Main=20action=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- .../Mail/controller/MailBodyController.java | 26 ------------------- .../mail/controller/MailController.java | 8 +++++- 3 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 src/main/java/com/Nunbody/domain/Mail/controller/MailBodyController.java diff --git a/.gitignore b/.gitignore index 194a78b..ede7ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,4 @@ out/ ### VS Code ### .vscode/ -#**/src/main/resources/application.yml \ No newline at end of file +**/src/main/resources/application.yml \ No newline at end of file diff --git a/src/main/java/com/Nunbody/domain/Mail/controller/MailBodyController.java b/src/main/java/com/Nunbody/domain/Mail/controller/MailBodyController.java deleted file mode 100644 index 462fe3a..0000000 --- a/src/main/java/com/Nunbody/domain/Mail/controller/MailBodyController.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.Nunbody.domain.Mail.controller; - -import com.Nunbody.domain.Mail.domain.MailBody; -import com.Nunbody.domain.Mail.service.MailService; -import com.Nunbody.global.common.SuccessResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/api/mail") -public class MailBodyController { - @Autowired - private MailService mailService; - - @GetMapping("{id}") - public ResponseEntity> getMailBody(@PathVariable("id") Long mailId){ - final MailBody mailBody = mailService.getMailBody(mailId); - - return SuccessResponse.ok(mailBody); - } - -} 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 5aa5654..9bd4c33 100644 --- a/src/main/java/com/Nunbody/domain/mail/controller/MailController.java +++ b/src/main/java/com/Nunbody/domain/mail/controller/MailController.java @@ -1,5 +1,6 @@ package com.Nunbody.domain.Mail.controller; +import com.Nunbody.domain.Mail.domain.MailBody; import com.Nunbody.domain.Mail.domain.MailList; import com.Nunbody.domain.Mail.dto.response.MailListResponseDto; import com.Nunbody.domain.Mail.dto.resquest.ValidateRequestDto; @@ -26,7 +27,6 @@ public class MailController { private final MailService mailService; private final MailManageService mailManageService; @GetMapping("/mails") - @ResponseBody public ResponseEntity> getMail(@RequestParam Long userId) { final MailList mailList = mailService.getMail(userId); return SuccessResponse.ok(mailList); @@ -41,5 +41,11 @@ public ResponseEntity> validate(@RequestBody ValidateRequestD final String string= mailManageService.validateConnect(validateRequestDto); return SuccessResponse.ok(string); } + @GetMapping("{id}") + public ResponseEntity> getMailBody(@PathVariable("id") Long mailId){ + final MailBody mailBody = mailService.getMailBody(mailId); + + return SuccessResponse.ok(mailBody); + } }