Skip to content

Commit

Permalink
feet : 수혜 정책 리스트 조회 API 에 수혜 금액 기간 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Feb 24, 2024
1 parent 4752bb8 commit 07bd51f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Page<InterestPolicyListResponseDto> getUserPoliciesByInterestFlag(User us
public Page<ApplyPolicyListResponseDto> getUserPoliciesByApplyFlag(User user, boolean applyFlag, int page, int size) {
PageRequest pageable = PageRequest.of(page, size);
return userPolicyRepository.findUserPoliciesByUserAndApplyFlag(user, applyFlag, pageable)
.map(userPolicy -> ApplyPolicyListResponseDto.of(userPolicy.getPolicy()));
.map(userPolicy -> ApplyPolicyListResponseDto.from(userPolicy.getPolicy()));
}

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,27 @@ public class ApplyPolicyListResponseDto {
@ApiModelProperty(notes = "정책 수혜 금액", example = "1000000")
private BigDecimal benefit;

@ApiModelProperty(notes = "수혜 금액 기간", example = "년 , 월")
private String benefitPeriod;

@Builder
public ApplyPolicyListResponseDto(Long policyId, String policyName, String policyIntroduction, String policyLogo, BigDecimal benefit) {
public ApplyPolicyListResponseDto(Long policyId, String policyName, String policyIntroduction, String policyLogo, BigDecimal benefit, String benefitPeriod) {
this.policyId = policyId;
this.policyName = policyName;
this.policyIntroduction = policyIntroduction;
this.policyLogo = policyLogo;
this.benefit = benefit;
this.benefitPeriod = benefitPeriod;
}

public static ApplyPolicyListResponseDto of(Policy policy) {
public static ApplyPolicyListResponseDto from(Policy policy) {
return ApplyPolicyListResponseDto.builder()
.policyId(policy.getId())
.policyName(policy.getPolicyName())
.policyLogo(policy.getPolicyLogo())
.policyIntroduction(policy.getPolicyIntroduction())
.benefit(policy.getBenefit())
.benefitPeriod(policy.getBenefitPeriod())
.build();
}
}

0 comments on commit 07bd51f

Please sign in to comment.