@ -2,9 +2,11 @@ package com.vmis.interfaceapp.config.properties;
import jakarta.validation.constraints.NotBlank ;
import jakarta.validation.constraints.NotNull ;
import lombok.Data ;
import org.springframework.boot.context.properties.ConfigurationProperties ;
import org.springframework.validation.annotation.Validated ;
@Data
@ConfigurationProperties ( prefix = "vmis" )
@Validated
public class VmisProperties {
@ -16,13 +18,7 @@ public class VmisProperties {
@NotNull
private GovProps gov = new GovProps ( ) ;
public SystemProps getSystem ( ) { return system ; }
public void setSystem ( SystemProps system ) { this . system = system ; }
public GpkiProps getGpki ( ) { return gpki ; }
public void setGpki ( GpkiProps gpki ) { this . gpki = gpki ; }
public GovProps getGov ( ) { return gov ; }
public void setGov ( GovProps gov ) { this . gov = gov ; }
@Data
public static class SystemProps {
@NotBlank
private String infoSysId ;
@ -35,23 +31,9 @@ public class VmisProperties {
private String chargerId ;
private String chargerIp ;
private String chargerNm ;
public String getInfoSysId ( ) { return infoSysId ; }
public void setInfoSysId ( String infoSysId ) { this . infoSysId = infoSysId ; }
public String getInfoSysIp ( ) { return infoSysIp ; }
public void setInfoSysIp ( String infoSysIp ) { this . infoSysIp = infoSysIp ; }
public String getSigunguCode ( ) { return sigunguCode ; }
public void setSigunguCode ( String sigunguCode ) { this . sigunguCode = sigunguCode ; }
public String getDepartmentCode ( ) { return departmentCode ; }
public void setDepartmentCode ( String departmentCode ) { this . departmentCode = departmentCode ; }
public String getChargerId ( ) { return chargerId ; }
public void setChargerId ( String chargerId ) { this . chargerId = chargerId ; }
public String getChargerIp ( ) { return chargerIp ; }
public void setChargerIp ( String chargerIp ) { this . chargerIp = chargerIp ; }
public String getChargerNm ( ) { return chargerNm ; }
public void setChargerNm ( String chargerNm ) { this . chargerNm = chargerNm ; }
}
@Data
public static class GpkiProps {
/** "Y" 또는 "N" */
@NotBlank
@ -74,38 +56,12 @@ public class VmisProperties {
private String sigPrivateKeyFilePathName ; // ..._sig.key
private String sigPrivateKeyPasswd ;
public String getEnabled ( ) { return enabled ; }
public void setEnabled ( String enabled ) { this . enabled = enabled ; }
public boolean isUseSign ( ) { return useSign ; }
public void setUseSign ( boolean useSign ) { this . useSign = useSign ; }
public String getCharset ( ) { return charset ; }
public void setCharset ( String charset ) { this . charset = charset ; }
public String getCertServerId ( ) { return certServerId ; }
public void setCertServerId ( String certServerId ) { this . certServerId = certServerId ; }
public String getTargetServerId ( ) { return targetServerId ; }
public void setTargetServerId ( String targetServerId ) { this . targetServerId = targetServerId ; }
public Boolean getLdap ( ) { return ldap ; }
public void setLdap ( Boolean ldap ) { this . ldap = ldap ; }
public String getGpkiLicPath ( ) { return gpkiLicPath ; }
public void setGpkiLicPath ( String gpkiLicPath ) { this . gpkiLicPath = gpkiLicPath ; }
public String getCertFilePath ( ) { return certFilePath ; }
public void setCertFilePath ( String certFilePath ) { this . certFilePath = certFilePath ; }
public String getEnvCertFilePathName ( ) { return envCertFilePathName ; }
public void setEnvCertFilePathName ( String envCertFilePathName ) { this . envCertFilePathName = envCertFilePathName ; }
public String getEnvPrivateKeyFilePathName ( ) { return envPrivateKeyFilePathName ; }
public void setEnvPrivateKeyFilePathName ( String envPrivateKeyFilePathName ) { this . envPrivateKeyFilePathName = envPrivateKeyFilePathName ; }
public String getEnvPrivateKeyPasswd ( ) { return envPrivateKeyPasswd ; }
public void setEnvPrivateKeyPasswd ( String envPrivateKeyPasswd ) { this . envPrivateKeyPasswd = envPrivateKeyPasswd ; }
public String getSigCertFilePathName ( ) { return sigCertFilePathName ; }
public void setSigCertFilePathName ( String sigCertFilePathName ) { this . sigCertFilePathName = sigCertFilePathName ; }
public String getSigPrivateKeyFilePathName ( ) { return sigPrivateKeyFilePathName ; }
public void setSigPrivateKeyFilePathName ( String sigPrivateKeyFilePathName ) { this . sigPrivateKeyFilePathName = sigPrivateKeyFilePathName ; }
public String getSigPrivateKeyPasswd ( ) { return sigPrivateKeyPasswd ; }
public void setSigPrivateKeyPasswd ( String sigPrivateKeyPasswd ) { this . sigPrivateKeyPasswd = sigPrivateKeyPasswd ; }
public boolean isEnabledFlag ( ) { return "Y" . equalsIgnoreCase ( enabled ) ; }
public boolean isEnabledFlag ( ) {
return "Y" . equalsIgnoreCase ( enabled ) ;
}
}
@Data
public static class GovProps {
@NotBlank
private String scheme = "http" ;
@ -118,19 +74,6 @@ public class VmisProperties {
@NotNull
private Services services = new Services ( ) ;
public String getScheme ( ) { return scheme ; }
public void setScheme ( String scheme ) { this . scheme = scheme ; }
public String getHost ( ) { return host ; }
public void setHost ( String host ) { this . host = host ; }
public String getBasePath ( ) { return basePath ; }
public void setBasePath ( String basePath ) { this . basePath = basePath ; }
public int getConnectTimeoutMillis ( ) { return connectTimeoutMillis ; }
public void setConnectTimeoutMillis ( int connectTimeoutMillis ) { this . connectTimeoutMillis = connectTimeoutMillis ; }
public int getReadTimeoutMillis ( ) { return readTimeoutMillis ; }
public void setReadTimeoutMillis ( int readTimeoutMillis ) { this . readTimeoutMillis = readTimeoutMillis ; }
public Services getServices ( ) { return services ; }
public void setServices ( Services services ) { this . services = services ; }
public String buildServiceUrl ( String path ) {
StringBuilder sb = new StringBuilder ( ) ;
sb . append ( scheme ) . append ( "://" ) . append ( host ) ;
@ -145,18 +88,15 @@ public class VmisProperties {
return sb . toString ( ) ;
}
@Data
public static class Services {
@NotNull
private Service basic = new Service ( ) ;
@NotNull
private Service ledger = new Service ( ) ;
public Service getBasic ( ) { return basic ; }
public void setBasic ( Service basic ) { this . basic = basic ; }
public Service getLedger ( ) { return ledger ; }
public void setLedger ( Service ledger ) { this . ledger = ledger ; }
}
@Data
public static class Service {
@NotBlank
private String path ;
@ -166,15 +106,6 @@ public class VmisProperties {
private String apiKey ;
@NotBlank
private String cvmisApikey ;
public String getPath ( ) { return path ; }
public void setPath ( String path ) { this . path = path ; }
public String getCntcInfoCode ( ) { return cntcInfoCode ; }
public void setCntcInfoCode ( String cntcInfoCode ) { this . cntcInfoCode = cntcInfoCode ; }
public String getApiKey ( ) { return apiKey ; }
public void setApiKey ( String apiKey ) { this . apiKey = apiKey ; }
public String getCvmisApikey ( ) { return cvmisApikey ; }
public void setCvmisApikey ( String cvmisApikey ) { this . cvmisApikey = cvmisApikey ; }
}
}
}