fix: date format ApiConstants 상수로 처리 반영

dev
gitea-관리자 1 year ago
parent 7bfe619164
commit 627e4d70bb

@ -92,7 +92,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
private static final String SNDNG_PROCESS_STTUS = "sndngProcessSttus"; private static final String SNDNG_PROCESS_STTUS = "sndngProcessSttus";
private static final String UNITY_SNDNG_MST_ID = "unitySndngMastrId"; private static final String UNITY_SNDNG_MST_ID = "unitySndngMastrId";
private static final String YMDHMS = "yyyyMMddHHmmss"; private static final String YMDHMS = ApiConstants.FMT_DT_EMPTY_DLT;
/** /**
* <pre> * <pre>

@ -1,5 +1,6 @@
package egovframework.com.cmm.util; package egovframework.com.cmm.util;
import com.ibm.icu.util.ChineseCalendar;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -10,15 +11,13 @@ import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
import kr.xit.biz.common.ApiConstants;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.ibm.icu.util.ChineseCalendar;
/** /**
* *
* Date Util * Date Util
@ -96,7 +95,7 @@ public class EgovDateUtil {
String dateStr = validChkDateHMS(sDate); String dateStr = validChkDateHMS(sDate);
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()); SimpleDateFormat sdf = new SimpleDateFormat(ApiConstants.FMT_DT_EMPTY_DLT, Locale.getDefault());
try { try {
cal.setTime(sdf.parse(dateStr)); cal.setTime(sdf.parse(dateStr));
} catch (ParseException e) { } catch (ParseException e) {
@ -316,9 +315,9 @@ public class EgovDateUtil {
return ""; return "";
} }
if (EgovStringUtil.isNullToString(fromDateFormat).trim().equals("")) if (EgovStringUtil.isNullToString(fromDateFormat).trim().equals(""))
_fromDateFormat = "yyyyMMddHHmmss"; // default값 _fromDateFormat = ApiConstants.FMT_DT_EMPTY_DLT; // default값
if (EgovStringUtil.isNullToString(toDateFormat).trim().equals("")) if (EgovStringUtil.isNullToString(toDateFormat).trim().equals(""))
_toDateFormat = "yyyy-MM-dd HH:mm:ss"; // default값 _toDateFormat = ApiConstants.FMT_DT_STD; // default값
try { try {
simpledateformat = new SimpleDateFormat(_fromDateFormat, Locale.getDefault()); simpledateformat = new SimpleDateFormat(_fromDateFormat, Locale.getDefault());

@ -24,6 +24,16 @@ public class ApiConstants {
public static final String PROFILE = System.getProperty("spring.profiles.active"); public static final String PROFILE = System.getProperty("spring.profiles.active");
public static final String FFNLN_CODE = "11"; public static final String FFNLN_CODE = "11";
/**
* date-time
*/
public static final String FMT_DT_EMPTY_DLT = ApiConstants.FMT_DT_EMPTY_DLT;
/**
* date-time
*/
public static final String FMT_DT_STD = ApiConstants.FMT_DT_STD;
/** /**
* <pre> * <pre>
* *

@ -11,7 +11,6 @@ import javax.validation.Valid;
import javax.validation.constraints.Digits; import javax.validation.constraints.Digits;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse; import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse;
import kr.xit.core.support.utils.DateUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -912,10 +911,11 @@ public class KtMmsSendDTO {
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "모바일사업자구분", example = "01") @Schema(requiredMode = RequiredMode.REQUIRED, title = "모바일사업자구분", example = "01")
@Size(min = 2, max = 2, message = "모바일 사업자 구분은 필수 입니다(01|02|03)") @Size(min = 2, max = 2, message = "모바일 사업자 구분은 필수 입니다(01|02|03)")
private final String mblBzowrDvcd = "01"; private String mblBzowrDvcd;
/** /**
* <pre> * <pre>
* TODO::
* : - 2 * : - 2
* 40 MMS/RCS * 40 MMS/RCS
* 41 MMS * 41 MMS
@ -951,7 +951,7 @@ public class KtMmsSendDTO {
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "발송타임스탬프", example = "20241030121000") @Schema(requiredMode = RequiredMode.REQUIRED, title = "발송타임스탬프", example = "20241030121000")
@Size(min = 14, max = 14, message = "발송타임스탬프는 필수 입니다(YYYYMMDDHHMISS)") @Size(min = 14, max = 14, message = "발송타임스탬프는 필수 입니다(YYYYMMDDHHMISS)")
private final String mmsSndgTmst = DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"); private String mmsSndgTmst;
/** /**
* <pre> * <pre>
@ -961,7 +961,7 @@ public class KtMmsSendDTO {
*/ */
@Schema(requiredMode = RequiredMode.REQUIRED, title = "발송 메시지 타입", example = "2") @Schema(requiredMode = RequiredMode.REQUIRED, title = "발송 메시지 타입", example = "2")
@Size(min = 1, max = 1, message = "발송 메시지 타입은 필수 입니다") @Size(min = 1, max = 1, message = "발송 메시지 타입은 필수 입니다")
private final String msgType = "2"; private String msgType;
//------------------------------------------------------------------- //-------------------------------------------------------------------
/** /**
@ -1057,6 +1057,13 @@ public class KtMmsSendDTO {
@Schema(requiredMode = RequiredMode.AUTO, title = "RCS 발송 여부", example = "N") @Schema(requiredMode = RequiredMode.AUTO, title = "RCS 발송 여부", example = "N")
@Size(max = 1, message = "RCS 발송 여부는 1자리 입니다(Y|N)") @Size(max = 1, message = "RCS 발송 여부는 1자리 입니다(Y|N)")
private String rcyYn; private String rcyYn;
/**
* API :
*/
@Schema(requiredMode = RequiredMode.AUTO, title = "발송결과코드메세지", example = "MMS/RCS 발송 수신성공")
@Size(max = 100, message = "발송결과코드메세지는 100자를 넘을 수 없습니다")
private String mmsSndgRsltDvcdMsg;
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------
} }

@ -1,5 +1,24 @@
package kr.xit.core.spring.config.custom.bouncy; package kr.xit.core.spring.config.custom.bouncy;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.InvalidParameterException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
import javax.crypto.Cipher;
import kr.xit.biz.common.ApiConstants;
import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.support.utils.DateUtils; import kr.xit.core.support.utils.DateUtils;
import kr.xit.core.support.utils.FileUtil; import kr.xit.core.support.utils.FileUtil;
@ -12,18 +31,6 @@ import org.bouncycastle.util.io.pem.PemObject;
import org.bouncycastle.util.io.pem.PemReader; import org.bouncycastle.util.io.pem.PemReader;
import xit.core.init.custom.bouncy.BouncyDecUtils; import xit.core.init.custom.bouncy.BouncyDecUtils;
import javax.crypto.Cipher;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
/** /**
* <pre> * <pre>
* description : DSA / / Utils * description : DSA / / Utils
@ -288,7 +295,7 @@ public class BouncyUtils {
//BouncyFileHelper.decryptionFile(key, path); //BouncyFileHelper.decryptionFile(key, path);
long expiredDate = DateUtils.parseStringToLong("20991231135959", "yyyyMMddHHmmss"); long expiredDate = DateUtils.parseStringToLong("20991231135959", ApiConstants.FMT_DT_EMPTY_DLT);
String ip = "211.119.124.9";// IpMacUtils.getIpAddress(); String ip = "211.119.124.9";// IpMacUtils.getIpAddress();
//String ip = "211.119.124.73";// local ip //String ip = "211.119.124.73";// local ip
long curDate = DateUtils.getLongTodayAndNowTime(); long curDate = DateUtils.getLongTodayAndNowTime();

Loading…
Cancel
Save