46 lines
1.3 KiB
Java
46 lines
1.3 KiB
Java
package com.bccard.tsp.service;
|
|
|
|
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;
|
|
|
|
/**
|
|
* [카드 본인인증 이력 기본 매퍼 구현체]
|
|
* - MyBatis 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, "기타 오류");
|
|
}
|
|
}
|