feat: 문자발송 진행중

This commit is contained in:
hylee 2023-05-19 10:45:52 +09:00
parent e7b0d509e0
commit cd6ccecf54
3 changed files with 129 additions and 20 deletions

View File

@ -2,8 +2,7 @@ package com.itn.mjonApi.mjon.api.send.mapper.domain;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;
import lombok.Setter;
import lombok.*;
import org.springframework.http.ResponseEntity;
/**
@ -19,10 +18,13 @@ import org.springframework.http.ResponseEntity;
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MjonResponseVO {
private String message;
private String result;
private String message;
private String resultSts; // 전송결과 갯수
private String resultBlockSts; // 수신거부 갯수
private String msgGroupId;

View File

@ -1,5 +1,7 @@
package com.itn.mjonApi.mjon.api.send.mapper.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@ -22,6 +24,7 @@ import java.io.Serializable;
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "문자 발송에 필요한 값들을 받는 vo")
public class MsgRequestVO implements Serializable {
/**
@ -31,39 +34,83 @@ public class MsgRequestVO implements Serializable {
*/
private static final long serialVersionUID = 1L;
private String smsTxt; // 'SMS용 메시지본문',
private String[] callToList; // '수신번호리스트',
private String callFrom; // '발신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)',
@ApiModelProperty(value = "사용자 ID", example = "goodgkdus", required = true)
private String mberId;
private String eachPrice="0"; // 전송문자 개별가격
private String totPrice="0"; // 전송문자 토탈가격
@ApiModelProperty(value = "Api Key", example = "0367a25ec370d1141898a0b9767103", required = true)
private String accessKey;
private String fileCnt="0"; // 첨부파일 갯수
@ApiModelProperty(value = "SMS용 메시지본문", example = "문자 메세지 본문", required = true)
private String smsTxt;
@ApiModelProperty(value = "수신번호리스트", dataType = "[Ljava.lang.String;", example = "01011112222,01022223333", required = true)
private String[] callToList;
@ApiModelProperty(value = "발신번호 :: 정책이 필요함", example = "01011112222", required = true)
private String callFrom;
@ApiModelProperty(value = "전송문자 개별가격", example = "0", hidden = true)
private String eachPrice="0";
@ApiModelProperty(value = "전송문자 토탈가격", example = "0", hidden = true)
private String totPrice="0";
@ApiModelProperty(value = "첨부파일 갯수", example = "0", hidden = true)
private String fileCnt="0";
@ApiModelProperty(value = "메시지의 (4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)", example = "4", hidden = true)
private String msgType="4";
private String msgType="4"; // '메시지의 (4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)',
// ==== 단가 ====
private float smsPrice=0; // sms 단가 null 이면 에러
private float mmsPrice=0; // mms 단가 null 이면 에러
@ApiModelProperty(value = "sms 단가 null 이면 에러", example = "0", hidden = true)
private float smsPrice=0;
@ApiModelProperty(value = "mms 단가 null 이면 에러", example = "0", hidden = true)
private float mmsPrice=0;
// private float kakaoAtPrice; // 카카오 알림톡 단가
// private float kakaoFtPrice; // 카카오 친구톡 단가
// private float kakaoFtImgPrice;// 카카오 이미지 단가
// private float kakaoFtWideImgPrice; // 카카오 와이드 이미지 단가
private String[] imgFilePath = new String[0]; // 그림 이미지 경로
@ApiModelProperty(value = "그림 이미지 경로", example = "new String[0]", hidden = true)
private String[] imgFilePath = new String[0];
private String spamStatus; // 스팸문자 유무 (Y/N)
@ApiModelProperty(value = "스팸문자 유무 (Y/N) - 서비스단에서 처리 함", example = "", hidden = true)
private String spamStatus;
private String txtReplYn="N"; // 변환문자 유무 (Y/N)
@ApiModelProperty(value = "변환문자 유무 (Y/N) - 서비스단에서 처리 함", example = "N", hidden = true)
private String txtReplYn="N";
private String[] nameList; // '치환 이름 리스트'
private String[] rep1List; // '치환 문자1 리스트'
private String[] rep2List; // '치환 문자2 리스트'
private String[] rep3List; // '치환 문자3 리스트'
private String[] rep4List; // '치환 문자4 리스트'
@ApiModelProperty(value = "치환 이름 리스트 |로 구분", example = "홍길동1|홍길동2|홍길동3")
private String nameStr;
@ApiModelProperty(value = "치환 문자1 리스트 |로 구분", example = "")
private String rep1Str;
@ApiModelProperty(value = "치환 문자2 리스트 |로 구분", example = "")
private String rep2Str;
@ApiModelProperty(value = "치환 문자3 리스트 |로 구분", example = "")
private String rep3Str;
@ApiModelProperty(value = "치환 문자4 리스트 |로 구분", example = "")
private String rep4Str;
@ApiModelProperty(value = "nameStr 을 |로 split 후 담는 변수", example = "", hidden = true)
private String[] nameList;
@ApiModelProperty(value = "rep1Str 을 |로 split 후 담는 변수", example = "", hidden = true)
private String[] rep1List;
@ApiModelProperty(value = "rep2Str 을 |로 split 후 담는 변수", example = "", hidden = true)
private String[] rep2List;
@ApiModelProperty(value = "rep3Str 을 |로 split 후 담는 변수", example = "", hidden = true)
private String[] rep3List;
@ApiModelProperty(value = "rep4Str 을 |로 split 후 담는 변수", example = "", hidden = true)
private String[] rep4List;
@ApiModelProperty(value = "예약 유무 (Y/N)", example = "N", hidden = true)
private String reserveYn="N"; // 예약문자 여부 default N
// 치환 있을 경우 사용
@ApiModelProperty(value = "치환 후 단문 건수", example = "", hidden = true)
private String shortMsgCnt;
@ApiModelProperty(value = "치환 후 장문 건수", example = "", hidden = true)
private String longMsgCnt;
// private String msgId ;// '문자ID',
// private String userId ; // '문자온 일반회원ID',

View File

@ -0,0 +1,60 @@
package com.itn.mjonApi.util;
import org.apache.commons.lang3.StringUtils;
/**
* packageName : com.itn.mjonApi.util
* fileName : SendUtil
* author : hylee
* date : 2023-05-17
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-17 hylee 최초 생성
*/
public class MunjaUtil {
/**
* 폰번호 유효성 검사
* @param callTo
* @return
*/
public static Boolean validatePNumWithRegex(String callTo){
// 핸드폰 정규식
String regex = "^01(?:0|1|[6-9])(?:\\d{3}|\\d{4})\\d{4}$";
return callTo.matches(regex) ? true : false;
}
/**
* 폰번호 빈값 검사
* @param str
* @return
*/
public static Boolean checkPhoneNumberEmpty(String str){
return StringUtils.isEmpty(str) ? false : true;
}
public static String replaceCommaToStrSymbol(String name) {
return name.replaceAll(",", "§");
}
/**
* 파라미터를 String 타입으로 가져옵니다.<br>
* - null일 경우 문자열을 가져옵니다.<br>
* Get String(if object is null, return empty string).
* @param Object
* @return String
*/
public static String getString(Object obj) {
if (obj == null)
return "";
else
return String.valueOf(obj);
}
}