From 0517930169f14c8679918ec72a8bc65fdc904bb3 Mon Sep 17 00:00:00 2001 From: Lee junbeom Date: Fri, 12 Jul 2024 22:15:06 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=94=84=EB=A1=A0=ED=8A=B8?= =?UTF-8?q?=EB=A1=9C=EB=B6=80=ED=84=B0=20=EB=B0=9B=EC=95=84=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=97=90=20dto=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inputMessage/controller/ModelController.java | 12 +++++++++--- .../domain/inputMessage/controller/api/ModelApi.java | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/fiurinee/domain/inputMessage/controller/ModelController.java b/src/main/java/com/example/fiurinee/domain/inputMessage/controller/ModelController.java index 522307b..841003d 100644 --- a/src/main/java/com/example/fiurinee/domain/inputMessage/controller/ModelController.java +++ b/src/main/java/com/example/fiurinee/domain/inputMessage/controller/ModelController.java @@ -68,7 +68,9 @@ public ResponseEntity> inputMent(@PathVariable("id") Long } @PostMapping("/ment") - public ResponseEntity> inputMentNotMember(@RequestBody String ment){ + public ResponseEntity> inputMentNotMember(@RequestBody RequestMentDto mentDto){ + + String ment = mentDto.ment(); String url = "http://3.106.186.161/api/recommend"; int value = LocalDateTime.now().getMonth().getValue(); @@ -97,7 +99,9 @@ public ResponseEntity> inputMentNotMember(@RequestBody Str @PostMapping("/{memberId}/{flowerId}") public ResponseEntity selectFlower(@PathVariable ("memberId") Long memberId, @PathVariable ("flowerId") Long flowerId, - @RequestBody String ment){ + @RequestBody RequestMentDto mentDto){ + + String ment = mentDto.ment(); inputMessageService.saveInputMessage(memberId,ment); @@ -143,7 +147,9 @@ public ResponseEntity selectFlower(@PathVariable ("m @PostMapping("/{flowerId}/non") public ResponseEntity selectFlowerNonMember(@PathVariable ("flowerId") Long flowerId, - @RequestBody String ment){ + @RequestBody RequestMentDto mentDto){ + String ment = mentDto.ment(); + String url = "http://3.106.186.161/api/flower_color"; Flower flower = flowerService.findById(flowerId); diff --git a/src/main/java/com/example/fiurinee/domain/inputMessage/controller/api/ModelApi.java b/src/main/java/com/example/fiurinee/domain/inputMessage/controller/api/ModelApi.java index 5e6ba7f..d5ddc7e 100644 --- a/src/main/java/com/example/fiurinee/domain/inputMessage/controller/api/ModelApi.java +++ b/src/main/java/com/example/fiurinee/domain/inputMessage/controller/api/ModelApi.java @@ -45,7 +45,7 @@ public ResponseEntity> inputMent(@Parameter(description = ) @ApiResponse(responseCode = "200", description = "꽃 추천 성공") @PostMapping("/ment") - public ResponseEntity> inputMentNotMember(@Parameter(description = "입력한 멘트") @RequestBody String ment); + public ResponseEntity> inputMentNotMember(@Parameter(description = "입력한 멘트") @RequestBody RequestMentDto mentDto); @Operation( summary = "사용자가 꽃을 선택했을 시 호출", @@ -63,7 +63,7 @@ public ResponseEntity> inputMent(@Parameter(description = @PostMapping("/{memberId}/{flowerId}") public ResponseEntity selectFlower(@Parameter(description = "회원의 아이디") @PathVariable ("memberId") Long memberId, @Parameter(description = "선택한 꽃의 아이디") @PathVariable ("flowerId") Long flowerId, - @Parameter(description = "입력했던 멘트") @RequestBody String ment); + @Parameter(description = "입력했던 멘트") @RequestBody RequestMentDto mentDto); @Operation( summary = "비회원 사용자가 꽃을 선택했을 시 호출", description = "꽃을 선택했을 시 선택한 꽃의 id 그리고 이전에 입력했던 사용자의 멘트를 보내주세요", @@ -72,6 +72,6 @@ public ResponseEntity selectFlower(@Parameter(descri @ApiResponse(responseCode = "200", description = "멘트 추천 및 어울리는 꽃 추천 성공") @PostMapping("/{flowerId}/non") public ResponseEntity selectFlowerNonMember(@Parameter(description = "꽃의 아이디") @PathVariable ("flowerId") Long flowerId, - @Parameter(description = "회원이 입력 했던 멘트") @RequestBody String ment); + @Parameter(description = "회원이 입력 했던 멘트") @RequestBody RequestMentDto mentDto); }