fix: DTO validation fix

dev
gitea-관리자 1 year ago
parent f3c1e75461
commit 8d79b6881d

@ -4,12 +4,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
/** /**
@ -44,7 +45,8 @@ public class CmmEnsFileDTO {
* | * |
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "시스템구분코드", example = "???", description = "시스템구분코드") @Schema(requiredMode = RequiredMode.REQUIRED, title = "시스템구분코드", example = "???", description = "시스템구분코드")
@Size(min = 1, max = 5, message = "시스템 구분은 필수 입니다") @NotEmpty(message = "시스템 구분은 필수 입니다")
@Size(max = 5)
private String sysSeCode; private String sysSeCode;
/** /**
@ -52,7 +54,8 @@ public class CmmEnsFileDTO {
* KKO-MY-DOC|KT-SMS|E-GREEN * KKO-MY-DOC|KT-SMS|E-GREEN
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "발송구분코드", example = "KKO-MY-DOC", description = "KKO-MY-DOC|KT-SMS|E-GREEN") @Schema(requiredMode = RequiredMode.REQUIRED, title = "발송구분코드", example = "KKO-MY-DOC", description = "KKO-MY-DOC|KT-SMS|E-GREEN")
@Size(min = 1, max = 10, message = "발송구분은 필수 입니다") @NotEmpty(message = "발송구분은 필수 입니다")
@Size(max = 10)
private String sndngSeCode; private String sndngSeCode;
/** /**
@ -68,7 +71,7 @@ public class CmmEnsFileDTO {
*/ */
@JsonIgnore @JsonIgnore
@Schema(requiredMode = RequiredMode.REQUIRED, title = "excel file", example = "null", description = "업로드 excel file") @Schema(requiredMode = RequiredMode.REQUIRED, title = "excel file", example = "null", description = "업로드 excel file")
@NotNull(message = "첨부파일은 필수 입니다") @NotBlank(message = "첨부파일은 필수 입니다")
private MultipartFile[] files; private MultipartFile[] files;
@ -106,18 +109,21 @@ public class CmmEnsFileDTO {
* key - unique key * key - unique key
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "통합발송상세ID", example = " ", description = "통합발송상세ID") @Schema(requiredMode = RequiredMode.REQUIRED, title = "통합발송상세ID", example = " ", description = "통합발송상세ID")
@NotEmpty(message = "통합발송상세 ID는 필수입니다.")
private String unitySndngDetailId; private String unitySndngDetailId;
/** /**
* : * :
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "이름", example = " ", description = "이름") @Schema(requiredMode = RequiredMode.REQUIRED, title = "이름", example = " ", description = "이름")
@NotEmpty(message = "이름은 필수입니다.")
private String nm; private String nm;
/** /**
* : * :
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "주민번호", example = " ", description = "주민번호") @Schema(requiredMode = RequiredMode.REQUIRED, title = "주민번호", example = " ", description = "주민번호")
@NotEmpty(message = "주민번호는 필수입니다.")
private String ihidnum; private String ihidnum;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------

@ -12,6 +12,8 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
/** /**
* <pre> * <pre>
@ -42,7 +44,8 @@ public class KkopayDocAttrDTO {
* : * :
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "발송할 문서의 제목", example = "문서 제목") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "발송할 문서의 제목", example = "문서 제목")
@Size(min = 1, max = 40, message = "문서제목은 필수입니다(max:40)") @NotEmpty(message = "문서제목은 필수입니다(max:40)")
@Size(max = 40)
private String title; private String title;
/** /**
@ -65,7 +68,8 @@ public class KkopayDocAttrDTO {
* () hash - * () hash -
*/ */
@Schema(title = "문서 원문(열람정보)에 대한 hash 값", example = "6EFE827AC88914DE471C621AE") @Schema(title = "문서 원문(열람정보)에 대한 hash 값", example = "6EFE827AC88914DE471C621AE")
@Size(max = 99, message = "문서 원문(열람정보)에 대한 hash 값(max=99)") @NotEmpty(message = "문서 원문(열람정보)에 대한 hash 값(max=99)")
@Size(max = 99)
private String hash; private String hash;
/** /**
@ -143,23 +147,24 @@ public class KkopayDocAttrDTO {
* : * :
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "본인인증 후 사용자에게 보여줄 웹페이지 주소", example = "http://ipAddress/api/kakaopay/v1/ott") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "본인인증 후 사용자에게 보여줄 웹페이지 주소", example = "http://ipAddress/api/kakaopay/v1/ott")
//@NotBlank @NotEmpty(message = "본인인증후 사용자에게 보여줄 페이지 주소는 필수입니다(max=100)")
@Size(min = 10, max = 100, message = "본인인증후 사용자에게 보여줄 페이지 주소는 필수입니다(max=100)") @Size(max = 100)
private String link; private String link;
/** /**
* : * :
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "고객센터 전화번호", example = "02-123-4567") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "고객센터 전화번호", example = "02-123-4567")
@Size(min = 10, max = 20, message = "고객센터 전화번호는 필수입니다(max=20)") @NotEmpty(message = "고객센터 전화번호는 필수입니다(max=20)")
@Size(max = 20)
private String cs_number; private String cs_number;
/** /**
* : * :
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "고객센터 명", example = "콜센터") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "고객센터 명", example = "콜센터")
//@NotBlank @NotBlank(message = "고객센터명은 필수입니다(max=10)")
@Size(min = 1, max = 10, message = "고객센터명은 필수입니다(max=10)") @Size(max = 10)
private String cs_name; private String cs_name;
/** /**
@ -191,7 +196,8 @@ public class KkopayDocAttrDTO {
* (max:40) - * (max:40) -
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "카카오페이 문서식별번호(max:40)", example = "BIN-ff806328863311ebb61432ac599d6150") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "카카오페이 문서식별번호(max:40)", example = "BIN-ff806328863311ebb61432ac599d6150")
@Size(min = 1, max = 40, message = "카카오페이 문서식별번호는 필수입니다(max:40)") @NotEmpty(message = "카카오페이 문서식별번호는 필수입니다(max:40)")
@Size(max = 40)
private String document_binder_uuid; private String document_binder_uuid;
} }
@ -215,7 +221,8 @@ public class KkopayDocAttrDTO {
* @see ApiConstants.DocBoxStatus * @see ApiConstants.DocBoxStatus
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20, title = "진행상태(max:20)", example = " ") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20, title = "진행상태(max:20)", example = " ")
@Size(min = 1, max = 20, message = "진행상태는 필수입니다(max:20)") @NotEmpty(message = "진행상태는 필수입니다(max:20)")
@Size(max = 20)
private ApiConstants.DocBoxStatus doc_box_status; private ApiConstants.DocBoxStatus doc_box_status;
/** /**

@ -10,6 +10,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.NotEmpty;
/** /**
* <pre> * <pre>
@ -63,7 +64,8 @@ public class KkopayDocBulkDTO extends KkopayDocAttrDTO {
* ()(max=40) - * ()(max=40) -
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "외부 문서 아이디(max=40)", example = "A000001") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "외부 문서 아이디(max=40)", example = "A000001")
@Size(min = 1, max = 40, message = "문서 아이디(외부)는 필수 입니다(max=40)") @NotEmpty(message = "문서 아이디(외부)는 필수 입니다(max=40)")
@Size(max = 40)
private String external_document_uuid; private String external_document_uuid;
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -91,6 +93,7 @@ public class KkopayDocBulkDTO extends KkopayDocAttrDTO {
* ()(max=40) - * ()(max=40) -
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "외부 문서 아이디(max=40)", example = " ") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "외부 문서 아이디(max=40)", example = " ")
@NotEmpty
@Size(min = 1, max = 40) @Size(min = 1, max = 40)
private String external_document_uuid; private String external_document_uuid;
@ -154,7 +157,8 @@ public class KkopayDocBulkDTO extends KkopayDocAttrDTO {
* (max:40) - * (max:40) -
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "카카오페이 문서식별번호(max:40)", example = " ") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "카카오페이 문서식별번호(max:40)", example = " ")
@Size(min = 1, max = 40, message = "카카오페이 문서식별번호는 필수입니다(max:40)") @NotEmpty(message = "카카오페이 문서식별번호는 필수입니다(max:40)")
@Size(max = 40)
private String document_binder_uuid; private String document_binder_uuid;
/** /**

@ -13,6 +13,7 @@ import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
/** /**
* <pre> * <pre>
@ -94,8 +95,8 @@ public class KkopayDocDTO extends KkopayDocAttrDTO {
* (max:50) : * (max:50) :
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "카카오페이 전자문서 서버로 부터 받은 토큰(max:50)", example = "CON-cc375944ae3d11ecb91e42193199ee3c") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "카카오페이 전자문서 서버로 부터 받은 토큰(max:50)", example = "CON-cc375944ae3d11ecb91e42193199ee3c")
//@Size(min = 1, max = 50, message = "카카오페이 전자문서 서버 토큰은 필수입니다(max:50)") @NotEmpty(message = "카카오페이 전자문서 서버 토큰은 필수입니다(max:50)")
@Length(min = 1, max = 50, message = "카카오페이 전자문서 서버 토큰은 필수입니다(max:50)") @Length(max = 50)
private String token; private String token;
} }
//----------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------
@ -112,7 +113,8 @@ public class KkopayDocDTO extends KkopayDocAttrDTO {
* ( USED) : * ( USED) :
*/ */
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "토큰상태값(성공시 USED)", example = " ") @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "토큰상태값(성공시 USED)", example = " ")
@Size(min = 1, max = 10, message = "토큰상태값은 필수입니다(성공:USED)") @NotEmpty(message = "토큰상태값은 필수입니다(성공:USED)")
@Size(max = 10)
private String token_status; private String token_status;
/** /**

@ -1,12 +1,20 @@
package kr.xit.biz.ens.model.kt; package kr.xit.biz.ens.model.kt;
import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude;
import kr.xit.biz.common.AuditFields; import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import javax.validation.constraints.Size;
import kr.xit.core.model.IApiResponse;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Builder.Default;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
/** /**
* <pre> * <pre>
@ -25,4 +33,151 @@ import lombok.experimental.SuperBuilder;
*/ */
public class KtMmsDTO { public class KtMmsDTO {
@Schema(name = "KtMnsRequest", description = "KT MMS 공통 파라메터 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class KtMnsRequest {
/**
*
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "시군구코드", example = "88328")
@NotEmpty(message = "시군구 코드는 필수 입니다")
@Size(max = 10)
private String signguCode;
/**
*
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "과태료코드", example = "11")
@NotEmpty(message = "과태료 코드는 필수 입니다")
@Size(max = 2)
private final String ffnlgCode = "11";
/**
* Id
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "주민번호", example = " ")
private String juminId;
}
@Schema(name = "KtTokenRequest", description = "KT MMS 토큰발행 요청 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class KtTokenRequest {
/**
* : 'clinet_credentials'
*/
@Default
@Schema(requiredMode = RequiredMode.REQUIRED, title = "권한부여방식", example = "clinet_credentials")
@NotEmpty(message = "권한부여방식은 필수 입니다")
@Size(max = 100)
private String grantType = "clinet_credentials";
/**
*
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "클라이언트 ID", example = " ")
@NotEmpty(message = "클라이언트 ID는 필수 입니다")
@Size(max = 500)
private String clientId;
/**
* secret
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "클라이언트 secret", example = " ")
@NotEmpty(message = "클라이언트 secret는 필수 입니다")
@Size(max = 500)
private String clientSecret;
/**
* <pre>
* : ag.api|pf.api
* </pre>
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "권한범위", example = "ag.api")
@NotEmpty(message = "권한범위는 필수 입니다")
@Length(max = 1)
private String scope;
}
@Schema(name = "KtTokenResponse", description = "KT MMS 토큰발행 요청 결과 DTO")
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public static class KtTokenResponse implements IApiResponse {
//-------------------------------------------------------------------
// 토큰 발행 성공시 필수
//-------------------------------------------------------------------
/**
* :
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "접근 토큰", example = " ")
@Size(max = 1000)
private String accessToken;
/**
* <pre>
* :
* bearer
* </pre>
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "접근 토큰 유형", example = "bearer")
@Size(max = 100)
private final String tokenType = "bearer";
/**
* :
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "접근 토큰 유효 기간", example = " ")
@Size(max = 100)
private String expiresIn;
/**
* <pre>
* :
* , scope
* </pre>
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "권한범위|scope에러인 경우만 발생", example = "ag.api")
@Size(max = 100)
private String scope;
/**
* :
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "접근토큰 식별자", example = "ag.api")
@Size(max = 100)
private String jtl;
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// 토큰 발행 실패시 필수
//-------------------------------------------------------------------
/**
* <pre>
* :
* bearer
* </pre>
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "에러코드", example = " ")
@Size(max = 100)
private String error;
/**
* :
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "에러메세지", example = " ")
@Size(max = 100)
private String error_description;
}
} }

@ -7,19 +7,17 @@ import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import kr.xit.biz.common.AuditFields; import kr.xit.biz.common.AuditFields;
import kr.xit.core.model.IApiResponse; import kr.xit.core.model.IApiResponse;
import kr.xit.core.support.utils.JsonUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Builder.Default; import lombok.Builder.Default;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.NotEmpty;
/** /**
* <pre> * <pre>
@ -49,14 +47,14 @@ public class NiceCiDTO {
* *
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "시군구코드", example = "88328") @Schema(requiredMode = RequiredMode.REQUIRED, title = "시군구코드", example = "88328")
@Size(min = 1, message = "시군구 코드는 필수 입니다") @NotEmpty(message = "시군구 코드는 필수 입니다")
private String signguCode; private String signguCode;
/** /**
* *
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "과태료코드", example = "11") @Schema(requiredMode = RequiredMode.REQUIRED, title = "과태료코드", example = "11")
@Size(min = 1, message = "과태료 코드는 필수 입니다") @NotEmpty(message = "과태료 코드는 필수 입니다")
private String ffnlgCode = "11"; private String ffnlgCode = "11";
/** /**
@ -75,20 +73,20 @@ public class NiceCiDTO {
* Json data : SNAKE_CASE (grant_type <-> grantType) * Json data : SNAKE_CASE (grant_type <-> grantType)
* </pre> * </pre>
*/ */
@Schema(name = "TokenRequest", description = "기관용 Token(50년 유효) 발급 요청 파라메터 DTO") @Schema(name = "NiceTokenRequest", description = "Nice 기관용 Token(50년 유효) 발급 요청 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public static class TokenRequest { public static class NiceTokenRequest {
/** /**
* default * default
*/ */
@Default @Default
@Schema(requiredMode = RequiredMode.REQUIRED, title = "scope", example = "default") @Schema(requiredMode = RequiredMode.REQUIRED, title = "scope", example = "default")
@Size(min = 1, message = "scope는 필수입니다") @NotEmpty(message = "scope는 필수입니다")
private String scope = "default"; private String scope = "default";
/** /**
@ -96,7 +94,7 @@ public class NiceCiDTO {
*/ */
@Default @Default
@Schema(requiredMode = RequiredMode.REQUIRED, title = "grant_type", example = "clinet_credentials") @Schema(requiredMode = RequiredMode.REQUIRED, title = "grant_type", example = "clinet_credentials")
@Size(min = 1, message = "grant_type은 필수입니다") @NotEmpty(message = "grant_type은 필수입니다")
private String grantType = "clinet_credentials"; private String grantType = "clinet_credentials";
} }
@ -107,13 +105,13 @@ public class NiceCiDTO {
* content-type : application/json * content-type : application/json
* </pre> * </pre>
*/ */
@Schema(name = "TokenResponse", description = "기관용 Token(50년 유효) 발급 요청 결과 DTO") @Schema(name = "NiceTokenResponse", description = "Nice 기관용 Token(50년 유효) 발급 결과 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@SuperBuilder @SuperBuilder
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public static class TokenResponse implements IApiResponse { public static class NiceTokenResponse implements IApiResponse {
@Schema(requiredMode = RequiredMode.REQUIRED) @Schema(requiredMode = RequiredMode.REQUIRED)
@Valid @Valid
private ResponseDataHeader dataHeader; private ResponseDataHeader dataHeader;
@ -128,7 +126,7 @@ public class NiceCiDTO {
* Token * Token
* </pre> * </pre>
*/ */
@Schema(name = "TokenRevokeResponse", description = "기관용 Token 폐기 요청 결과 DTO") @Schema(name = "TokenRevokeResponse", description = "기관용 Token 폐기 결과 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -151,7 +149,7 @@ public class NiceCiDTO {
* Json data : SNAKE_CASE (access_token <-> accessToken) * Json data : SNAKE_CASE (access_token <-> accessToken)
* </pre> * </pre>
*/ */
@Schema(name = "TokenResDataBody", description = "기관용 토큰 발급 요청 결과 dataBody DTO") @Schema(name = "TokenResDataBody", description = "기관용 토큰 발급 결과 dataBody DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -196,7 +194,7 @@ public class NiceCiDTO {
* dataBody * dataBody
* </pre> * </pre>
*/ */
@Schema(name = "TokenRevokeResDataBody", description = "기관용 토큰 폐기 요청 결과 dataBody DTO") @Schema(name = "TokenRevokeResDataBody", description = "기관용 토큰 폐기 결과 dataBody DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -224,7 +222,7 @@ public class NiceCiDTO {
* (publickey) * (publickey)
* </pre> * </pre>
*/ */
@Schema(name = "PublickeyRequest", description = "공개키(publickey) 요청 파라메터 DTO") @Schema(name = "PublickeyRequest", description = "공개키(publickey) 요청 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -245,7 +243,7 @@ public class NiceCiDTO {
* (publickey) * (publickey)
* </pre> * </pre>
*/ */
@Schema(name = "PublickeyResponse", description = "공개키(publickey) 발급 요청 결과 DTO") @Schema(name = "PublickeyResponse", description = "공개키(publickey) 발급 결과 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -348,7 +346,7 @@ public class NiceCiDTO {
* (symmetrickey) * (symmetrickey)
* </pre> * </pre>
*/ */
@Schema(name = "SymmetrickeyRequest", description = "대칭키(symmetrickey) 등록 요청 파라메터 DTO") @Schema(name = "SymmetrickeyRequest", description = "대칭키(symmetrickey) 등록 파라메터 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -369,7 +367,7 @@ public class NiceCiDTO {
* (symmetrickey) * (symmetrickey)
* </pre> * </pre>
*/ */
@Schema(name = "SymmetrickeyResponse", description = "대칭키(symmetrickey) 등록 요청 결과 DTO") @Schema(name = "SymmetrickeyResponse", description = "대칭키(symmetrickey) 등록 결과 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -405,7 +403,8 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "공개키버전", example = "20210121ca8c1612-2c2d-IPaa-aad1-xxxxxxxxxxxx") @Schema(requiredMode = RequiredMode.REQUIRED, title = "공개키버전", example = "20210121ca8c1612-2c2d-IPaa-aad1-xxxxxxxxxxxx")
@Size(min = 1, max = 50, message = "공개키버전은 필수 입니다") @NotEmpty(message = "공개키버전은 필수 입니다")
@Size(max = 50)
private String pubkeyVersion; private String pubkeyVersion;
/** /**
@ -422,7 +421,8 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "json암호화값(회원사에서 생성한 대칭키를 공개키로 암호화한 값)", example = "SDFWASDFASDFSDFASDFASDFASD=") @Schema(requiredMode = RequiredMode.REQUIRED, title = "json암호화값(회원사에서 생성한 대칭키를 공개키로 암호화한 값)", example = "SDFWASDFASDFSDFASDFASDFASD=")
@Size(min = 1, max = 512, message = "대칭키(암호화)는 필수 입니다") @NotEmpty(message = "대칭키(암호화)는 필수 입니다")
@Size(max = 512)
private String symkeyRegInfo; private String symkeyRegInfo;
} }
@ -445,7 +445,7 @@ public class NiceCiDTO {
* - 0099: * - 0099:
* </pre> * </pre>
*/ */
@Schema(name = "SymmetrickeyResDataBody", description = "대칭키(symmetrickey) 등록 요청 결과 dataBody DTO") @Schema(name = "SymmetrickeyResDataBody", description = "대칭키(symmetrickey) 등록 결과 dataBody DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -477,23 +477,28 @@ public class NiceCiDTO {
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public static class SymkeyRegInfo { public static class SymkeyRegInfo {
@Schema(requiredMode = RequiredMode.REQUIRED, title = "사이트 코드", description = "공개키요청시 수신한 사이트코드", example = "AAA==") @Schema(requiredMode = RequiredMode.REQUIRED, title = "사이트 코드", description = "공개키요청시 수신한 사이트코드", example = "AAA==")
@Size(min = 1, max = 16, message = "사이트 코드는 필수 입니다(max:16)") @NotEmpty(message = "사이트 코드는 필수 입니다(max:16)")
@Size(max = 16)
private String siteCode; private String siteCode;
@Schema(requiredMode = RequiredMode.REQUIRED, title = "요청고유번호", description = "이용기관에서 생성한 임의의 값", example = " ") @Schema(requiredMode = RequiredMode.REQUIRED, title = "요청고유번호", description = "이용기관에서 생성한 임의의 값", example = " ")
@Size(min = 30, max = 30, message = "요청고유번호는 필수 입니다(max:30)") @NotEmpty(message = "요청고유번호는 필수 입니다(max:30)")
@Size(max = 30)
private String requestNo; private String requestNo;
@Schema(requiredMode = RequiredMode.REQUIRED, title = "암호화키", description = "사용할 암호화키", example = " ") @Schema(requiredMode = RequiredMode.REQUIRED, title = "암호화키", description = "사용할 암호화키", example = " ")
@Size(min = 32, max = 32, message = "사이트 코드는 필수 입니다(max:32)") @NotEmpty(message = "사이트 코드는 필수 입니다(max:32)")
@Size(max = 32)
private String key; private String key;
@Schema(requiredMode = RequiredMode.REQUIRED, title = "iv", description = "inital Vector", example = " ") @Schema(requiredMode = RequiredMode.REQUIRED, title = "iv", description = "inital Vector", example = " ")
@Size(min = 16, max = 16, message = "iv는 필수 입니다(max:16)") @NotEmpty(message = "iv는 필수 입니다(max:16)")
@Size(max = 16)
private String iv; private String iv;
@Schema(requiredMode = RequiredMode.REQUIRED, title = "hmac_key", description = "사용할 HMAC KEY", example = " ") @Schema(requiredMode = RequiredMode.REQUIRED, title = "hmac_key", description = "사용할 HMAC KEY", example = " ")
@Size(min = 32, max = 32, message = "iv는 필수 입니다(max:16)") @NotEmpty(message = "iv는 필수 입니다(max:32)")
@Size(max = 32)
private String hmacKey; private String hmacKey;
} }
@ -528,7 +533,7 @@ public class NiceCiDTO {
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// 아이핀 CI 요청 // 아이핀 CI 요청
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
@Schema(name = "IpinCiRequest", description = "IPIN CI 요청 파라메터 DTO") @Schema(name = "IpinCiRequest", description = "IPIN CI 요청 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -544,12 +549,7 @@ public class NiceCiDTO {
private IpinCiReqDataBody dataBody; private IpinCiReqDataBody dataBody;
} }
/** @Schema(name = "IpinCiResponse", description = "IPIN CI 요청 결과 DTO")
* <pre>
* (symmetrickey)
* </pre>
*/
@Schema(name = "SymmetrickeyRegResponse", description = "대칭키(symmetrickey) 등록 요청 결과 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -571,7 +571,7 @@ public class NiceCiDTO {
* Json data : SNAKE_CASE (req_dtim <-> reqDtim) * Json data : SNAKE_CASE (req_dtim <-> reqDtim)
* </pre> * </pre>
*/ */
@Schema(name = "IpinCiReqDataBody", description = "IPIN CI 등록 요청 dataBody DTO") @Schema(name = "IpinCiReqDataBody", description = "IPIN CI 요청 dataBody DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -585,7 +585,8 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "대칭키버전", example = "20210121ca8c1612-2c2d-IPaa-aad1-xxxxxxxxxxxx") @Schema(requiredMode = RequiredMode.REQUIRED, title = "대칭키버전", example = "20210121ca8c1612-2c2d-IPaa-aad1-xxxxxxxxxxxx")
@Size(min = 1, max = 50, message = "대칭키 버전은 필수 입니다") @NotEmpty(message = "대칭키 버전은 필수 입니다")
@Size(max = 50)
private String symkeyVersion; private String symkeyVersion;
/** /**
@ -595,7 +596,8 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "json암호화값(회원사에서 생성한 대칭키를 공개키로 암호화한 값)", example = "SDFWASDFASDFSDFASDFASDFASD=") @Schema(requiredMode = RequiredMode.REQUIRED, title = "json암호화값(회원사에서 생성한 대칭키를 공개키로 암호화한 값)", example = "SDFWASDFASDFSDFASDFASDFASD=")
@Size(min = 1, max = 1024, message = "encode data는 필수입니다(JSON암호화)") @NotEmpty(message = "encode data는 필수입니다(JSON암호화)")
@Size(max = 1024)
private String encData; private String encData;
/** /**
@ -604,11 +606,12 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "integrity_value", example = "SDFWASDFASDFSDFASDFASDFASD=") @Schema(requiredMode = RequiredMode.REQUIRED, title = "integrity_value", example = "SDFWASDFASDFSDFASDFASDFASD=")
@Size(min = 1, max = 44, message = "encode data는 필수입니다(JSON암호화)") @NotEmpty(message = "encode data는 필수입니다(JSON암호화)")
@Size(max = 44)
private String integrityValue; private String integrityValue;
} }
@Schema(name = "IpinCiResDataBody", description = "IPIN CI 등록 결과 dataBody DTO") @Schema(name = "IpinCiResDataBody", description = "IPIN CI 요청 결과 dataBody DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -650,7 +653,7 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.AUTO, title = "integrity_value", example = "SDFWASDFASDFSDFASDFASDFASD=") @Schema(requiredMode = RequiredMode.AUTO, title = "integrity_value", example = "SDFWASDFASDFSDFASDFASDFASD=")
@Size(min = 1, max = 44) @Size(max = 44)
private String integrityValue; private String integrityValue;
} }
@ -667,16 +670,17 @@ public class NiceCiDTO {
* *
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "사이트 코드", description = "공개키 요청시 수신한 사이트코드", example = " ") @Schema(requiredMode = RequiredMode.REQUIRED, title = "사이트 코드", description = "공개키 요청시 수신한 사이트코드", example = " ")
@Size(max = 16, message = "사이트 코드는 필수 입니다(max:16)") @NotEmpty(message = "사이트 코드는 필수 입니다(max:16)")
@Size(max = 16)
private String siteCode; private String siteCode;
/** /**
* : 1 - CI * : 1 - CI
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "정보요청유형", description = "정보요청유형", example = "1") @Schema(requiredMode = RequiredMode.REQUIRED, title = "정보요청유형", description = "정보요청유형", example = "1")
@Size(min = 1, max = 1, message = "정보요청유형은 필수 입니다(1:CI요청)") @NotEmpty(message = "정보요청유형은 필수 입니다(1:CI요청)")
@Default @Size(max = 1)
private String infoReqType = "1"; private final String infoReqType = "1";
/** /**
* 13 * 13
@ -689,7 +693,8 @@ public class NiceCiDTO {
* *
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "요청번호", description = "이용기관에서 서비스에 대한 요청거래를 확인하기 위한 고유값", example = " ") @Schema(requiredMode = RequiredMode.REQUIRED, title = "요청번호", description = "이용기관에서 서비스에 대한 요청거래를 확인하기 위한 고유값", example = " ")
@Size(min = 30, max = 30, message = "요청번호는 필수 입니다(30자리)") @NotEmpty(message = "요청번호는 필수 입니다(30자리)")
@Size(max = 30)
private String reqNo; private String reqNo;
/** /**
@ -707,7 +712,7 @@ public class NiceCiDTO {
private String clientIp; private String clientIp;
} }
@Schema(name = "IpinCiResEncData", description = "IPIN CI 등록 결과 enc_data JSON 속성") @Schema(name = "IpinCiResEncData", description = "IPIN CI 요청 결과 enc_data JSON 속성")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -805,14 +810,14 @@ public class NiceCiDTO {
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.AUTO, title = "TRAN_ID", example = "20230906120000") @Schema(requiredMode = RequiredMode.AUTO, title = "TRAN_ID", example = "20230906120000")
@Size(min = 0, max = 24, message = "TRAN_ID는 24자를 넘을 수 없습니다.") @Size(max = 24, message = "TRAN_ID는 24자를 넘을 수 없습니다.")
private String tranId; private String tranId;
/** /**
* CNTY_ID : return * CNTY_ID : return
*/ */
@Schema(requiredMode = RequiredMode.AUTO, title = "CNTY_ID", example = "kr") @Schema(requiredMode = RequiredMode.AUTO, title = "CNTY_ID", example = "kr")
@Size(min = 0, max = 2, message = "CNTY_ID는 2자를 넘을 수 없습니다.") @Size(max = 2, message = "CNTY_ID는 2자를 넘을 수 없습니다.")
private String cntyId; private String cntyId;
} }
@ -909,28 +914,6 @@ public class NiceCiDTO {
private String resultCd; private String resultCd;
} }
public String genSymkeyRegInfo() {
/*
final String requestNo = createRequestNo();
final String key = this.createKey();
final String iv = this.createIv();
final String hmacKey = this.createHmacKey();
*/
Map<String, String> m = new HashMap<>();
/*m.put("site_code", siteCode);
m.put("request_no", requestNo);
m.put("key", key);
m.put("iv", iv);
m.put("hmac_key", hmacKey);*/
final String jsonStr = JsonUtils.toJson(m);
//final String jsonStr = this.createMessage(pubkeyVersion, encSymkeyRegInfo(jsonStr, publicKey));
return JsonUtils.toJson(m);
}
/** /**
* Nice DTO * Nice DTO
*/ */

Loading…
Cancel
Save