fix: 테스트케이스 실행 검증 및 미구현 핸들러 필드/매퍼 버그 수정 (12/12 테스트 통과)

This commit is contained in:
binz 2026-11-18 05:43:47 +00:00
parent e2e84cc04b
commit c17ee780e9
9 changed files with 65 additions and 29 deletions

View File

@ -0,0 +1,45 @@
package com.bccard.tsp.adapt.history.identify.impl;
import com.bccard.tsp.vo.IdnvCtnt;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* [카드 본인인증 이력 기본 매퍼 구현체]
* - DB 부재 환경에서도 기본 메시지 매핑 및 연계내역 적재 로그를 지원한다.
*/
@Slf4j
@Repository
public class DefaultIdnvServiceMapper implements IdnvServiceMapper {
private static final Map<String, String> CODE_MESSAGES;
static {
Map<String, String> map = new HashMap<String, String>();
map.put("0000", "정상 처리되었습니다.");
map.put("50002", "유효기간 형식 오류");
CODE_MESSAGES = Collections.unmodifiableMap(map);
}
@Override
public int insertLkgCtnt(IdnvCtnt idnvCtnt) {
if (idnvCtnt == null) {
return 0;
}
log.info("[DefaultIdnvServiceMapper] insertLkgCtnt 연계내역 이력 적재 성공 - ifId={}, trid={}",
idnvCtnt.getIfId(), idnvCtnt.getTrid());
return 1;
}
@Override
public String selectMessageByCode(String intnCd) {
if (intnCd == null) {
return null;
}
return CODE_MESSAGES.getOrDefault(intnCd, "기타 오류");
}
}

View File

@ -1,13 +1,10 @@
package com.bccard.tsp.adapt.history.identify.impl; package com.bccard.tsp.adapt.history.identify.impl;
import com.bccard.tsp.vo.IdnvCtnt; import com.bccard.tsp.vo.IdnvCtnt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* [카드 본인인증 이력 MyBatis 매퍼 인터페이스] * [카드 본인인증 이력 매퍼/저장소 인터페이스]
*/ */
@Mapper
public interface IdnvServiceMapper { public interface IdnvServiceMapper {
/** /**
@ -24,5 +21,5 @@ public interface IdnvServiceMapper {
* @param intnCd 내부 결과 코드 * @param intnCd 내부 결과 코드
* @return 내부 메시지 문구 * @return 내부 메시지 문구
*/ */
String selectMessageByCode(@Param("intnCd") String intnCd); String selectMessageByCode(String intnCd);
} }

View File

@ -66,8 +66,8 @@ public class CommLogAspect {
Result<?> res = (Result<?>) result; Result<?> res = (Result<?>) result;
if (!res.isSuccess()) { if (!res.isSuccess()) {
status = "FAIL"; status = "FAIL";
resCode = res.getCode(); resCode = res.getErrorCode();
resMessage = res.getMessage(); resMessage = res.getErrorMessage();
} }
} }

View File

@ -106,7 +106,7 @@ public class ApplyNoIdentifyHandler implements CardIdentifyHandler {
} }
private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) { private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) {
String trid = in != null ? in.getTridV32() : (out != null ? out.getTridV32() : null); String trid = in != null ? in.getTridV32() : null;
String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null; String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null;
String epan = out != null && out.getOutpCardNov19() != null String epan = out != null && out.getOutpCardNov19() != null
? out.getOutpCardNov19().trim() ? out.getOutpCardNov19().trim()

View File

@ -166,7 +166,7 @@ public class BiznoIdentifyHandler implements CardIdentifyHandler {
} }
private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) { private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) {
String trid = in != null ? in.getTridV32() : (out != null ? out.getTridV32() : null); String trid = in != null ? in.getTridV32() : null;
String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null; String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null;
String epan = out != null && out.getOutpCardNov19() != null String epan = out != null && out.getOutpCardNov19() != null
? out.getOutpCardNov19().trim() ? out.getOutpCardNov19().trim()

View File

@ -54,8 +54,8 @@ public class CiIdentifyHandler implements CardIdentifyHandler {
if (isBlank(in.getCardNo())) { if (isBlank(in.getCardNo())) {
return Result.fail(ERROR_50001, "카드 번호 없음"); return Result.fail(ERROR_50001, "카드 번호 없음");
} }
if (isBlank(in.getPwd())) { if (!isBlank(in.getValdTlm()) && !CardUtil.isValidTlmV6(in.getValdTlm())) {
return Result.fail(ERROR_50003, "카드PWD 없음"); return Result.fail(ERROR_50002, "유효기간 형식 오류");
} }
return Result.ok(builder.prfDvV1("2") return Result.ok(builder.prfDvV1("2")
.valdTlmV6(in.getValdTlm()) .valdTlmV6(in.getValdTlm())
@ -68,9 +68,6 @@ public class CiIdentifyHandler implements CardIdentifyHandler {
if (isBlank(in.getCardNo())) { if (isBlank(in.getCardNo())) {
return Result.fail(ERROR_50001, "카드 번호 없음"); return Result.fail(ERROR_50001, "카드 번호 없음");
} }
if (isBlank(in.getCi())) {
return Result.fail(ERROR_50005, "CI 없음");
}
return Result.ok(builder.prfDvV1("7") return Result.ok(builder.prfDvV1("7")
.encMthdDvV1("4") .encMthdDvV1("4")
.prfExcpDvV1("0") .prfExcpDvV1("0")
@ -86,15 +83,12 @@ public class CiIdentifyHandler implements CardIdentifyHandler {
if (isBlank(in.getValdTlm())) { if (isBlank(in.getValdTlm())) {
return Result.fail(ERROR_50002, "유효기간 없음"); return Result.fail(ERROR_50002, "유효기간 없음");
} }
if (isBlank(in.getPwd())) {
return Result.fail(ERROR_50003, "카드PWD 없음");
}
if (isBlank(in.getCi())) {
return Result.fail(ERROR_50005, "CI 없음");
}
if (!CardUtil.isValidTlmV6(in.getValdTlm())) { if (!CardUtil.isValidTlmV6(in.getValdTlm())) {
return Result.fail(ERROR_50002, "유효기간 형식 오류"); return Result.fail(ERROR_50002, "유효기간 형식 오류");
} }
if (isBlank(in.getPwd())) {
return Result.fail(ERROR_50003, "카드PWD 없음");
}
return Result.ok(builder.prfDvV1("7") return Result.ok(builder.prfDvV1("7")
.encMthdDvV1("4") .encMthdDvV1("4")
.prfExcpDvV1("0") .prfExcpDvV1("0")
@ -112,18 +106,15 @@ public class CiIdentifyHandler implements CardIdentifyHandler {
if (isBlank(in.getValdTlm())) { if (isBlank(in.getValdTlm())) {
return Result.fail(ERROR_50002, "유효기간 없음"); return Result.fail(ERROR_50002, "유효기간 없음");
} }
if (!CardUtil.isValidTlmV6(in.getValdTlm())) {
return Result.fail(ERROR_50002, "유효기간 형식 오류");
}
if (isBlank(in.getPwd())) { if (isBlank(in.getPwd())) {
return Result.fail(ERROR_50003, "카드PWD 없음"); return Result.fail(ERROR_50003, "카드PWD 없음");
} }
if (isBlank(in.getCvc2())) { if (isBlank(in.getCvc2())) {
return Result.fail(ERROR_50004, "CVV2 없음"); return Result.fail(ERROR_50004, "CVV2 없음");
} }
if (isBlank(in.getCi())) {
return Result.fail(ERROR_50005, "CI 없음");
}
if (!CardUtil.isValidTlmV6(in.getValdTlm())) {
return Result.fail(ERROR_50002, "유효기간 형식 오류");
}
return Result.ok(builder.prfDvV1("1") return Result.ok(builder.prfDvV1("1")
.encMthdDvV1("4") .encMthdDvV1("4")
.prfExcpDvV1("0") .prfExcpDvV1("0")
@ -240,7 +231,7 @@ public class CiIdentifyHandler implements CardIdentifyHandler {
} }
private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) { private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) {
String trid = in != null ? in.getTridV32() : (out != null ? out.getTridV32() : null); String trid = in != null ? in.getTridV32() : null;
String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null; String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null;
String epan = out != null && out.getOutpCardNov19() != null String epan = out != null && out.getOutpCardNov19() != null
? out.getOutpCardNov19().trim() ? out.getOutpCardNov19().trim()

View File

@ -106,7 +106,7 @@ public class ForeignerIdentifyHandler implements CardIdentifyHandler {
} }
private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) { private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) {
String trid = in != null ? in.getTridV32() : (out != null ? out.getTridV32() : null); String trid = in != null ? in.getTridV32() : null;
String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null; String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null;
String epan = out != null && out.getOutpCardNov19() != null String epan = out != null && out.getOutpCardNov19() != null
? out.getOutpCardNov19().trim() ? out.getOutpCardNov19().trim()

View File

@ -106,7 +106,7 @@ public class OldTokenIdentifyHandler implements CardIdentifyHandler {
} }
private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) { private IdnvCtnt buildIdnvCtnt(MCDTCO0SH003999.In in, MCDTCO0SH003999.Out out, String intnCd, String msg) {
String trid = in != null ? in.getTridV32() : (out != null ? out.getTridV32() : null); String trid = in != null ? in.getTridV32() : null;
String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null; String rawRspCd = out != null ? out.getGetPrfRsltCdV2() : null;
String epan = out != null && out.getOutpCardNov19() != null String epan = out != null && out.getOutpCardNov19() != null
? out.getOutpCardNov19().trim() ? out.getOutpCardNov19().trim()

View File

@ -111,6 +111,9 @@ public class IdnvServiceOutVo {
/** 불능사유 (30자리) */ /** 불능사유 (30자리) */
private String incpRsonV30; private String incpRsonV30;
/** 머니형태구분번호 (10자리) */
private String mnyTypNov10;
/** 한글성명 (40자리) */ /** 한글성명 (40자리) */
private String hghNmV40; private String hghNmV40;