Merge branch 'hylee'
This commit is contained in:
commit
b7f557e941
@ -1,12 +1,12 @@
|
||||
package com.itn.mjonApi.cmn.config;
|
||||
|
||||
import com.itn.mjonApi.cmn.interceptor.CertifInterceptor;
|
||||
import com.itn.mjonApi.cmn.interceptor.SendInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import com.itn.mjonApi.cmn.interceptor.CertifInterceptor;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.mjon.send.web
|
||||
* fileName : SendRestController
|
||||
@ -26,16 +26,25 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
public CertifInterceptor certifInterceptor(){
|
||||
return new CertifInterceptor();
|
||||
}
|
||||
@Bean
|
||||
public SendInterceptor sendInterceptor(){
|
||||
return new SendInterceptor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
|
||||
/**
|
||||
* order(int) -> 숫자가 낮을 수록 우선순위가 높다.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 모든 api 요청에 대한 key 인증 밑 lettnloginlog Insert
|
||||
*/
|
||||
registry.addInterceptor(certifInterceptor())
|
||||
.addPathPatterns("/api/**")
|
||||
.excludePathPatterns("/api/accessTest/**")
|
||||
.addPathPatterns("/api/**")
|
||||
.excludePathPatterns("/api/accessTest/**")
|
||||
.order(0)
|
||||
;
|
||||
|
||||
/**
|
||||
@ -43,9 +52,10 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
* send에 대한 interceptor 설정 - lettngnrlmber_access_log Insert
|
||||
* 진행중
|
||||
*/
|
||||
// registry.addInterceptor(certifInterceptor())
|
||||
// .addPathPatterns("/api/send/**")
|
||||
// ;
|
||||
registry.addInterceptor(sendInterceptor())
|
||||
.addPathPatterns("/api/send/**")
|
||||
.order(1)
|
||||
;
|
||||
//.excludePathPatterns("/css/**", "/images/**", "/js/**");
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public class ContextIdgen {
|
||||
* @discription apiLog Ids
|
||||
* @return
|
||||
*/
|
||||
@Bean(name="apiLog")
|
||||
@Bean(name="apiLoginLog")
|
||||
public IdgenServiceImpl apiLog(){
|
||||
IdgenServiceImpl idgenServiceImpl = new IdgenServiceImpl();
|
||||
idgenServiceImpl.setCipers(13); // cipers: prefix를 제외한 아이디의 길이 지정
|
||||
@ -34,5 +34,19 @@ public class ContextIdgen {
|
||||
idgenServiceImpl.setTableName("API_LOG_ID"); // tableName - dataSoure 에 설정된 DB에 SEQ 테이블에 tableName 컬럼에 참조할 값
|
||||
return idgenServiceImpl;
|
||||
}
|
||||
/**
|
||||
* @discription apiLog Ids
|
||||
* @return
|
||||
*/
|
||||
@Bean(name="apiAccessLog")
|
||||
public IdgenServiceImpl apiAccessLog(){
|
||||
IdgenServiceImpl idgenServiceImpl = new IdgenServiceImpl();
|
||||
idgenServiceImpl.setCipers(10); // cipers: prefix를 제외한 아이디의 길이 지정
|
||||
idgenServiceImpl.setFillChar('0'); // fillChar: 0을 대신하여 표현되는 문자
|
||||
// idgenServiceImpl.setPrefix("APILOG_"); // prefix: 아이디의 앞에 고정적으로 붙이고자 하는 설정값 지정
|
||||
idgenServiceImpl.setPrefix("APIACCLOG_"); // prefix: 아이디의 앞에 고정적으로 붙이고자 하는 설정값 지정
|
||||
idgenServiceImpl.setTableName("API_ACCESS_LOG_ID"); // tableName - dataSoure 에 설정된 DB에 SEQ 테이블에 tableName 컬럼에 참조할 값
|
||||
return idgenServiceImpl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public class CertifInterceptor implements HandlerInterceptor{
|
||||
@Autowired
|
||||
private LettnLoginLogService lettnLoginLogService;
|
||||
|
||||
@Resource(name = "apiLog")
|
||||
@Resource(name = "apiLoginLog")
|
||||
private IdgenService idgenApiLogId;
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,128 @@
|
||||
package com.itn.mjonApi.cmn.interceptor;
|
||||
|
||||
//import java.sql.Date;
|
||||
|
||||
import com.itn.mjonApi.cmn.idgen.service.IdgenService;
|
||||
import com.itn.mjonApi.mjon.log.service.LettnAccessLogService;
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnAccessLogVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.mjon.send.web
|
||||
* fileName : SendRestController
|
||||
* author : hylee
|
||||
* date : 2023-02-15
|
||||
* description :
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* -----------------------------------------------------------
|
||||
* 2023-02-15 hylee 최초 생성
|
||||
*/
|
||||
//@Component
|
||||
@Slf4j
|
||||
public class SendInterceptor implements HandlerInterceptor{
|
||||
|
||||
|
||||
@Autowired
|
||||
private LettnAccessLogService lettnAccessLogService;
|
||||
|
||||
@Resource(name = "apiAccessLog")
|
||||
private IdgenService idgenApiAccessLogId;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws Exception {
|
||||
log.debug("=========== SendInterceptor preHandle()============");
|
||||
|
||||
|
||||
{
|
||||
try {
|
||||
|
||||
// TODO accessType 구분추가
|
||||
LettnAccessLogVO lettnAccessLogVO = new LettnAccessLogVO()
|
||||
.builder()
|
||||
.logId(idgenApiAccessLogId.getNextStringId())
|
||||
.accessType("K") // key : K , token : T
|
||||
.accessKey(request.getParameter("accessKey"))
|
||||
.reqUserId(request.getParameter("mberId"))
|
||||
.reqCn("문자 전송")
|
||||
.reqInfoRef(request.getParameter("Referer"))
|
||||
.reqUrl(request.getRequestURI())
|
||||
.build();
|
||||
|
||||
//IP 컬럼 길이를 늘려서 비교 조건 제거함 2023-04-05
|
||||
if (lettnAccessLogVO.getReqUrl().length() > 200) { //길이문제로 오류가 발생하는 경우도 처리하도록 수정
|
||||
lettnAccessLogVO.setReqUrl(lettnAccessLogVO.getReqUrl().substring(0, 199));
|
||||
}
|
||||
|
||||
lettnAccessLogService.insert(lettnAccessLogVO);
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
|
||||
//내부 오류
|
||||
this._jsonResult(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
|
||||
ModelAndView modelAndView) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
System.out.println("===== SendInterceptor postHandle apikey ==");
|
||||
|
||||
System.out.println("modelAndView.getModel() : "+ modelAndView);
|
||||
|
||||
|
||||
// Get the request returned VO by the controller
|
||||
if(modelAndView != null){
|
||||
Object obj = modelAndView.getModel().get("mjonResponseVO");
|
||||
System.out.println("obj : "+ obj);
|
||||
}
|
||||
// get response getHeaders value
|
||||
System.out.println("response.getHeaderNames() : "+ response.getHeaderNames());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
System.out.println("===== SendInterceptor afterCompletion apikey ==");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void _jsonResult(
|
||||
HttpServletResponse p_response
|
||||
, HttpStatus p_HttpStatus
|
||||
) throws Exception{
|
||||
|
||||
p_response.setContentType("application/json");
|
||||
p_response.setCharacterEncoding("UTF-8");
|
||||
p_response.getWriter().write("{\"resultCode\":\""+p_HttpStatus.value()+"\",\"message\":\""+p_HttpStatus.getReasonPhrase()+"\"}");
|
||||
|
||||
//return "{\"resultCode\":\""+p_HttpStatus.value()+"\",\"message\":\""+p_HttpStatus.getReasonPhrase()+"\"}";
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,7 +11,7 @@ import org.springframework.http.ResponseEntity;
|
||||
* fileName : mjonResponse
|
||||
* author : hylee
|
||||
* date : 2023-05-12
|
||||
* description :
|
||||
* description : 문자온 프로젝트에서 받은 리턴값
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* -----------------------------------------------------------
|
||||
|
||||
@ -6,7 +6,6 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.mjon.api.send.mapper.domain
|
||||
@ -25,94 +24,37 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class MsgRequestVO implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 값이 있는 경우
|
||||
* 문자온 프로젝트에서 처리해줌
|
||||
* null이면 에러
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String msgId ;// '문자ID',
|
||||
private String userId ; // '문자온 일반회원ID',
|
||||
private String agentFlag ;//'전송사코드(1:아이하트,2:...)',
|
||||
private String userData; //'(I)사용자 정의 코드(참조용으로 사용되는 것으로 메시지 전송 시에는 사용되지 않는다-문자온/아이하트 참조키용)',
|
||||
private String msgSeq; // '(I)메시지의 고유번호. 자동 증가하는 것으로 MSG_DATA의 PRIMARY KEY가 된다.',
|
||||
private String curState; // '상태 값(발송요청:0, 전송 중:1, 전송:2, 결과수신:3)',
|
||||
private String sentDate; // '메시지를 전송한 시각',
|
||||
private String rsltDate; // '핸드폰에 전달된 시간 (이통사가 핸드폰이 수신했다고 주장하는 시간)',
|
||||
private String reportDate; // '레포트 처리한 시간',
|
||||
private String reqDate; // '예약일시',
|
||||
private String rsltCode; // '결과처리코드',
|
||||
private String rsltCode2; // '결과처리 상세코드',
|
||||
private String rsltNet; // '결과처리 통신사',
|
||||
private String callTo; // '수신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)',
|
||||
private String smsTxt; // 'SMS용 메시지본문',
|
||||
private String[] callToList; // '수신번호리스트',
|
||||
private String callFrom; // '발신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)',
|
||||
private String subject; // 'MMS용 메시지제목',
|
||||
private String smsTxt; // 'SMS용 메시지본문',
|
||||
private String smsTxtArea;//문자 작성 화면 본문 내용
|
||||
private String msgType; // '메시지의 (4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)',
|
||||
private String msgKind; // '문자 종류 일반:N, 광고:A, 선거:C',
|
||||
private String msgPayCode; // '재전송 기능에 의한 최종전송콘텐트 종류 저장',
|
||||
private String contSeq; // COMMENT 'MMS의 콘텐츠 Key(MMS_CONTENTS_INFO의 CONT_SEQ)',
|
||||
private String msgTypeResend; // '재전송할 문자 타입. 값이 있으면 재전송. 없으면 단 건 전송',
|
||||
private String centerSeqResend; // '재전송할 센터. NPro 내부적으로 사용함.',
|
||||
private String msgNoticetalkSenderKey; // '카카오 알림톡에 등록된 사용자 고유키',
|
||||
private String msgNoticetalkTmpKey; // '카카오 알림톡에 등록된 문자 템플릿 고유키',
|
||||
private String msgResendCount; // '첫 번째 전송 값 실패하여 재전송한 카운트.(기본값 : 0, 전송 : 1, 재전송 : 2)',
|
||||
private String msgResenddate; // '재전송된 시간',
|
||||
private String sentDatePre; // '이전 메시지를 전송한 시각',
|
||||
private String rsltDatePre; // '이전 핸드폰에 전달된 시간',
|
||||
private String reportDatePre; // '이전 레포트 처리한 시간',
|
||||
private String rsltCodePre; // '이전 결과처리코드',
|
||||
private String rsltCode2Pre; // '이전 결과처리 상세코드 (결과코드는 아래 표 참조)',
|
||||
private String rsltNetPre; // '이전 결과처리 통신사',
|
||||
private String conectMthd; // '접속한 기기(01:웹 , 02:모바일, 03: 애드온모듈)',
|
||||
private String conectMthdTxt; // '접속한 기기텍스트(01:웹 , 02:모바일, 03: 애드온모듈)',
|
||||
private String repAgent; // e대표전송사
|
||||
private String agentCode; // '전송사(01:아이하트 , ...)',
|
||||
private String agentCodeTxt; // '전송사텍스트(01:아이하트 , ...)',
|
||||
private String curStateTxt; // '현제상태텍스트(01:아이하트 , ...)',
|
||||
private String msgTypeTxt; // '메세지타입(4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)',
|
||||
private String sentDateTxt; // '전송시간 TXT',
|
||||
private String searchCondition2; // '조회조건2',
|
||||
private String searchCondition3; // '조회조건3',
|
||||
private String searchCondition4; // '조회조건3',
|
||||
private String searchCondition5; // '조회조건3',
|
||||
private String delFlag; // '사용자 삭제여부(N:미삭제, Y:삭제)'
|
||||
private String delFlagTxt; // '사용자 삭제여부 텍스트(N:미삭제, Y:삭제)'
|
||||
private String mmsSubject; // '메세지 타이틀'
|
||||
private String fileCnt; // 첨부파일 갯수
|
||||
private String fileType1; // '파일 타입1'
|
||||
private String fileName1; // '파일이름1'
|
||||
private String fileType2; // '파일 타입2'
|
||||
private String fileName2; // '파일이름2'
|
||||
private String fileType3; // '파일 타입3'
|
||||
private String fileName3; // '파일이름3'
|
||||
private String msgGroupId; // 전송그룹ID (대량문자의 경우 하나의 그룹으로 세팅)
|
||||
private String msgGroupCnt; // 전송그룹 카운트
|
||||
private String[] imgFilePath; // 그림 이미지 경로
|
||||
private String neoType; // 아이엠오 장문, 그림 타입 지정
|
||||
private int msgCnt; // 아이엠오 장문, 그림 타입 지정
|
||||
private String eachPrice ; // 전송문자 개별가격
|
||||
private String totPrice ; // 전송문자 토탈가격
|
||||
private String beforeUrl ; //이전 url
|
||||
private String reserveYn ; //예약문자 여부
|
||||
private String reserveCYn ; //예약문자 취소 여부
|
||||
private String cancelDate; //예약 취소 일자
|
||||
|
||||
private String eachPrice="0"; // 전송문자 개별가격
|
||||
private String totPrice="0"; // 전송문자 토탈가격
|
||||
|
||||
private String fileCnt="0"; // 첨부파일 갯수
|
||||
|
||||
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 이면 에러
|
||||
// private float kakaoAtPrice; // 카카오 알림톡 단가
|
||||
// private float kakaoFtPrice; // 카카오 친구톡 단가
|
||||
// private float kakaoFtImgPrice;// 카카오 이미지 단가
|
||||
// private float kakaoFtWideImgPrice; // 카카오 와이드 이미지 단가
|
||||
|
||||
private String[] imgFilePath = new String[0]; // 그림 이미지 경로
|
||||
|
||||
|
||||
private String sendRate; // 전송 배분률
|
||||
private float sendRateInfo; // 전송 배분 현황
|
||||
private String spamStatus; // 스팸문자 유무 (Y/N)
|
||||
|
||||
private String ntceBgnde; // 검색일(현시점 범위 검색은 아님) : 04-21
|
||||
private String ntceEndde; // 검색일(현시점 범위 검색은 아님) : 04-21
|
||||
private String[] imgFileId; //이미지 atchId 배열
|
||||
private String[] templateYn; //템플릿 이미지 사용 여부
|
||||
|
||||
private String divideChk; //분할문자 사용 여부
|
||||
private String divideCnt; //분할문자 건수
|
||||
private String divideTime; //분할문자 간격
|
||||
private String befCash; //문자전송 이전 가지고 있는 캐시
|
||||
private String befPoint; //문자전송 이전 가지고 있는 포인트
|
||||
private String thisPoint; //문자전송 잔액 있는 포인트
|
||||
private String recommId; //추천인 아이디 정보
|
||||
private String txtReplYn="N"; // 변환문자 유무 (Y/N)
|
||||
|
||||
private String[] nameList; // '치환 이름 리스트'
|
||||
private String[] rep1List; // '치환 문자1 리스트'
|
||||
@ -120,56 +62,111 @@ public class MsgRequestVO implements Serializable {
|
||||
private String[] rep3List; // '치환 문자3 리스트'
|
||||
private String[] rep4List; // '치환 문자4 리스트'
|
||||
|
||||
private String startDate, endDate ; //사용자 페이지 날자 조회
|
||||
private String maxRegDate; // 최근 등록일자
|
||||
private String minRegDate; // 최초 등록일자
|
||||
private String regDate; // 등록일자
|
||||
private int phoneNumberCnt;
|
||||
private String phmAuthType; //'인증타입(01:휴대폰번호등록, 02:(일반)유선번호등록 , 03:서류인증요청)',
|
||||
private String refundYn; //문자전송 실패시 환불처리 완료 여부
|
||||
private String reserveYn="N"; // 예약문자 여부 default N
|
||||
|
||||
private String filePath1; //그림이미지1 경로
|
||||
private String filePath2; //그림이미지2 경로
|
||||
private String filePath3; //그림이미지3 경로
|
||||
|
||||
private String smiId; //스팸 이용정지 문자 내용 아이디(mj_spam_member_info 테이블)
|
||||
// private String msgId ;// '문자ID',
|
||||
// private String userId ; // '문자온 일반회원ID',
|
||||
// private String agentFlag ;//'전송사코드(1:아이하트,2:...)',
|
||||
// private String userData; //'(I)사용자 정의 코드(참조용으로 사용되는 것으로 메시지 전송 시에는 사용되지 않는다-문자온/아이하트 참조키용)',
|
||||
// private String msgSeq; // '(I)메시지의 고유번호. 자동 증가하는 것으로 MSG_DATA의 PRIMARY KEY가 된다.',
|
||||
// private String curState; // '상태 값(발송요청:0, 전송 중:1, 전송:2, 결과수신:3)',
|
||||
// private String sentDate; // '메시지를 전송한 시각',
|
||||
// private String rsltDate; // '핸드폰에 전달된 시간 (이통사가 핸드폰이 수신했다고 주장하는 시간)',
|
||||
// private String reportDate; // '레포트 처리한 시간',
|
||||
// private String reqDate; // '예약일시',
|
||||
// private String rsltCode; // '결과처리코드',
|
||||
// private String rsltCode2; // '결과처리 상세코드',
|
||||
// private String rsltNet; // '결과처리 통신사',
|
||||
// private String subject; // 'MMS용 메시지제목',
|
||||
// private String smsTxtArea;//문자 작성 화면 본문 내용
|
||||
// private String msgKind; // '문자 종류 일반:N, 광고:A, 선거:C',
|
||||
// private String msgPayCode; // '재전송 기능에 의한 최종전송콘텐트 종류 저장',
|
||||
// private String contSeq; // COMMENT 'MMS의 콘텐츠 Key(MMS_CONTENTS_INFO의 CONT_SEQ)',
|
||||
// private String msgTypeResend; // '재전송할 문자 타입. 값이 있으면 재전송. 없으면 단 건 전송',
|
||||
// private String centerSeqResend; // '재전송할 센터. NPro 내부적으로 사용함.',
|
||||
// private String msgNoticetalkSenderKey; // '카카오 알림톡에 등록된 사용자 고유키',
|
||||
// private String msgNoticetalkTmpKey; // '카카오 알림톡에 등록된 문자 템플릿 고유키',
|
||||
// private String msgResendCount; // '첫 번째 전송 값 실패하여 재전송한 카운트.(기본값 : 0, 전송 : 1, 재전송 : 2)',
|
||||
// private String msgResenddate; // '재전송된 시간',
|
||||
// private String sentDatePre; // '이전 메시지를 전송한 시각',
|
||||
// private String rsltDatePre; // '이전 핸드폰에 전달된 시간',
|
||||
// private String reportDatePre; // '이전 레포트 처리한 시간',
|
||||
// private String rsltCodePre; // '이전 결과처리코드',
|
||||
// private String rsltCode2Pre; // '이전 결과처리 상세코드 (결과코드는 아래 표 참조)',
|
||||
// private String rsltNetPre; // '이전 결과처리 통신사',
|
||||
// private String conectMthd; // '접속한 기기(01:웹 , 02:모바일, 03: 애드온모듈)',
|
||||
// private String conectMthdTxt; // '접속한 기기텍스트(01:웹 , 02:모바일, 03: 애드온모듈)',
|
||||
// private String repAgent; // e대표전송사
|
||||
// private String agentCode; // '전송사(01:아이하트 , ...)',
|
||||
// private String agentCodeTxt; // '전송사텍스트(01:아이하트 , ...)',
|
||||
// private String curStateTxt; // '현제상태텍스트(01:아이하트 , ...)',
|
||||
// private String msgTypeTxt; // '메세지타입(4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)',
|
||||
// private String sentDateTxt; // '전송시간 TXT',
|
||||
// private String searchCondition2; // '조회조건2',
|
||||
// private String searchCondition3; // '조회조건3',
|
||||
// private String searchCondition4; // '조회조건3',
|
||||
// private String searchCondition5; // '조회조건3',
|
||||
// private String delFlag; // '사용자 삭제여부(N:미삭제, Y:삭제)'
|
||||
// private String delFlagTxt; // '사용자 삭제여부 텍스트(N:미삭제, Y:삭제)'
|
||||
// private String mmsSubject; // '메세지 타이틀'
|
||||
// private String fileType1; // '파일 타입1'
|
||||
// private String fileName1; // '파일이름1'
|
||||
// private String fileType2; // '파일 타입2'
|
||||
// private String fileName2; // '파일이름2'
|
||||
// private String fileType3; // '파일 타입3'
|
||||
// private String fileName3; // '파일이름3'
|
||||
// private String msgGroupId; // 전송그룹ID (대량문자의 경우 하나의 그룹으로 세팅)
|
||||
// private String msgGroupCnt; // 전송그룹 카운트
|
||||
// private String neoType; // 아이엠오 장문, 그림 타입 지정
|
||||
// private int msgCnt; // 아이엠오 장문, 그림 타입 지정
|
||||
// private String beforeUrl ; //이전 url
|
||||
// private String reserveCYn ; //예약문자 취소 여부
|
||||
// private String cancelDate; //예약 취소 일자
|
||||
|
||||
private String smishingYn; // 스미싱 의심여부
|
||||
|
||||
private List<String> dividDay;
|
||||
// private String sendRate; // 전송 배분률
|
||||
// private float sendRateInfo; // 전송 배분 현황
|
||||
|
||||
private String userNm;
|
||||
private String mbtlnum;
|
||||
private String emailAdres;
|
||||
private String authorCode;
|
||||
|
||||
private String adminSmsNoticeYn;
|
||||
private String searchAdminSmsNoticeYn;
|
||||
private String searchExceptSpamYn;
|
||||
// private String divideChk; //분할문자 사용 여부
|
||||
// private String divideCnt; //분할문자 건수
|
||||
// private String divideTime; //분할문자 간격
|
||||
// private String befCash; //문자전송 이전 가지고 있는 캐시
|
||||
// private String befPoint; //문자전송 이전 가지고 있는 포인트
|
||||
// private String thisPoint; //문자전송 잔액 있는 포인트
|
||||
// private String recommId; //추천인 아이디 정보
|
||||
|
||||
private String eventYn; //이벤트
|
||||
private String payCnt; //결제수
|
||||
private String payPct; //결제율
|
||||
// private String startDate, endDate ; //사용자 페이지 날자 조회
|
||||
// private String maxRegDate; // 최근 등록일자
|
||||
// private String minRegDate; // 최초 등록일자
|
||||
// private String regDate; // 등록일자
|
||||
// private int phoneNumberCnt;
|
||||
// private String phmAuthType; //'인증타입(01:휴대폰번호등록, 02:(일반)유선번호등록 , 03:서류인증요청)',
|
||||
// private String refundYn; //문자전송 실패시 환불처리 완료 여부
|
||||
|
||||
private String spamKeyword; //스팸 키워드
|
||||
private String spamMsgGroupId; //스팸문자 문자전송 아이디
|
||||
private String spamStatus; //스팸문자 유무 (Y/N)
|
||||
private String vipYn; //VIP 유무 (Y/N)
|
||||
private String approvalPnttm; // 승인일자
|
||||
private String atchFiles; // 그림문자 파일정보
|
||||
// private String filePath1; //그림이미지1 경로
|
||||
// private String filePath2; //그림이미지2 경로
|
||||
// private String filePath3; //그림이미지3 경로
|
||||
|
||||
private String reserveType; // 전송완료 : D, 예약전송 : R
|
||||
private String todayYn;
|
||||
private String nowDate;
|
||||
private String msgDiv; // S: 단문, L: 장문, P: 그림
|
||||
private Float agentPrice;
|
||||
// private String smiId; //스팸 이용정지 문자 내용 아이디(mj_spam_member_info 테이블)
|
||||
|
||||
private float smsPrice; // sms 단가
|
||||
// private float mmsPrice; // mms 단가
|
||||
private float kakaoAtPrice; // 카카오 알림톡 단가
|
||||
private float kakaoFtPrice; // 카카오 친구톡 단가
|
||||
private float kakaoFtImgPrice;// 카카오 이미지 단가
|
||||
private float kakaoFtWideImgPrice; // 카카오 와이드 이미지 단가
|
||||
|
||||
private String txtReplYn; //변환문자 유무
|
||||
|
||||
|
||||
|
||||
// private String eventYn; //이벤트
|
||||
// private String payCnt; //결제수
|
||||
// private String payPct; //결제율
|
||||
|
||||
// private String spamKeyword; //스팸 키워드
|
||||
// private String spamMsgGroupId; //스팸문자 문자전송 아이디
|
||||
// private String vipYn; //VIP 유무 (Y/N)
|
||||
// private String approvalPnttm; // 승인일자
|
||||
// private String atchFiles; // 그림문자 파일정보
|
||||
|
||||
// private String reserveType; // 전송완료 : D, 예약전송 : R
|
||||
// private String todayYn;
|
||||
// private String nowDate;
|
||||
// private Float agentPrice;
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ public class SendServiceImpl implements SendService {
|
||||
@Override
|
||||
public MjonResponseVO sendMsgData(MsgRequestVO msgRequestVO) throws Exception {
|
||||
|
||||
log.info("msgRequestVO.getReserveYn() :: [{}]",msgRequestVO.getReserveYn());
|
||||
// 스팸체크 하는 부분
|
||||
MjonResponseVO spamChkEntity = apiService.postForEntity(
|
||||
"/web/user/login/selectSpamTxtChkAjax.do"
|
||||
@ -46,6 +47,7 @@ public class SendServiceImpl implements SendService {
|
||||
|
||||
|
||||
return munjaSendResponse;
|
||||
// return spamChkEntity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,18 +1,14 @@
|
||||
package com.itn.mjonApi.mjon.api.send.web;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.itn.mjonApi.mjon.api.send.mapper.domain.MjonResponseVO;
|
||||
import com.itn.mjonApi.mjon.api.send.mapper.domain.MsgRequestVO;
|
||||
import com.itn.mjonApi.mjon.api.send.service.SendService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.mjon.send.web
|
||||
* fileName : SendRestController
|
||||
@ -53,37 +49,6 @@ public class SendRestController {
|
||||
return sendService.sendMsgData(msgRequestVO);
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param msgRequestVO
|
||||
* @Discription 스팸문자 테스트
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/api/selectSpamTxtChkAjax")
|
||||
public Object selectSpamTxtChkAjax(MsgRequestVO msgRequestVO){
|
||||
log.info(" :: START/api/selectSpamTxtChkAjax smsTxt :: [{}]", msgRequestVO.getSmsTxt());
|
||||
|
||||
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(
|
||||
"http://localhost:8080/web/user/login/selectSpamTxtChkAjax.do"
|
||||
, msgRequestVO
|
||||
, String.class
|
||||
);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
MjonResponseVO mjonResponseVO = new MjonResponseVO();
|
||||
|
||||
log.info("stringResponseEntity :: [{}]", stringResponseEntity.getBody());
|
||||
log.info("stringResponseEntity :: [{}]", stringResponseEntity);
|
||||
|
||||
try {
|
||||
mjonResponseVO = objectMapper.readValue(stringResponseEntity.getBody(), MjonResponseVO.class);
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return mjonResponseVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.itn.mjonApi.mjon.log.service;
|
||||
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnAccessLogVO;
|
||||
|
||||
public interface LettnAccessLogService {
|
||||
|
||||
//기본 insert 구문
|
||||
RestResponse insert(LettnAccessLogVO lettnAccessLogVO);
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.itn.mjonApi.mjon.log.service.impl;
|
||||
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.log.service.LettnAccessLogService;
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.LettnAccessLogMapper;
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnAccessLogVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Service
|
||||
public class LettnAccessLogServiceImpl implements LettnAccessLogService {
|
||||
|
||||
@Autowired
|
||||
LettnAccessLogMapper lettnAccessLogMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public RestResponse insert(LettnAccessLogVO lettnAccessLogVO) {
|
||||
int i_ret = lettnAccessLogMapper.insert(lettnAccessLogVO);
|
||||
return new RestResponse(HttpStatus.OK, "성공", LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.itn.mjonApi.mjon.log.service.mapper;
|
||||
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnAccessLogVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface LettnAccessLogMapper {
|
||||
|
||||
int insert(LettnAccessLogVO lettnAccessLogVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.itn.mjonApi.mjon.log.service.mapper.domain;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.mjon.log.service.mapper.domain
|
||||
* fileName : LettnAccessLogVO
|
||||
* author : hylee
|
||||
* date : 2023-05-16
|
||||
* description : 회원 access 호출 log
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* -----------------------------------------------------------
|
||||
* 2023-05-16 hylee 최초 생성
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class LettnAccessLogVO implements Serializable {
|
||||
|
||||
|
||||
private String logId; //access log 고유번호' primary key
|
||||
private String accessType; //key or token K/T
|
||||
private String accessKey; //access_key 고유번호
|
||||
private String accessToken; //access_token 고유번호
|
||||
private String reqUserId; //호출자 USER_ID(요청 사이트의 로그인 ID)
|
||||
private String reqCn; //요청내용
|
||||
private String reqInfoRef; //요청 referer 값
|
||||
private String reqUrl; //요청 URL
|
||||
private String resCn; //응답내용
|
||||
private String resCode; //응답코드
|
||||
private String reqRegistPnttm; //요청등록일시
|
||||
private String reqRegisterId; //요청등록자ID
|
||||
private String resUpdtPnttm; //응답수정일시
|
||||
private String resUpdusrId; //응답수정자I
|
||||
|
||||
|
||||
}
|
||||
@ -8,8 +8,8 @@
|
||||
<select id="findAll" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||
SELECT
|
||||
*
|
||||
FROM lettngnrlmber_access_key
|
||||
|
||||
FROM lettngnrlmber_access_key
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 공통 테이블 명 -->
|
||||
@ -96,15 +96,13 @@
|
||||
AND a.ACCESS_KEY = #{accessKey}
|
||||
AND a.MBER_ID = #{mberId}
|
||||
AND a.ACCESS_no = b.ACCESS_NO
|
||||
/*
|
||||
임시 주석
|
||||
AND b.CALL_INFO LIKE CONCAT(#{callInfo}, '%')
|
||||
lettngnrlmber_access_call_info 테이블에 데이터가 현재 없어서 에러가 남
|
||||
*/
|
||||
AND b.CALL_INFO LIKE CONCAT(#{callInfo}, '%')
|
||||
limit 1
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- access_key 정보 U -->
|
||||
<update id="update">
|
||||
|
||||
73
src/main/resources/mapper/log/LettnAccessLog.xml
Normal file
73
src/main/resources/mapper/log/LettnAccessLog.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.itn.mjonApi.mjon.log.service.mapper.LettnAccessLogMapper">
|
||||
|
||||
<!-- 공통 테이블 명 -->
|
||||
<sql id="table_name">
|
||||
lettngnrlmber_access_log
|
||||
</sql>
|
||||
|
||||
<!-- 저장용 공통 컬럼 명 -->
|
||||
<sql id="insert_column_name">
|
||||
|
||||
LOG_ID
|
||||
, ACCESS_TYPE
|
||||
, ACCESS_KEY
|
||||
, ACCESS_TOKEN
|
||||
, REQ_USER_ID
|
||||
, REQ_CN
|
||||
, REQ_INFO_REF
|
||||
, REQ_URL
|
||||
, RES_CN
|
||||
, RES_CODE
|
||||
, REQ_REGIST_PNTTM
|
||||
, REQ_REGISTER_ID
|
||||
|
||||
</sql>
|
||||
|
||||
<!-- 수정용 공통 컬럼 명 -->
|
||||
<sql id="update_column_name">
|
||||
|
||||
LOG_ID
|
||||
, ACCESS_TYPE
|
||||
, ACCESS_KEY
|
||||
, ACCESS_TOKEN
|
||||
, REQ_USER_ID
|
||||
, REQ_CN
|
||||
, REQ_INFO_REF
|
||||
, REQ_URL
|
||||
, RES_CN
|
||||
, RES_CODE
|
||||
, REQ_REGIST_PNTTM
|
||||
, REQ_REGISTER_ID
|
||||
, RES_UPDT_PNTTM
|
||||
, RES_UPDUSR_ID
|
||||
|
||||
</sql>
|
||||
|
||||
<!-- access_log 정보 등록 -->
|
||||
<insert id="insert">
|
||||
INSERT INTO <include refid="table_name"/> (
|
||||
<include refid="insert_column_name"/>
|
||||
)
|
||||
VALUE (
|
||||
#{logId }
|
||||
, #{accessType }
|
||||
, #{accessKey }
|
||||
, #{accessToken }
|
||||
, #{reqUserId }
|
||||
, #{reqCn }
|
||||
, #{reqInfoRef }
|
||||
, #{reqUrl }
|
||||
, #{resCn }
|
||||
, #{resCode }
|
||||
, now()
|
||||
, #{reqRegisterId }
|
||||
)
|
||||
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user