-
Notifications
You must be signed in to change notification settings - Fork 0
[FIX/#103] 추천 로직 오류 수정 #106
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
Changes from all commits
0881632
4103b95
9f8d889
d4f6d8c
b254b77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -89,8 +89,8 @@ public static SavingsResponseDTO.SavingsListResponse toSavingsListResponseDTO(Li | |||||
|
|
||||||
| return SavingsResponseDTO.SavingsListResponse.builder() | ||||||
| .totalCount(totalCount) | ||||||
| .maxPageNo(maxPageNo) | ||||||
| .nowPageNo(nowPageNo) | ||||||
| .hasNext(nowPageNo < maxPageNo) | ||||||
| .products(products) | ||||||
| .build(); | ||||||
| } | ||||||
|
|
@@ -109,22 +109,31 @@ public static SavingsResponseDTO.SavingsDetailResponse toSavingsDetailResponseDT | |||||
| )) | ||||||
| .toList(); | ||||||
|
|
||||||
| SavingsResponseDTO.SavingsDetailResponse.SavingProductDetail product = new SavingsResponseDTO.SavingsDetailResponse.SavingProductDetail( | ||||||
| savings.getKorCoNm(), | ||||||
| savings.getFinPrdtCd(), | ||||||
| savings.getFinPrdtNm(), | ||||||
| savings.getJoinWay(), | ||||||
| savings.getMtrtInt(), | ||||||
| savings.getSpclCnd(), | ||||||
| savings.getJoinDeny(), | ||||||
| savings.getJoinMember(), | ||||||
| savings.getEtcNote(), | ||||||
| savings.getMaxLimit() == null ? null : String.valueOf(savings.getMaxLimit()), | ||||||
| options | ||||||
| ); | ||||||
| SavingsOption representativeOption = savings.getSavingsOptionList().stream() | ||||||
| .filter(o -> Integer.valueOf(12).equals(o.getSaveTrm())) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 대표 옵션을 찾을 때
Suggested change
|
||||||
| .findFirst() | ||||||
| .orElseGet(() -> savings.getSavingsOptionList().stream() | ||||||
| .filter(o -> o.getIntrRate2() != null) | ||||||
| .max(java.util.Comparator.comparing(SavingsOption::getIntrRate2)) | ||||||
| .orElse(null)); | ||||||
|
|
||||||
| Double basicRate = (representativeOption != null) ? representativeOption.getIntrRate() : null; | ||||||
| Double maxRate = (representativeOption != null) ? representativeOption.getIntrRate2() : null; | ||||||
|
|
||||||
| return SavingsResponseDTO.SavingsDetailResponse.builder() | ||||||
| .product(product) | ||||||
| .korCoNm(savings.getKorCoNm()) | ||||||
| .finPrdtCd(savings.getFinPrdtCd()) | ||||||
| .finPrdtNm(savings.getFinPrdtNm()) | ||||||
| .basicRate(basicRate) | ||||||
| .maxRate(maxRate) | ||||||
| .joinWay(savings.getJoinWay()) | ||||||
| .mtrtInt(savings.getMtrtInt()) | ||||||
| .spclCnd(savings.getSpclCnd()) | ||||||
| .joinDeny(savings.getJoinDeny()) | ||||||
| .joinMember(savings.getJoinMember()) | ||||||
| .etcNote(savings.getEtcNote()) | ||||||
| .maxLimit(savings.getMaxLimit() == null ? null : String.valueOf(savings.getMaxLimit())) | ||||||
| .options(options) | ||||||
| .build(); | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,10 @@ | |||||
| @AllArgsConstructor | ||||||
| public enum SavingsErrorCode implements BaseErrorCode { | ||||||
|
|
||||||
| SAVINGS_NOT_FOUND(HttpStatus.NOT_FOUND, "SAVINGS404_1", "해당 적금 상품을 찾을 수 없습니다.") | ||||||
| SAVINGS_NOT_FOUND(HttpStatus.NOT_FOUND, "SAVINGS404_1", "해당 적금 상품을 찾을 수 없습니다."), | ||||||
| RECOMMENDATION_NOT_FOUND(HttpStatus.NOT_FOUND, "SAVINGS404_2", "아직 추천받은 내역이 없습니다. 먼저 상품 추천을 진행해 주세요."), | ||||||
| FILTERED_RECOMMENDATION_NOT_FOUND(HttpStatus.NOT_FOUND, "SAVINGS400_1", "해당 필터 조건에 맞는 추천 상품이 없습니다."), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| RECOMMENDATION_FAILED(HttpStatus.INTERNAL_SERVER_ERROR, "SAVINGS500_1", "AI 추천 생성에 실패했습니다. 다시 시도해 주세요.") | ||||||
| ; | ||||||
|
|
||||||
| private final HttpStatus status; | ||||||
|
|
||||||
This file was deleted.
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.
예외를 로깅할 때
e.getMessage()만 사용하면 원인 파악에 필요한 정보가 부족할 수 있습니다. 특히getMessage()가null을 반환하는 경우 디버깅이 어려워집니다. 전체 스택 트레이스를 포함하도록 로거를 사용하는 것이 좋습니다.