Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
[FIX]: policy detail 토큰 없이도 조회 가능하게 변경 (#199)
Browse files Browse the repository at this point in the history
* [FEAT] BankUpload API 구현

* [FIX]: 배열 쿼리 적용

* [FIX]: 이미지 URL 안나가는 현상 수정

* [FIX]: HomePage URL도 포함

* [FIX]: 이율타입 별 데이터 조회, 정렬 수정

* [FIX]: 은행 이름으로 조회 조건 수정

* [FIX]: 대규모 패치

* [FIX]: Terms 조회 안되는 현상 수정

* [FIX]: Term 정렬 조건 FIX + 최대 금액 조건 추가

* [FIX]: Term 정렬 조건 FIX + 최대 금액 조건 추가

* [FIX]: 최대 금액 조건 오류 FIX

* [FEAT]: 예금 계산기 API 구현

* [FIX]: 예금 계산기 loe -> goe 변경

* [FIX]: maxLimit null 값 0으로 대체

* [FIX]: policy detail 토큰 없이 조회로 변경
  • Loading branch information
sejineer authored Jan 17, 2024
1 parent d1d10ea commit 27c26bb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public Page<SearchPolicyInfoRes> findPolicyInfos(UserPrincipal userPrincipal, St

@Override
public PolicyInfoDetailRes findPolicyDetail(UserPrincipal userPrincipal, Long policyId) {
return policyInfoRepository.findPolicyDetail(policyId, userPrincipal.getId());
if(userPrincipal != null){
return policyInfoRepository.findPolicyDetailWithAuthorization(policyId, userPrincipal.getId());
}
return policyInfoRepository.findPolicyDetail(policyId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public interface PolicyInfoQueryDslRepository {

Page<SearchPolicyInfoRes> findPolicyInfos(String searchKeyword, Pageable pageable);
Page<SearchPolicyInfoRes> findPolicyInfosWithAuthorization(String searchKeyword, Pageable pageable, Long userId);
PolicyInfoDetailRes findPolicyDetail(Long policyId, Long userId);
PolicyInfoDetailRes findPolicyDetailWithAuthorization(Long policyId, Long userId);
PolicyInfoDetailRes findPolicyDetail(Long policyId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Page<SearchPolicyInfoRes> findPolicyInfos(String searchKeyword, Pageable
}

@Override
public PolicyInfoDetailRes findPolicyDetail(Long policyId, Long userId) {
public PolicyInfoDetailRes findPolicyDetailWithAuthorization(Long policyId, Long userId) {
QPolicyInfoBookmark policyInfoBookmark = QPolicyInfoBookmark.policyInfoBookmark;

List<PolicyInfoDetailRes> result = queryFactory
Expand Down Expand Up @@ -122,6 +122,39 @@ public PolicyInfoDetailRes findPolicyDetail(Long policyId, Long userId) {
return result.get(0);
}

@Override
public PolicyInfoDetailRes findPolicyDetail(Long policyId) {
List<PolicyInfoDetailRes> result = queryFactory
.select(new QPolicyInfoDetailRes(
Expressions.constant(false),
policyInfo.polyBizSjNm,
policyInfo.polyItcnCn,
policyInfo.sporCn,
policyInfo.bizPrdCn,
policyInfo.rqutPrdCn,
policyInfo.sporScvl,
policyInfo.ageInfo,
policyInfo.prcpCn,
policyInfo.accrRqisCn,
policyInfo.majrRqisCn,
policyInfo.empmSttsCn,
policyInfo.splzRlmRqisCn,
policyInfo.aditRscn,
policyInfo.prcpLmttTrgtCn,
policyInfo.rqutProcCn,
policyInfo.jdgnPresCn,
policyInfo.rqutUrla,
policyInfo.pstnPaprCn
))
.from(policyInfo)
.where(
policyInfo.id.eq(policyId)
)
.fetch();

return result.get(0);
}

private BooleanExpression searchEq(String searchKeyword) {
return searchKeyword != null ? policyInfo.polyBizSjNm.contains(searchKeyword).or(policyInfo.polyItcnCn.contains(searchKeyword)) : null;
}
Expand Down

0 comments on commit 27c26bb

Please sign in to comment.