Skip to content

Commit

Permalink
feat : 정책 추천 API 에 지원 정책 여부 및 수혜 정책 여부 컬럼 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Dec 31, 2023
1 parent f77cf67 commit b826168
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public RecommendPolicyInfoResponseDto recommend(User user) {
.map(supportPolicyType -> {
Policy policy = supportPolicyTypePolicyMap.get(supportPolicyType);
PolicyMethodType findPolicyMethodType = PolicyMethodType.findPolicyMethodTypeByKeywords(policy.getApplicationProcedureContent());
UserPolicy userPolicy = userPolicyRepository.findByUser_userIdAndPolicy_Id(user.getUserId(), policy.getId())
.orElseGet(null);

RecommendPolicyInfoResponseDto.recommendPolicyInfo dto = RecommendPolicyInfoResponseDto.recommendPolicyInfo.builder()
.policyId(policy.getId())
Expand All @@ -177,6 +179,8 @@ public RecommendPolicyInfoResponseDto recommend(User user) {
.policyIntroduction(policy.getPolicyIntroduction())
.supportTypePolicyCnt(policyRepository.getPolicyCntBySupportPolicyType(supportPolicyType))
.benefit(10000000)
.applyFlag(userPolicy.isApplyFlag())
.interestFlag(userPolicy.isInterestFlag())
.policyDateType(policy.getPolicyDateType().getDescription())
.policyMethodType(findPolicyMethodType)
.policyMethodTypeDescription(findPolicyMethodType.getDescription())
Expand Down Expand Up @@ -235,6 +239,8 @@ public RecommendPolicyInfoResponseDto getRecommendPolicyDummy() {
.policyIntroduction(loansPolicy.getPolicyIntroduction())
.supportTypePolicyCnt(policyRepository.getPolicyCntBySupportPolicyType(SupportPolicyType.LOANS))
.benefit(10000000)
.applyFlag(false)
.interestFlag(false)
.policyDateType("기간 신청")
.policyMethodType(loansPolicyMethodType)
.policyMethodTypeDescription(loansPolicyMethodType.getDescription())
Expand All @@ -252,6 +258,8 @@ public RecommendPolicyInfoResponseDto getRecommendPolicyDummy() {
.policyIntroduction(moneyPolicy.getPolicyIntroduction())
.supportTypePolicyCnt(policyRepository.getPolicyCntBySupportPolicyType(SupportPolicyType.MONEY))
.benefit(10000000)
.applyFlag(true)
.interestFlag(false)
.policyDateType("상시")
.policyMethodType(moneyPolicyMethodType)
.policyMethodTypeDescription(moneyPolicyMethodType.getDescription())
Expand All @@ -269,6 +277,8 @@ public RecommendPolicyInfoResponseDto getRecommendPolicyDummy() {
.policyIntroduction(socialServicePolicy.getPolicyIntroduction())
.supportTypePolicyCnt(policyRepository.getPolicyCntBySupportPolicyType(SupportPolicyType.SOCIAL_SERVICE))
.benefit(10000000)
.applyFlag(true)
.interestFlag(true)
.policyDateType("미정")
.policyMethodType(socialServicePolicyMethodType)
.policyMethodTypeDescription(socialServicePolicyMethodType.getDescription())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public static class recommendPolicyInfo {
@ApiModelProperty(notes = "지원 정책 별 정책 수", example = "24")
private int supportTypePolicyCnt;

@ApiModelProperty(notes = "수혜(신청) 정책 여부")
private boolean applyFlag;

@ApiModelProperty(notes = "관심 정책 여부")
private boolean interestFlag;

@ApiModelProperty(notes = "정책 수혜금액", example = "1560000")
private int benefit;

Expand All @@ -69,7 +75,7 @@ public static class recommendPolicyInfo {
private String policyMethodTypeDescription;

@Builder
public recommendPolicyInfo(SupportPolicyType supportType, String supportTypeDescription, Long policyId, String policyName, String policyLogo, String policyAreaCode, String policyCityCode, String policyIntroduction, int supportTypePolicyCnt, int benefit, String policyDateType, PolicyMethodType policyMethodType, String policyMethodTypeDescription) {
public recommendPolicyInfo(SupportPolicyType supportType, String supportTypeDescription, Long policyId, String policyName, String policyLogo, String policyAreaCode, String policyCityCode, String policyIntroduction, int supportTypePolicyCnt, boolean applyFlag, boolean interestFlag, int benefit, String policyDateType, PolicyMethodType policyMethodType, String policyMethodTypeDescription) {
this.supportType = supportType;
this.supportTypeDescription = supportTypeDescription;
this.policyId = policyId;
Expand All @@ -79,6 +85,8 @@ public recommendPolicyInfo(SupportPolicyType supportType, String supportTypeDesc
this.policyCityCode = policyCityCode;
this.policyIntroduction = policyIntroduction;
this.supportTypePolicyCnt = supportTypePolicyCnt;
this.applyFlag = applyFlag;
this.interestFlag = interestFlag;
this.benefit = benefit;
this.policyDateType = policyDateType;
this.policyMethodType = policyMethodType;
Expand Down

0 comments on commit b826168

Please sign in to comment.