Skip to content

Commit

Permalink
refactor: 꽃 선택 시 추천 멘트와 함께 어울리는 꽃 반환하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ss7622 committed Jun 29, 2024
1 parent 8e7fbc1 commit 2f7a656
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,20 @@ public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlower(@PathVariable ("m
re.add(responseHarmonyDto0);
re.add(responseHarmonyDto1);

return ResponseEntity.ok(new ResponseHarmonyWitnMentDto("추천 멘트",re));
return ResponseEntity.ok(new ResponseHarmonyWitnMentDto("추천은 recommend, recommend는 영어로 추천, 내 너무 피곤하다,, 인생이란 뭘까",re));
}

@PostMapping("/{flowerId}/non")
public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlowerNonMember(@PathVariable ("flowerId") Long flowerId,
@RequestBody String ment){
ResponseHarmonyDto responseHarmonyDto0 = new ResponseHarmonyDto(flowerService.findByNameAndFlowerLanguage("토마토", "완성된 아름다움"));
ResponseHarmonyDto responseHarmonyDto1 = new ResponseHarmonyDto(flowerService.findByNameAndFlowerLanguage("토레니아", "가련한 욕망"));

List<ResponseHarmonyDto> re = new ArrayList<>();
re.add(responseHarmonyDto0);
re.add(responseHarmonyDto1);

return ResponseEntity.ok(new ResponseHarmonyWitnMentDto("추천은 recommend, recommend는 영어로 추천, 내 너무 피곤하다,, 인생이란 뭘까",re));
}

@PostMapping("/test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,14 @@ public ResponseEntity<List<ResponseMentDto>> inputMent(@Parameter(description =
public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlower(@Parameter(description = "회원의 아이디") @PathVariable ("memberId") Long memberId,
@Parameter(description = "선택한 꽃의 아이디") @PathVariable ("flowerId") Long flowerId,
@Parameter(description = "입력했던 멘트") @RequestBody String ment);
@Operation(
summary = "비회원 사용자가 꽃을 선택했을 시 호출",
description = "꽃을 선택했을 시 선택한 꽃의 id 그리고 이전에 입력했던 사용자의 멘트를 보내주세요",
security = @SecurityRequirement(name = "bearerAuth")
)
@ApiResponse(responseCode = "200", description = "멘트 추천 및 어울리는 꽃 추천 성공")
@PostMapping("/{flowerId}/non")
public ResponseEntity<ResponseHarmonyWitnMentDto> selectFlowerNonMember(@Parameter(description = "꽃의 아이디") @PathVariable ("flowerId") Long flowerId,
@Parameter(description = "회원이 입력 했던 멘트") @RequestBody String ment);
}

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.requestMatchers("/oauth2/login", "/login/oauth2/code/**", "/oauth2/authorization/**","/login/oauth2/code/google","/member/*/refresh","/model/test",
"/swagger-ui/index.html", "/swagger-ui/**", "/v3/api-docs/**","/swagger-resources/**", "/v3/api-docs").permitAll()
//비회원 전용 api
.requestMatchers("/main/today","/main/season","model/ment").permitAll()
.requestMatchers("/main/today","/main/season","/model/ment","/model/*/non").permitAll()
.anyRequest().authenticated());

http.addFilterBefore(jwtVerifyFilter(), UsernamePasswordAuthenticationFilter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JwtVerifyFilter extends OncePerRequestFilter {
//Swagger
"/swagger-ui/index.html", "/swagger-ui/**", "/v3/api-docs/**", "/swagger-resources/**", "/v3/api-docs",
//비회원 전용 api
"/main/today","/main/season","/model/ment"};
"/main/today","/main/season","/model/ment","/model/*/non"};
private final RedisUtil redisUtil;


Expand Down

0 comments on commit 2f7a656

Please sign in to comment.