feat: aop 수정
This commit is contained in:
parent
a0860369a2
commit
143a3981f2
6
pom.xml
6
pom.xml
@ -147,6 +147,12 @@
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.15.3</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.itn.mjonApi.cmn.idgen.service.IdgenService;
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.api.access.mapper.domain.AccessKeyVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryResponse;
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.LettnAccessLogMapper;
|
||||
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnAccessLogVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -15,6 +16,7 @@ import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@ -128,20 +130,27 @@ public class LogAspect {
|
||||
*/
|
||||
private String getJsonToString(Object returnValue) throws JsonProcessingException {
|
||||
|
||||
if(ObjectUtils.isEmpty(returnValue)){
|
||||
return null;
|
||||
}
|
||||
|
||||
String classNmTemp = returnValue.getClass().getName();
|
||||
String classNm = classNmTemp.substring(classNmTemp.lastIndexOf(".")+1, classNmTemp.length());
|
||||
|
||||
/**
|
||||
* @description : return Class가 추가되면 여기에 추가
|
||||
*/
|
||||
if("AccessKeyVO".equals(classNm)){
|
||||
if("AccessKeyVO".equals(classNm)) {
|
||||
AccessKeyVO accessKeyVO = (AccessKeyVO) returnValue;
|
||||
return this.getAccessKeyVOToJsonString(accessKeyVO);
|
||||
}else{
|
||||
}else if("RestResponse".equals(classNm)){
|
||||
RestResponse restResponse = (RestResponse) returnValue;
|
||||
return this.getRestResponseToJsonString(restResponse);
|
||||
}else{
|
||||
return "데이터를 추가해 주세요";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -158,6 +167,11 @@ public class LogAspect {
|
||||
// .registerModule(new JavaTimeModule()) : LocalDateTime을 json으로 변환하기 위함
|
||||
return objectMapper.registerModule(new JavaTimeModule()).writeValueAsString(restResponse);
|
||||
}
|
||||
private static String getHstryResponseVOToJsonString(HstryResponse hstryResponse) throws JsonProcessingException {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
// .registerModule(new JavaTimeModule()) : LocalDateTime을 json으로 변환하기 위함
|
||||
return objectMapper.registerModule(new JavaTimeModule()).writeValueAsString(hstryResponse);
|
||||
}
|
||||
/**
|
||||
* @description : VO를 json으로 변환
|
||||
* @param accessKeyVO
|
||||
|
||||
@ -35,33 +35,6 @@ public class RestResponse{
|
||||
this.resultCode=StatMsg.valueOf(STAT_CODE).getCode();
|
||||
this.data=StatMsg.valueOf(STAT_CODE).getMsg();
|
||||
}
|
||||
/*
|
||||
public RestResponse(HttpStatus status, String message, LocalDateTime timestamp) {
|
||||
|
||||
this.resultCode = status.value();
|
||||
checkMessage(status, message);
|
||||
this.localDateTime = timestamp;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public RestResponse(HttpStatus status, String message, LocalDateTime timestamp, Object object) {
|
||||
this.resultCode = status.value();
|
||||
checkMessage(status, message);
|
||||
this.data = object;
|
||||
this.localDateTime = timestamp;
|
||||
}
|
||||
*/
|
||||
|
||||
/* public RestResponse(HttpStatus status, String message, LocalDateTime timestamp, List<?> objectList) {
|
||||
this.resultCode = status.value();
|
||||
checkMessage(status, message);
|
||||
|
||||
this.localDateTime = timestamp;
|
||||
}*/
|
||||
|
||||
/*private void checkMessage(HttpStatus status, String message) {
|
||||
if ("".equals(message)){ this.message = status.name();
|
||||
}else { this.message = message; }
|
||||
}*/
|
||||
}
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package com.itn.mjonApi.mjon.api.inqry.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.itn.mjonApi.mjon.api.access.mapper.domain.AccessKeyVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.MjonResponseVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @packageName : com.itn.mjonApi.mjon.api.inqry.service.mapper
|
||||
@ -32,8 +31,8 @@ public interface HstryMapper {
|
||||
*/
|
||||
//double selectUserMoney(String mberId);
|
||||
|
||||
List<AccessKeyVO> selectApiInqryHstry(HstryVO hstryVO);
|
||||
List<MjonResponseVO> selectApiInqryHstry(HstryVO hstryVO);
|
||||
|
||||
List<AccessKeyVO> selectApiInqryHstryDetail(HstryDetailVO hstryDetailVO);
|
||||
List<MjonResponseVO> selectApiInqryHstryDetail(HstryDetailVO hstryDetailVO);
|
||||
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.itn.mjonApi.mjon.api.inqry.service;
|
||||
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryResponseVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryVO;
|
||||
|
||||
public interface HstryService {
|
||||
|
||||
@ -1,27 +1,22 @@
|
||||
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.itn.mjonApi.cmn.apiServer.ApiService;
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.api.inqry.mapper.HstryMapper;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.HstryService;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryResponse;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.MjonResponseVO;
|
||||
import com.itn.mjonApi.mjon.api.send.mapper.SendMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.connector.Response;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.itn.mjonApi.cmn.apiServer.ApiService;
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.cmn.msg.StatMsg;
|
||||
import com.itn.mjonApi.mjon.api.access.mapper.domain.AccessKeyVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.mapper.HstryMapper;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.HstryService;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryResponseVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryVO;
|
||||
import com.itn.mjonApi.mjon.api.send.mapper.SendMapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@ -41,8 +36,6 @@ public class HstryServiceImpl implements HstryService {
|
||||
this.apiService = apiService;
|
||||
}
|
||||
|
||||
private static final String replaseStrList = "[*이름*],[*1*],[*2*],[*3*],[*4*]";
|
||||
|
||||
|
||||
@Override
|
||||
public RestResponse hstryList(HstryVO hstryVO) throws Exception {
|
||||
@ -53,10 +46,10 @@ public class HstryServiceImpl implements HstryService {
|
||||
|
||||
if(StringUtils.isNotEmpty(hstryVO.getTest_yn())){
|
||||
// YF => 실패 테스트 데이터
|
||||
return this._getTestReturnData(hstryVO.getTest_yn());
|
||||
return this._getTestHstryListReturnData(hstryVO.getTest_yn());
|
||||
}
|
||||
|
||||
HstryResponseVO hstryResponseVO = new HstryResponseVO();
|
||||
HstryResponse hstryResponse = new HstryResponse();
|
||||
|
||||
try {
|
||||
//page size계산
|
||||
@ -65,12 +58,9 @@ public class HstryServiceImpl implements HstryService {
|
||||
//page 계산
|
||||
hstryVO.setPage(_calcPage(hstryVO.getPage(), hstryVO.getPageSize()));
|
||||
|
||||
//
|
||||
List<AccessKeyVO> accessKeyVOList= hstryMapper.selectApiInqryHstry(hstryVO);
|
||||
|
||||
System.out.println("accessKeyVOList");
|
||||
System.out.println(accessKeyVOList);
|
||||
System.out.println(accessKeyVOList.size());
|
||||
// 전체 발송 이력 가져오기
|
||||
List<MjonResponseVO> accessKeyVOList= hstryMapper.selectApiInqryHstry(hstryVO);
|
||||
|
||||
|
||||
//다음페이지 여부
|
||||
String s_next_yn = "N";
|
||||
@ -88,20 +78,22 @@ public class HstryServiceImpl implements HstryService {
|
||||
System.out.println("accessKeyVOList3");
|
||||
System.out.println(s_next_yn);
|
||||
System.out.println(s_next_yn);
|
||||
|
||||
|
||||
//전체 발송 이력 가져오기
|
||||
hstryResponseVO = HstryResponseVO.builder()
|
||||
hstryResponse = HstryResponse.builder()
|
||||
.objectList(accessKeyVOList)
|
||||
.next_yn(s_next_yn)
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info("selectPrice Error [{}]", e.getMessage());
|
||||
e.printStackTrace();
|
||||
return new RestResponse("STAT_3099");
|
||||
}
|
||||
|
||||
return new RestResponse(hstryResponseVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return new RestResponse(hstryResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -110,7 +102,13 @@ public class HstryServiceImpl implements HstryService {
|
||||
//전체 발송 이력
|
||||
log.info(" :: hstryList ::");
|
||||
|
||||
HstryResponseVO hstryResponseVO = new HstryResponseVO();
|
||||
|
||||
if(StringUtils.isNotEmpty(hstryDetailVO.getTest_yn())){
|
||||
// YF => 실패 테스트 데이터
|
||||
return this._getTestHstryDetailListReturnData(hstryDetailVO.getTest_yn());
|
||||
}
|
||||
|
||||
HstryResponse hstryResponse = new HstryResponse();
|
||||
|
||||
try {
|
||||
//page size 계산
|
||||
@ -118,10 +116,12 @@ public class HstryServiceImpl implements HstryService {
|
||||
|
||||
//page 계산
|
||||
hstryDetailVO.setPage(_calcPage(hstryDetailVO.getPage(), hstryDetailVO.getPageSize()));
|
||||
|
||||
|
||||
hstryResponseVO = HstryResponseVO.builder()
|
||||
.objectList(hstryMapper.selectApiInqryHstryDetail(hstryDetailVO))
|
||||
|
||||
|
||||
List<MjonResponseVO> hstryDetailList = hstryMapper.selectApiInqryHstryDetail(hstryDetailVO);
|
||||
|
||||
hstryResponse = HstryResponse.builder()
|
||||
.objectList(hstryDetailList)
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
@ -129,12 +129,13 @@ public class HstryServiceImpl implements HstryService {
|
||||
return new RestResponse("STAT_4099");
|
||||
}
|
||||
|
||||
return new RestResponse(hstryResponseVO);
|
||||
return new RestResponse(hstryResponse);
|
||||
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
// private function
|
||||
@ -183,35 +184,59 @@ public class HstryServiceImpl implements HstryService {
|
||||
|
||||
return Integer.toString(i_pageSize);
|
||||
}
|
||||
|
||||
private RestResponse _getTestReturnData(String testYn)
|
||||
|
||||
private RestResponse _getTestHstryDetailListReturnData(String testYn) {
|
||||
|
||||
|
||||
// YF => 실패 테스트 데이터
|
||||
if("YS".equals(testYn))
|
||||
{
|
||||
|
||||
List<MjonResponseVO> mjonResponseVOList = new ArrayList<>();
|
||||
|
||||
mjonResponseVOList.add(MjonResponseVO.builder().msgId("MSGID_00000001400199").msgTypeName("그림(MMS)").msgType(6).callFrom("01045971589").callTo("01000000007").msgResult("F").reqdate("2023-04-05 10:12:09").reqdate("2023-04-05 10:12:08").remainMsgCnt(0).build());
|
||||
mjonResponseVOList.add(MjonResponseVO.builder().msgId("MSGID_00000001400198").msgTypeName("그림(MMS)").msgType(6).callFrom("01045971589").callTo("01000000006").msgResult("F").reqdate("2023-04-05 10:12:09").reqdate("2023-04-05 10:12:08").remainMsgCnt(0).build());
|
||||
mjonResponseVOList.add(MjonResponseVO.builder().msgId("MSGID_00000001400197").msgTypeName("단문(SMS)").msgType(4).callFrom("01045971589").callTo("01000000005").msgResult("W").reqdate("2023-04-05 10:12:09").reqdate("2023-04-05 10:13:08").remainMsgCnt(0).build());
|
||||
|
||||
return new RestResponse(
|
||||
HstryResponse.builder()
|
||||
.resultCode(0)
|
||||
.next_yn("N")
|
||||
.objectList(mjonResponseVOList)
|
||||
.build()
|
||||
);
|
||||
|
||||
}else{
|
||||
// 실패 코드 중 랜덤으로 리턴
|
||||
// return new RestResponse(StatMsg.randomErrorStatCode());
|
||||
return new RestResponse("STAT_3099");
|
||||
}
|
||||
}
|
||||
private RestResponse _getTestHstryListReturnData(String testYn)
|
||||
{
|
||||
|
||||
// YF => 실패 테스트 데이터
|
||||
if("YS".equals(testYn))
|
||||
{
|
||||
List<Map> List = new ArrayList<Map>();
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("name", "junho85");
|
||||
map.put("nickname", "June Kim");
|
||||
|
||||
List.add(map);
|
||||
|
||||
|
||||
List<MjonResponseVO> mjonResponseVOList = new ArrayList<>();
|
||||
|
||||
mjonResponseVOList.add(MjonResponseVO.builder().msgGroupId("MSGGID_0000000011431").msgTypeName("그림(MMS)").msgType(6).callFrom("01045971589").msgGroupCnt(1).sCnt("0").fCnt("1").wCnt("0").msgResult("F").smsTxt("").subject("").reqdate("2023-04-05 00:00:00").curState(3).userId("goodgkdus").regdate("2023-04-04 16:20:45").reserveCYn("N").ttlCnt("1").remainMsgCnt(0).totMsgCnt("3").build());
|
||||
mjonResponseVOList.add(MjonResponseVO.builder().msgGroupId("MSGGID_0000000011430").msgTypeName("장문(LMS)").msgType(6).callFrom("01045971589").msgGroupCnt(4).sCnt("0").fCnt("4").wCnt("0").msgResult("F").smsTxt("[*1*]안녕하세요" + "[*2*]그리니까요" + "[*3*]그리니까요" + "[*4*]그리니까요").subject("").reqdate("2023-04-05 00:00:00").curState(3).userId("goodgkdus").regdate("2023-04-04 16:10:19").reserveCYn("N").ttlCnt("4").remainMsgCnt(0).totMsgCnt("3").build());
|
||||
mjonResponseVOList.add(MjonResponseVO.builder().msgGroupId("MSGGID_0000000011429").msgTypeName("단문(SMS)").msgType(4).callFrom("01045971589").msgGroupCnt(2).sCnt("2").fCnt("0").wCnt("0").msgResult("S").smsTxt("단문 내용").subject("").reqdate("2023-04-05 00:00:00").curState(3).userId("goodgkdus").regdate("2023-04-04 16:10:19").reserveCYn("N").ttlCnt("4").remainMsgCnt(0).totMsgCnt("3").build());
|
||||
|
||||
return new RestResponse(
|
||||
HstryResponseVO.builder()
|
||||
HstryResponse.builder()
|
||||
.resultCode(0)
|
||||
.next_yn("N")
|
||||
.objectList((java.util.List<?>) map)
|
||||
.objectList(mjonResponseVOList)
|
||||
.build()
|
||||
/*
|
||||
[{"totMsgCnt":4,"msgResult":"F","msgType":4,"sCnt":0,"msgGroupCnt":3,"smsTxt":"문자 테스트~![*이름*]","wCnt":0,"callFrom":"01035520132","msgTypeName":"단문(SMS)","msgGroupId":"MSGGID_0000000013200","reqdate":"2023-06-01 18:20:07","curState":3,"fCnt":3,"userId":"goodgkdus","remainMsgCnt":0,"regdate":"2023-06-01 18:20:08","reserveCYn":"N","ttlCnt":3},{"totMsgCnt":4,"msgResult":"F","msgType":4,"sCnt":0,"msgGroupCnt":3,"smsTxt":"문자 테스트~![*이름*]","wCnt":0,"callFrom":"01035520132","msgTypeName":"단문(SMS)","msgGroupId":"MSGGID_0000000013190","reqdate":"2023-06-01 17:50:07","curState":3,"fCnt":3,"userId":"goodgkdus","remainMsgCnt":0,"regdate":"2023-06-01 17:50:07","reserveCYn":"N","ttlCnt":3},{"totMsgCnt":4,"msgResult":"F","msgType":4,"sCnt":0,"msgGroupCnt":3,"smsTxt":"문자 테스트~![*이름*]","wCnt":0,"callFrom":"01035520132","msgTypeName":"단문(SMS)","msgGroupId":"MSGGID_0000000013161","reqdate":"2023-06-01 16:40:57","curState":3,"fCnt":3,"userId":"goodgkdus","remainMsgCnt":0,"regdate":"2023-06-01 16:40:57","reserveCYn":"N","ttlCnt":3},{"totMsgCnt":4,"msgResult":"F","msgType":4,"sCnt":0,"msgGroupCnt":3,"smsTxt":"문자 테스트~","wCnt":0,"callFrom":"01035520132","msgTypeName":"단문(SMS)","msgGroupId":"MSGGID_0000000013160","reqdate":"2023-06-01 16:21:49","curState":3,"fCnt":3,"userId":"goodgkdus","remainMsgCnt":0,"regdate":"2023-06-01 16:21:50","reserveCYn":"N","ttlCnt":3}]
|
||||
*/
|
||||
);
|
||||
|
||||
}else{
|
||||
// 실패 코드 중 랜덤으로 리턴
|
||||
return new RestResponse(StatMsg.randomErrorStatCode());
|
||||
// return new RestResponse(StatMsg.randomErrorStatCode());
|
||||
return new RestResponse("STAT_3099");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -9,6 +7,8 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ -32,10 +32,15 @@ public class HstryDetailVO implements Serializable{
|
||||
|
||||
@ApiModelProperty(value = "page 당 출력갯수 30~500", example = "30")
|
||||
private String pageSize;
|
||||
|
||||
|
||||
|
||||
//private String mberId; // 사용자 ID
|
||||
|
||||
public String test_yn;
|
||||
|
||||
public void setTest_yn(String testYn) {
|
||||
this.test_yn = testYn;
|
||||
}
|
||||
|
||||
|
||||
//private String mberId; // 사용자 ID
|
||||
|
||||
// private double shortPrice; // 단문 이용단가
|
||||
// private double longPrice; // 장문 이용단가
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.*;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.cmn.msg
|
||||
@ -28,7 +22,7 @@ import lombok.Setter;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HstryResponseVO {
|
||||
public class HstryResponse {
|
||||
|
||||
//private HttpStatus status;
|
||||
private int resultCode;
|
||||
@ -58,7 +52,7 @@ public class HstryResponseVO {
|
||||
*
|
||||
* */
|
||||
|
||||
public HstryResponseVO(HttpStatus status, String message, LocalDateTime timestamp) {
|
||||
public HstryResponse(HttpStatus status, String message, LocalDateTime timestamp) {
|
||||
this.resultCode = status.value();
|
||||
checkMessage(status, message);
|
||||
this.localDateTime = timestamp;
|
||||
@ -1,16 +1,13 @@
|
||||
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.cmn.msg
|
||||
* fileName : mjonResponse
|
||||
* author : hylee
|
||||
* date : 2023-05-12
|
||||
* description : 문자온 프로젝트에서 받은 리턴값
|
||||
* description : [내역 조회]문자온 프로젝트에서 받은 리턴값
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* -----------------------------------------------------------
|
||||
@ -23,27 +20,28 @@ import org.springframework.http.ResponseEntity;
|
||||
@AllArgsConstructor
|
||||
public class MjonResponseVO {
|
||||
|
||||
private String result;
|
||||
private String message;
|
||||
private String resultSts; // 전송결과 갯수
|
||||
private String resultBlockSts; // 수신거부 갯수
|
||||
private String msgGroupId;
|
||||
private String afterCash;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stringResponseEntity
|
||||
* @return ResponseEntity vo convert
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
public static MjonResponseVO getMjonResponse(ResponseEntity<String> stringResponseEntity) throws JsonProcessingException {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
MjonResponseVO mjonResponseVO = objectMapper.readValue(stringResponseEntity.getBody(), MjonResponseVO.class);
|
||||
return mjonResponseVO;
|
||||
}
|
||||
private String msgGroupId; // 메세지 그룹 ID
|
||||
private String msgId; // 메세지 ID
|
||||
private String totMsgCnt; // 전체 전송문자 갯수
|
||||
private int msgType; // 문자 종류 - 4 : 단문 , 6 장문
|
||||
private String msgTypeName; // 문자 구분명
|
||||
private String msgResult; // 발송결과 성공, 실패 건수
|
||||
private String sCnt; // 성공 카운트
|
||||
private String fCnt; // 실패 카운트
|
||||
private String wCnt; // 대기 카운트
|
||||
private int msgGroupCnt; // 문자 발송 건수
|
||||
private String smsTxt; // 문자 내용
|
||||
private String callFrom; // 발신자 번호
|
||||
private String callTo; // 수신자 번호
|
||||
private int curState; // 전송 처리 결과값
|
||||
private String userId; // 사용자 ID
|
||||
private int remainMsgCnt; // ???
|
||||
private String reqdate; // 등록 일시
|
||||
private String regdate; //
|
||||
private String reserveCYn; // 예약 취소 여부
|
||||
private String ttlCnt; // 전체 요청 수
|
||||
private String subject; // 제목
|
||||
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ import org.springframework.web.client.RestTemplate;
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.HstryService;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryResponseVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryVO;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@ -14,7 +14,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.connector.Response;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@ -38,9 +37,6 @@ public class SendServiceImpl implements SendService {
|
||||
this.apiService = apiService;
|
||||
}
|
||||
|
||||
// 성공 stat_code
|
||||
@Value("${respone.status.success}")
|
||||
private String STAT_CODE;
|
||||
private static final String replaseStrList = "[*이름*],[*1*],[*2*],[*3*],[*4*]";
|
||||
|
||||
@Override
|
||||
@ -48,7 +44,7 @@ public class SendServiceImpl implements SendService {
|
||||
|
||||
if(StringUtils.isNotEmpty(msgRequestVO.getTest_yn())){
|
||||
// YF => 실패 테스트 데이터
|
||||
return this._getTestReturnData(msgRequestVO.getTest_yn());
|
||||
return this._getTestMsgReturnData(msgRequestVO.getTest_yn());
|
||||
}
|
||||
//sendMsg 문자 발송 전 체크 사항
|
||||
|
||||
@ -116,7 +112,7 @@ public class SendServiceImpl implements SendService {
|
||||
|
||||
}
|
||||
|
||||
private RestResponse _getTestReturnData(String testYn)
|
||||
private RestResponse _getTestMsgReturnData(String testYn)
|
||||
{
|
||||
// YF => 실패 테스트 데이터
|
||||
if("YF".equals(testYn))
|
||||
@ -136,11 +132,30 @@ public class SendServiceImpl implements SendService {
|
||||
}
|
||||
}
|
||||
|
||||
private RestResponse _getTestMsgsReturnData(String testYn)
|
||||
{
|
||||
// YF => 실패 테스트 데이터
|
||||
if("YF".equals(testYn))
|
||||
{
|
||||
// 실패 코드 중 랜덤으로 리턴
|
||||
return new RestResponse(StatMsg.randomErrorStatCode());
|
||||
}else{
|
||||
return new RestResponse(
|
||||
SendSuccessRestResponse.builder()
|
||||
.msgGroupId("MSGGID_0000000000000") // 전송 메세지 그룹 ID
|
||||
.successCnt("5") // 성공 건수
|
||||
.blockCnt("2") // 수신거부 건수
|
||||
.msgType("LMS")
|
||||
.failCnt("0")
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public RestResponse sendMsgsData(MsgsRequestVO msgsRequestVO) throws Exception {
|
||||
|
||||
if(StringUtils.isNotEmpty(msgsRequestVO.getTest_yn())){
|
||||
return this._getTestReturnData(msgsRequestVO.getTest_yn());
|
||||
return this._getTestMsgsReturnData(msgsRequestVO.getTest_yn());
|
||||
}
|
||||
// msgsVO -> msgVO List로 변환
|
||||
List<MsgRequestVO> msgRequestVOList = this.getDataCleaning(msgsRequestVO);
|
||||
|
||||
@ -15,4 +15,6 @@ server.port=8088
|
||||
logging.level.root=info
|
||||
|
||||
#api.root.url=http://192.168.0.125:8095/
|
||||
api.root.url=http://localhost:8080/
|
||||
api.root.url=http://localhost:8080/
|
||||
|
||||
Ganpandaup.receiver.email=hylee250@kakao.com
|
||||
@ -15,3 +15,5 @@ server.port=9100
|
||||
logging.level.root=info
|
||||
|
||||
api.root.url=http://192.168.0.125:8095/
|
||||
|
||||
Ganpandaup.receiver.email=ganpan9882@kakao.com
|
||||
@ -26,5 +26,4 @@ respone.status.success=STAT_0
|
||||
|
||||
|
||||
#
|
||||
Ganpandaup.estimate.template.url=https://www.munjaon.co.kr/publish/email_form_ganpandaum_contact.html
|
||||
Ganpandaup.receiver.email=ganpan9882@kakao.com
|
||||
Ganpandaup.estimate.template.url=https://www.munjaon.co.kr/publish/email_form_ganpandaum_contact.html
|
||||
@ -3,11 +3,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.itn.mjonApi.mjon.api.inqry.mapper.HstryMapper">
|
||||
|
||||
<select id="selectApiInqryHstry"
|
||||
resultType="hashmap"
|
||||
>
|
||||
<mapper namespace="com.itn.mjonApi.mjon.api.inqry.mapper.HstryMapper">
|
||||
|
||||
<select id="selectApiInqryHstry" resultType="com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.MjonResponseVO">
|
||||
|
||||
/* 문자온 발송결과 페이지 쿼리를 그대로 사용함 - http://localhost:9080/web/mjon/msgsent/selectMsgSentView.do */
|
||||
SELECT
|
||||
@ -28,9 +26,9 @@
|
||||
, AAA.msgTypeName
|
||||
, AAA.msgResult
|
||||
|
||||
, SUM(if(bbb.msgresultSts='W',bbb.msgResultCnt, 0)) wCnt
|
||||
, SUM(if(bbb.msgresultSts='S',bbb.msgResultCnt, 0)) sCnt
|
||||
, SUM(if(bbb.msgresultSts='F',bbb.msgResultCnt, 0)) fCnt
|
||||
, SUM(if(bbb.msgresultSts='W',bbb.msgResultCnt, 0)) as wCnt
|
||||
, SUM(if(bbb.msgresultSts='S',bbb.msgResultCnt, 0)) as sCnt
|
||||
, SUM(if(bbb.msgresultSts='F',bbb.msgResultCnt, 0)) as fCnt
|
||||
|
||||
, SUM(if(bbb.msgresultSts='W',bbb.msgResultCnt, 0))
|
||||
+ SUM(if(bbb.msgresultSts='S',bbb.msgResultCnt, 0))
|
||||
@ -338,7 +336,7 @@
|
||||
|
||||
|
||||
<select id="selectApiInqryHstryDetail"
|
||||
resultType="hashmap"
|
||||
resultType="com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.MjonResponseVO"
|
||||
>
|
||||
|
||||
/* 문자온 발송결과 페이지 실패 건수 팝업을 변형해서 사용함 - http://localhost:9080/web/mjon/msgsent/selectMsgSFDetailListAjax.do */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user