From b82616871c82333d412f9503fb6a4d65ffe67113 Mon Sep 17 00:00:00 2001 From: LHS-11 Date: Sun, 31 Dec 2023 10:44:33 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EC=A0=95=EC=B1=85=20=EC=B6=94?= =?UTF-8?q?=EC=B2=9C=20API=20=EC=97=90=20=EC=A7=80=EC=9B=90=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20=EC=97=AC=EB=B6=80=20=EB=B0=8F=20=EC=88=98=ED=98=9C?= =?UTF-8?q?=20=EC=A0=95=EC=B1=85=20=EC=97=AC=EB=B6=80=20=EC=BB=AC=EB=9F=BC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/policy/application/PolicyService.java | 10 ++++++++++ .../policy/dto/RecommendPolicyInfoResponseDto.java | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java b/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java index 813e1b3..c70defb 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java +++ b/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java @@ -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()) @@ -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()) @@ -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()) @@ -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()) @@ -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()) diff --git a/src/main/java/com/cmc/zenefitserver/domain/policy/dto/RecommendPolicyInfoResponseDto.java b/src/main/java/com/cmc/zenefitserver/domain/policy/dto/RecommendPolicyInfoResponseDto.java index 5465ee3..7f4319e 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/policy/dto/RecommendPolicyInfoResponseDto.java +++ b/src/main/java/com/cmc/zenefitserver/domain/policy/dto/RecommendPolicyInfoResponseDto.java @@ -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; @@ -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; @@ -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;