package com.eactive.ext.kjb.common; import lombok.Data; import org.hibernate.validator.constraints.NotEmpty; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.Pattern; @Data public class KjbProperty { @KjbPropertyValue(key = "kjb.eai.batch.url") @Pattern(regexp = "^(https?://[^\\s/$.?#][^\\s]*)|\\s*$", message = "kjb.eai_batch.url 는 유효한 URL 형식이거나 공백이어야 합니다. 예: http://example.com/api") private String eaiBatchUrl; @KjbPropertyValue(key = "kjb.eai.batch.connection_timeout", defaultValue = "5") @Min(1) @Max(10) private int eaiBatchConnectionTimeout = 5; @KjbPropertyValue(key = "kjb.eai.batch.response_timeout", defaultValue = "5") @Min(1) @Max(30) private int eaiBatchResponseTimeout = 5; @KjbPropertyValue(key = "kjb.eai.batch.timeout", defaultValue = "10") @Min(1) @Max(30) private int eaiBatchTimeout = 10; @KjbPropertyValue(key = "kjb.eai.batch.charset", defaultValue = "euc-kr") @NotEmpty private String eaiBatchCharset = "euc-kr"; @KjbPropertyValue(key = "kjb.ums.eai_batch.send_dir", defaultValue = "/Data/eapim/portal/sendmail/snd") @NotEmpty(message = "kjb.ums.eai_batch.send_dir 는 필수값입니다.") private String umsEaiBatchSendDir = "/Data/eapim/portal/sendmail/snd"; @KjbPropertyValue(key = "kjb.ums.eai_batch.backup_dir", defaultValue = "/Data/eapim/portal/sendmail/bak") @NotEmpty(message = "kjb.ums.eai_batch.backup_dir 는 필수값입니다.") private String umsEaiBatchBackupDir = "/Data/eapim/portal/sendmail/bak"; @KjbPropertyValue(key = "kjb.ums.eai_batch.error_dir", defaultValue = "/Data/eapim/portal/sendmail/bak") @NotEmpty(message = "kjb.ums.eai_batch.error_dir 는 필수값입니다.") private String umsEaiBatchErrorDir = "/Data/eapim/portal/sendmail/bak"; @KjbPropertyValue(key = "kjb.ums.eai_batch.interface_id") @Pattern(regexp = "^[a-zA-Z0-9]{13}$", message = "kjb.ums.eai_batch.interface_id 는 12자리 영문대소문자 및 숫자 조합이어야 합니다.") private String umsEaiBatchInterfaceId; @KjbPropertyValue(key = "kjb.ums.eai_batch.retention_date", defaultValue = "60") @Min(1) @Max(365) private int umsEaiBatchRetentionDate = 60; @KjbPropertyValue(key = "kjb.ums.host") @Pattern(regexp = "^(https?://[^\\s/$.?#][^\\s]*)|\\s*$", message = "kjb.ums.host_url 는 유효한 URL 형식이거나 공백이어야 합니다. 예: http://example.com/api") private String umsHostUrl; @KjbPropertyValue(key = "kjb.ums.api_key") @Pattern(regexp = "^[a-zA-Z0-9_-]{36}$", message = "kjb.ums.api_key 입력 형식이 맞지 않습니다.") private String umsApiKey; @KjbPropertyValue(key = "kjb.ums.connection_timeout", defaultValue = "5") @Min(1) @Max(10) private int umsConnectionTimeout = 5; @KjbPropertyValue(key = "kjb.ums.response_timeout", defaultValue = "5") @Min(1) @Max(30) private int umsResponseTimeout = 5; @KjbPropertyValue(key = "kjb.ums.timeout", defaultValue = "10") @Min(1) @Max(30) private int umsTimeout = 10; @KjbPropertyValue(key = "kjb.obp.url") @Pattern(regexp = "^(https?://[^\\s/$.?#][^\\s]*)|\\s*$", message = "kjb.obp.url 는 유효한 URL 형식이거나 공백이어야 합니다. 예: http://example.com/api") private String obpUrl; @KjbPropertyValue(key = "kjb.obp.trust_system.key", defaultValue = "x-obp-trust-system") @NotEmpty private String obpTrustSystemKey = "x-obp-trust-system"; @KjbPropertyValue(key = "kjb.obp.trust_system.value", defaultValue = "APIMPT-0002-QVBJTVBULTAwMDI=") @NotEmpty private String obpTrustSystemValue = "APIMPT-0002-QVBJTVBULTAwMDI="; @KjbPropertyValue(key = "kjb.obp.partner_code.key", defaultValue = "x-obp-partnercode") @NotEmpty private String obpPartnerCodeKey = "x-obp-partnercode"; @KjbPropertyValue(key = "kjb.obp.partner_code.value", defaultValue = "100001-01") @NotEmpty private String obpPartnerCodeValue = "100001-01"; @KjbPropertyValue(key = "kjb.obp.connection_timeout", defaultValue = "5") @Min(1) @Max(10) private int obpConnectionTimeout = 5; @KjbPropertyValue(key = "kjb.obp.response_timeout", defaultValue = "5") @Min(1) @Max(30) private int obpResponseTimeout = 5; @KjbPropertyValue(key = "kjb.obp.timeout", defaultValue = "10") @Min(1) @Max(30) private int obpTimeout = 10; @KjbPropertyValue(key = "kjb.obp.url.commission", defaultValue = "/api/billing/billing/findBillingForCondition") @NotEmpty private String obpUrlCommission = "/api/billing/billing/findBillingForCondition"; @KjbPropertyValue(key = "kjb.obp.url.commission_print", defaultValue = "/api/billing/billing/findBillingForCondition/print") @NotEmpty private String obpUrlCommissionPrint = "/api/billing/billing/findBillingForCondition/print"; @KjbPropertyValue(key = "kjb.obp.url.organization_fmt", defaultValue = "/api/customer/findCustomerByBusinessManRegistrationNo/%s") @NotEmpty private String obpUrlOrganizationFmt = "/api/customer/findCustomerByBusinessManRegistrationNo/%s"; // 광주은행 SSO @KjbPropertyValue(key = "kjb.url", defaultValue = "https://manage-eapim.kjbank.com") @NotEmpty private String url = "https://manage-eapim.kjbank.com"; @KjbPropertyValue(key = "kjb.sso.service_name", defaultValue = "Web") @NotEmpty private String ssoServiceName = "Web"; @KjbPropertyValue(key = "kjb.sso.ascp_url", defaultValue = "/monitoring/sso/login.do") @NotEmpty private String ssoAscpUri = "/monitoring/sso/login.do"; @KjbPropertyValue(key = "kjb.sso.domain", defaultValue = "sso.kjbank.com") @NotEmpty private String ssoDomain = "sso.kjbank.com"; @KjbPropertyValue(key = "kjb.sso.nls_port", defaultValue = "13890") @Min(1024) @Max(65535) private int ssoNlsPort = 13890; @KjbPropertyValue(key = "kjb.sso.ignore_validation", defaultValue = "false") private boolean ssoIgnoreValidation = false; @KjbPropertyValue( key = "kjb.sso.sync_info", defaultValue = "true", description = "SSO 인증시 사용자 정보 동기화 여부(false 시 이름과 ID를 동일하게 처리. 나머지 정보는 무시)") private boolean ssoSyncInfo = true; // SMS 2차 인증 @KjbPropertyValue( key = "kjb.sms_auth.enabled", defaultValue = "true", description = "SMS 2차 인증 사용 여부. true 시 휴대폰번호 없는 사용자는 ID/PW 로그인 불가") private boolean smsAuthEnabled = false; @KjbPropertyValue( key = "kjb.sms_auth.mode", defaultValue = "real", description = "인증번호 생성 모드: real(랜덤), hhmm00(현재시각+00), fixed(고정값)") @Pattern(regexp = "^(real|hhmm00|fixed)$", message = "kjb.sms_auth.mode는 real, hhmm00, fixed 중 하나여야 합니다.") private String smsAuthMode = "real"; @KjbPropertyValue( key = "kjb.sms_auth.fixed_value", defaultValue = "654321", description = "mode가 fixed일 때 사용할 고정 인증번호 (6자리 숫자)") @Pattern(regexp = "^\\d{6}$", message = "kjb.sms_auth.fixed_value는 6자리 숫자여야 합니다.") private String smsAuthFixedValue = "654321"; public String toJsonString(boolean isPretty) { return isPretty ? new GsonBuilder().setPrettyPrinting().create().toJson(this) : new Gson().toJson(this); } // 기본 프로퍼티 목록을 콘솔로 출력 (가이드용) public static void main(String[] args) { System.out.println("| Key | Default Value | Description |"); System.out.println("|-----|---------------|-------------|"); for (java.lang.reflect.Field field : KjbProperty.class.getDeclaredFields()) { KjbPropertyValue annotation = field.getAnnotation(KjbPropertyValue.class); if (annotation != null) { String key = annotation.key(); String defaultValue = annotation.defaultValue(); String description = annotation.description(); System.out.printf("| %s | %s | %s |%n", key, defaultValue, description); } } } }