--- src/main/java/itn/com/cmm/util/MsgSendUtils.java
+++ src/main/java/itn/com/cmm/util/MsgSendUtils.java
... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 |
import itn.com.cmm.OptimalMsgResultDTO; |
| 24 | 24 |
import itn.let.mail.service.StatusResponse; |
| 25 | 25 |
import itn.let.mjo.event.service.MjonEventVO; |
| 26 |
+import itn.let.mjo.mjocommon.MjonCommon; |
|
| 26 | 27 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 27 | 28 |
import itn.let.mjo.msgagent.service.MjonMsgAgentStsVO; |
| 28 | 29 |
import itn.let.mjo.spammsg.web.ComGetSpamStringParser; |
... | ... | @@ -55,26 +56,6 @@ |
| 55 | 56 |
// 이벤트 최저 잔액 |
| 56 | 57 |
public static final double MIN_EVENT_REMAIN_CASH = 7.5; // 이벤트 최소 잔액 |
| 57 | 58 |
|
| 58 |
- /** |
|
| 59 |
- * @methodName : getSmsTxtBytes |
|
| 60 |
- * @author : 이호영 |
|
| 61 |
- * @date : 2024.09.23 |
|
| 62 |
- * @description : sms 텍스트 바이트 계산 후 return; |
|
| 63 |
- * @param smsTxt |
|
| 64 |
- * @return |
|
| 65 |
- * @throws UnsupportedEncodingException |
|
| 66 |
- */ |
|
| 67 |
- public static int getSmsTxtBytes(String smsTxt) throws UnsupportedEncodingException { //문자열 길이 체크 해주기
|
|
| 68 |
- int smsBytes = 0; |
|
| 69 |
- //문자 바이트 계산에 필요한 캐릭터 셋 : 한글 2Byte로 계산 |
|
| 70 |
- String charset = "euc-kr"; |
|
| 71 |
- if(StringUtils.isNotEmpty(smsTxt)) {
|
|
| 72 |
- String smsCont = smsTxt.replace("\r\n", "\n");
|
|
| 73 |
- smsBytes = smsCont.getBytes(charset).length; |
|
| 74 |
- } |
|
| 75 |
-// log.info(" + smsBytes :: [{}]", smsBytes);
|
|
| 76 |
- return smsBytes; |
|
| 77 |
- } |
|
| 78 | 59 |
|
| 79 | 60 |
/** |
| 80 | 61 |
* @methodName : getMsgType |
... | ... | @@ -96,7 +77,7 @@ |
| 96 | 77 |
// msgType = "4"; |
| 97 | 78 |
// } |
| 98 | 79 |
|
| 99 |
- int smsTxtByte = getSmsTxtBytes(p_smsTxt); |
|
| 80 |
+ int smsTxtByte = MjonCommon.getSmsTxtBytes(p_smsTxt); |
|
| 100 | 81 |
String msgType = SHORT_MSG_TYPE; |
| 101 | 82 |
|
| 102 | 83 |
// 1. 2000 Byte 초과는 에러 처리 |
--- src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
+++ src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 |
package itn.let.mjo.mjocommon; |
| 2 | 2 |
|
| 3 | 3 |
import java.io.IOException; |
| 4 |
+import java.io.UnsupportedEncodingException; |
|
| 4 | 5 |
import java.text.SimpleDateFormat; |
| 5 | 6 |
import java.util.Calendar; |
| 6 | 7 |
import java.util.Date; |
... | ... | @@ -712,7 +713,26 @@ |
| 712 | 713 |
} |
| 713 | 714 |
|
| 714 | 715 |
|
| 715 |
- |
|
| 716 |
+ /** |
|
| 717 |
+ * @methodName : getSmsTxtBytes |
|
| 718 |
+ * @author : 이호영 |
|
| 719 |
+ * @date : 2024.09.23 |
|
| 720 |
+ * @description : sms 텍스트 바이트 계산 후 return; |
|
| 721 |
+ * @param smsTxt |
|
| 722 |
+ * @return |
|
| 723 |
+ * @throws UnsupportedEncodingException |
|
| 724 |
+ */ |
|
| 725 |
+ public static int getSmsTxtBytes(String smsTxt) throws UnsupportedEncodingException { //문자열 길이 체크 해주기
|
|
| 726 |
+ int smsBytes = 0; |
|
| 727 |
+ //문자 바이트 계산에 필요한 캐릭터 셋 : 한글 2Byte로 계산 |
|
| 728 |
+ String charset = "euc-kr"; |
|
| 729 |
+ if(org.apache.commons.lang3.StringUtils.isNotEmpty(smsTxt)) {
|
|
| 730 |
+ String smsCont = smsTxt.replace("\r\n", "\n");
|
|
| 731 |
+ smsBytes = smsCont.getBytes(charset).length; |
|
| 732 |
+ } |
|
| 733 |
+// log.info(" + smsBytes :: [{}]", smsBytes);
|
|
| 734 |
+ return smsBytes; |
|
| 735 |
+ } |
|
| 716 | 736 |
|
| 717 | 737 |
|
| 718 | 738 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?