feat: NICE CI 전문 처리 반영

-> 한글 2, 그외 1 자리로 처리 하도록 반영
      -> name, message 필드
dev
Jonguk. Lim 2 months ago
parent 462f03d932
commit 4007291d3f

@ -50,9 +50,9 @@ public class NiceCiDTO {
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ")
@Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.")
private String trCode = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE);
private String trCode = StringUtils.EMPTY;
public void setTrCode(String trCode) {
this.trCode = StringUtils.rightPad(nvl(trCode), 10, StringUtils.SPACE);
this.trCode = StringUtils.leftPad(nvl(trCode), 10, StringUtils.SPACE);
}
//----------------------------------------------------------------------------------------------
@ -232,7 +232,7 @@ public class NiceCiDTO {
public String ofString() {
StringBuilder sb = new StringBuilder();
sb.append(trCode);
//sb.append(trCode);
// 공통부
sb.append(niceCommon.ofString());
sb.append(commonEmptyField);
@ -252,7 +252,8 @@ public class NiceCiDTO {
sb.append(queryRequests.stream().map(QueryRequest::ofString).collect(Collectors.joining()));
sb.append(buttonRequests.stream().map(ButtonRequest::ofString).collect(Collectors.joining()));
// FIXME: 인코딩확인후 적용
return NiceCiUtils.covertCharset(sb.toString(), "EUC-KR");
//return NiceCiUtils.covertCharset(sb.toString(), "EUC-KR");
return sb.toString();
}
// public Request parse(String tgtStr) {
@ -649,7 +650,7 @@ public class NiceCiDTO {
public static void main(String[] args) {
NiceCiDTO.Request ciRequest = new NiceCiDTO.Request();
ciRequest.setTrCode("0000006150");
//ciRequest.setTrCode("0000006150");
// // 공통부
//
// // 개별요청부
@ -698,8 +699,9 @@ public class NiceCiDTO {
ciRequest.getButtonRequests().add(br);
// nc.setNiceMngNo(StringUtils.EMPTY);
// nc.setNiceSndDt(StringUtils.EMPTY);
String fullText = ciRequest.ofString();
System.out.println(String.format("[%s] %d", fullText, fullText.length()));
String ciTxt = ciRequest.ofString();
String ft = String.format("%s%s", StringUtils.leftPad(String.valueOf(NiceCiUtils.lengthKr(ciTxt)), 10, "0"), ciTxt);
System.out.println(String.format("[%s] kr length - %d, utf-8 length - %d", ft, NiceCiUtils.lengthKr(ft), ft.length()));

@ -50,9 +50,9 @@ public class NiceCiHistoryDTO {
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ")
@Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.")
private String trCode = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE);
private String trCode = StringUtils.EMPTY;
public void setTrCode(String trCode) {
this.trCode = StringUtils.rightPad(nvl(trCode), 10, StringUtils.SPACE);
this.trCode = StringUtils.leftPad(nvl(trCode), 10, StringUtils.SPACE);
}
//----------------------------------------------------------------------------------------------

Loading…
Cancel
Save