Skip to content

Commit

Permalink
Merge pull request #57 from Tave-13th-Project-Team-4-Fiurinee/feature…
Browse files Browse the repository at this point in the history
…/model

refactor: 프론트로부터 받아오는 데이터에 dto 적용
  • Loading branch information
ss7622 authored Jul 12, 2024
2 parents 12a4cd1 + 0517930 commit e58aa6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public ResponseEntity<List<ResponseMentDto>> inputMent(@PathVariable("id") Long
}

@PostMapping("/ment")
public ResponseEntity<List<ResponseMentDto>> inputMentNotMember(@RequestBody String ment){
public ResponseEntity<List<ResponseMentDto>> inputMentNotMember(@RequestBody RequestMentDto mentDto){

String ment = mentDto.ment();
String url = "http://3.106.186.161/api/recommend";

int value = LocalDateTime.now().getMonth().getValue();
Expand Down Expand Up @@ -97,7 +99,9 @@ public ResponseEntity<List<ResponseMentDto>> inputMentNotMember(@RequestBody Str
@PostMapping("/{memberId}/{flowerId}")
public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlower(@PathVariable ("memberId") Long memberId,
@PathVariable ("flowerId") Long flowerId,
@RequestBody String ment){
@RequestBody RequestMentDto mentDto){

String ment = mentDto.ment();

inputMessageService.saveInputMessage(memberId,ment);

Expand Down Expand Up @@ -143,7 +147,9 @@ public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlower(@PathVariable ("m

@PostMapping("/{flowerId}/non")
public ResponseEntity<ResponseHarmonyWitnMentDto> 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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ResponseEntity<List<ResponseMentDto>> inputMent(@Parameter(description =
)
@ApiResponse(responseCode = "200", description = "꽃 추천 성공")
@PostMapping("/ment")
public ResponseEntity<List<ResponseMentDto>> inputMentNotMember(@Parameter(description = "입력한 멘트") @RequestBody String ment);
public ResponseEntity<List<ResponseMentDto>> inputMentNotMember(@Parameter(description = "입력한 멘트") @RequestBody RequestMentDto mentDto);

@Operation(
summary = "사용자가 꽃을 선택했을 시 호출",
Expand All @@ -63,7 +63,7 @@ public ResponseEntity<List<ResponseMentDto>> inputMent(@Parameter(description =
@PostMapping("/{memberId}/{flowerId}")
public ResponseEntity<ResponseHarmonyWitnMentDto> 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 그리고 이전에 입력했던 사용자의 멘트를 보내주세요",
Expand All @@ -72,6 +72,6 @@ public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlower(@Parameter(descri
@ApiResponse(responseCode = "200", description = "멘트 추천 및 어울리는 꽃 추천 성공")
@PostMapping("/{flowerId}/non")
public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlowerNonMember(@Parameter(description = "꽃의 아이디") @PathVariable ("flowerId") Long flowerId,
@Parameter(description = "회원이 입력 했던 멘트") @RequestBody String ment);
@Parameter(description = "회원이 입력 했던 멘트") @RequestBody RequestMentDto mentDto);
}

0 comments on commit e58aa6f

Please sign in to comment.