-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#54] 상품 조회 시 정렬/필터 POST 방식으로 수정 #60
Conversation
- ProductResponse/ImageResponse 위치 이동 - 위치 이동에 따른 ProductResponse/ImageResponse 경로 수정
- GET 방식에서 POST 방식으로 변경 - requestParam을 requestBody로 변경하여 JSON 형태로 받도록 수정
- 필터링 조건들을 requestbody로 받을 수 있도록 POST 방식으로 수정 - 추천 서버에서 반환해주는 상품들은 ProductFindResponse의 recommended 필드를 true로 할당
- 일반 상품과 추천 상품을 합친 후, shuffle이 되어 정렬 조건이 무시되던 문제 수정 -추천 서버에서 추천 상품만 shuffle한 후 반환하도록 수정, 이후 일반 상품 리스트와 병합
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다 ~
머지는 지원님이 됐다싶을때 해주시면 될 것 같아요 ~
@@ -48,16 +47,11 @@ public ProductFindResponse findById(@PathVariable Long id) { | |||
return productFacade.findById(id); | |||
} | |||
|
|||
@GetMapping | |||
@PostMapping("/_search") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 _
는 왜 들어간거에요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조회와 POST 조회를 구분짓기위해 _추가했는데... 불필요한 부분이면 수정하겠습니다!
.name("THE HIGHEST PRICE UPDATE") // 이벤트의 이름을 "THE HIGHEST PRICE UPDATE"로 지정 | ||
.data(data) // 전송할 데이터 | ||
.comment(comment)); // 이벤트에 대한 코멘트 | ||
.id(productId.toString()) // 이벤트의 고유 ID (문자열 형태로 변환) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent가 왜이렇게 차이가 많이나죠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 뭔가 이상해졌군요... 수정하겠습니다..
.append(uuid) | ||
.append(".") | ||
.append(extension); | ||
.append(uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 또 들어왔네요 ㅋㅋ 신기하네
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 뭔가 저장하면서 수정된거같군용...
.append(userId) | ||
.append(File.separator) | ||
.append(savedImageFileName); | ||
.append(baseUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반복문 돌면서 만들어내는게 아니면 String.format 써도 좋을 것 같아요 ~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 넵 확인하고 수정하도록 하겠습니다!
|
||
import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker; | ||
|
||
@FeignClient(name = "productRecommendationClient", url = "http://127.0.0.1:8085/api/v1/products", fallback = RecommendationFallBackMethod.class) | ||
@CircuitBreaker(name = "recommendationServer") | ||
public interface ProductRecommendationServerClient { | ||
|
||
@GetMapping("/recommendations") | ||
@PostMapping("/_recommendations") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 언더바가 있네요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추천 상품 조회 서버에도 POST 조회로 수정하면서 언더바 붙였는데 .. _가 의미가 없다면 수정하도록 하겠습니다!
for (Map<ProductCondition, List<Long>> conditionMap : categoryMap.values()) { | ||
for (List<Long> productIds : conditionMap.values()) { | ||
recommendationProductIds.addAll(productIds); | ||
} | ||
} | ||
} else { | ||
// 카테고리만 필터링된 경우 | ||
if (!categories.isEmpty()) { | ||
for (Category category : categories) { | ||
if (!productFilter.getCategory().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter를 추상화해서 종류별로 액션만 따로 정의해두면 여기서 if로 분기를 안해도 될 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 넵 요 부분은 수정이 필요해보였는데 말씀해주신 방법대로 한번 적용해보도록 하겠습니다!
상품 조회 시 정렬/필터 POST 방식으로 수정