diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManController.java b/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManController.java index 2582606..418bde8 100644 --- a/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManController.java +++ b/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManController.java @@ -60,7 +60,7 @@ public class PortalTermsManController extends BaseAnnotationController { .map(type -> { ComboVo vo = new ComboVo(); vo.setCode(type.name()); - vo.setCodename(type.getDescription()); + vo.setCodename(PortalTermsManService.displayLabel(type)); return vo; }).collect(Collectors.toList()); diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManService.java b/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManService.java index 1befa18..c9d6696 100644 --- a/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManService.java +++ b/src/main/java/com/eactive/eai/rms/onl/apim/portalterms/PortalTermsManService.java @@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.EnumSet; import java.util.HashSet; import java.util.Set; @@ -49,6 +50,26 @@ public class PortalTermsManService extends BaseService { this.fileService = fileService; } + /** 관리 화면에서 '(사용안함)'으로 표시할(=신규 등록에 더 이상 쓰지 않는) 약관 유형 */ + private static final Set DEPRECATED_AGREEMENT_TYPES = EnumSet.of( + AgreementType.PRIVACY_POLICY, + AgreementType.PRIVACY_COLLECT_IND, + AgreementType.PRIVACY_COLLECT_ORG); + + /** + * 관리 화면(콤보/목록)에 표시할 약관 유형 라벨. + * 개인정보처리방침 및 개인용/법인용 개인정보수집동의서는 신규 통합 유형 {@link AgreementType#PRIVACY_COLLECT} 등으로 + * 대체될 예정이므로 '(사용안함)'을 덧붙여 안내한다. + * enum 자체의 description은 포털 사용자 화면(AgreementsController#agreementTitle)에서도 쓰이므로 변경하지 않는다. + */ + public static String displayLabel(AgreementType type) { + String label = type.getDescription(); + if (DEPRECATED_AGREEMENT_TYPES.contains(type)) { + label += "(사용안함)"; + } + return label; + } + private String findName(String userId) { if (StringUtils.isBlank(userId)) { return ""; @@ -66,7 +87,7 @@ public class PortalTermsManService extends BaseService { PortalTermsUI portalTermsUI = portalTermsUIMapper.toVo(agreements); portalTermsUI.setCreatedByName(findName(agreements.getCreatedBy())); portalTermsUI.setLastModifiedByName(findName(agreements.getLastModifiedBy())); - portalTermsUI.setName(agreements.getAgreementsType().getDescription()); + portalTermsUI.setName(displayLabel(agreements.getAgreementsType())); return portalTermsUI; }); }