Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 꽃 선택 시 추천 멘트와 함께 어울리는 꽃 반환하도록 수정 #40

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading