알림톡 api 단문발송 진행중
This commit is contained in:
parent
0dba525775
commit
3a743c6ddc
5
pom.xml
5
pom.xml
@ -38,6 +38,11 @@
|
||||
<!-- <scope>test</scope>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.modelmapper/modelmapper -->
|
||||
<dependency>
|
||||
<groupId>org.modelmapper</groupId>
|
||||
|
||||
@ -70,9 +70,21 @@ public class LogAspect {
|
||||
* - mberId
|
||||
* - accessKey
|
||||
*/
|
||||
@Before(value = "execution(* com.itn.mjonApi.mjon.api.*..*Impl.*(..))" )
|
||||
// @Before(value = "execution(* com.itn.mjonApi.mjon.api.*..*Impl.*(..))" )
|
||||
@Before("execution(* com.itn.mjonApi.mjon.api..*Controller.*(..)) || execution(* com.itn.mjonApi.mjon.api..*Impl.*(..))")
|
||||
public void before(JoinPoint joinPoint) throws IllegalAccessException, JsonProcessingException {
|
||||
log.info(" :: AOP before :: ");
|
||||
//
|
||||
// for (Object arg : joinPoint.getArgs()) {
|
||||
// if (arg == null) continue;
|
||||
//
|
||||
// // JSON 직렬화해서 VO 전체 출력
|
||||
// log.info("VO 전체: {}", new ObjectMapper().writeValueAsString(arg));
|
||||
// log.info("VO 클래스명: {}", arg.getClass().getName());
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
HttpServletRequest request = this.getHttpServletRequest();
|
||||
|
||||
@ -93,8 +105,10 @@ public class LogAspect {
|
||||
// JDK 내부 클래스 필드는 무시
|
||||
if (field.getDeclaringClass().getName().startsWith("java.")) continue;
|
||||
field.setAccessible(true);
|
||||
|
||||
// log.info("field.getName() :: [{}]", field.getName());
|
||||
if ("mberId".equals(field.getName())) {
|
||||
mberId = String.valueOf(field.get(objectVO));
|
||||
log.info("mberId :: [{}]", mberId);
|
||||
}
|
||||
// log.info("field.get(objectVO) :: [{}]", field.get(objectVO));
|
||||
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ package com.itn.mjonApi.cmn.domain.biz.template;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
//@Getter
|
||||
//@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ -13,4 +13,13 @@ public class BizTemplateRequest {
|
||||
private String apiKey;
|
||||
private String senderKey;
|
||||
private String templateCode;
|
||||
|
||||
public String getBizId() { return bizId; }
|
||||
public void setBizId(String bizId) { this.bizId = bizId; }
|
||||
public String getApiKey() { return apiKey; }
|
||||
public void setApiKey(String apiKey) { this.apiKey = apiKey; }
|
||||
public String getSenderKey() { return senderKey; }
|
||||
public void setSenderKey(String senderKey) { this.senderKey = senderKey; }
|
||||
public String getTemplateCode() { return templateCode; }
|
||||
public void setTemplateCode(String templateCode) { this.templateCode = templateCode; }
|
||||
}
|
||||
|
||||
@ -53,6 +53,33 @@ public class CertifInterceptor implements HandlerInterceptor{
|
||||
String serverIp = ""; //접속 server IP
|
||||
|
||||
try{
|
||||
/*
|
||||
|
||||
String contentType = request.getContentType();
|
||||
log.info("요청 contentType: {}", contentType);
|
||||
//
|
||||
if("application/json".equals(contentType) )
|
||||
{
|
||||
|
||||
BufferedReader reader = request.getReader();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
String body = sb.toString();
|
||||
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode jsonNode = mapper.readTree(body);
|
||||
String mberId = jsonNode.get("mberId").asText();
|
||||
String accessKey = jsonNode.get("accessKey").asText();
|
||||
|
||||
log.info("mberId :: [{}]", mberId);
|
||||
log.info("accessKey :: [{}]", accessKey);
|
||||
}
|
||||
*/
|
||||
|
||||
String clientIp = null;
|
||||
boolean isIpInHeader = false;
|
||||
|
||||
|
||||
@ -71,10 +71,12 @@ public class InqryRestContoller {
|
||||
@PostMapping("/api/kakao/inqry/templates/detail")
|
||||
public ResponseEntity<RestResponse> getTemplateDetail(BizTemplateRequest bizTemplateRequest) throws Exception {
|
||||
|
||||
log.info("bizTemplateRequest :: [{}]", bizTemplateRequest.toString());
|
||||
return ResponseEntity.ok().body(inqryService.getTemplateDetail(bizTemplateRequest));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import com.itn.mjonApi.mjon.api.kakao.at.send.service.SendAtService;
|
||||
import com.itn.mjonApi.mjon.api.msg.inqry.mapper.PriceMapper;
|
||||
import com.itn.mjonApi.mjon.api.msg.send.mapper.SendMapper;
|
||||
import com.itn.mjonApi.mjon.api.msg.send.mapper.domain.MjonResponseVO;
|
||||
import com.itn.mjonApi.mjon.api.msg.send.mapper.domain.SendSucRestResponse;
|
||||
import com.itn.mjonApi.util.MunjaUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.connector.Response;
|
||||
@ -62,6 +61,7 @@ public class SendAtServiceImpl implements SendAtService {
|
||||
if(MunjaUtil.getCallToListChk(msgAtRequestVO.getCallToList())){
|
||||
return new RestResponse(new FailRestResponse("STAT_1020",""));
|
||||
}
|
||||
|
||||
msgAtRequestVO.setTrnCallToList(msgAtRequestVO.getCallToList());
|
||||
log.info("msgAtRequestVO.toString() :: [{}]", msgAtRequestVO.toString());
|
||||
|
||||
@ -76,55 +76,15 @@ public class SendAtServiceImpl implements SendAtService {
|
||||
|
||||
// convertMjonDataToApiResponse => MjonResponseVO 데이터를 ApiResponse 데이터로 변환하는 메소드
|
||||
log.info(" + munjaSendResponse :: [{}]", munjaSendResponse.toString());
|
||||
/*
|
||||
if("OK".equals(munjaSendResponse.getResult())){ // 성공
|
||||
return new RestResponse(SendSucRestResponse.convertMjonDataToApiResponse(munjaSendResponse));
|
||||
}else{ // 실패
|
||||
return new RestResponse(new FailRestResponse(munjaSendResponse.getStatCode(),""));
|
||||
}
|
||||
*/
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public RestResponse sendMsgData_advc(MsgRequestVO msgRequestVO) throws Exception {
|
||||
log.info(" :: sendMsgData_advc ::");
|
||||
|
||||
msgRequestVO.setSendKind("A");
|
||||
|
||||
if(StringUtils.isNotEmpty(msgRequestVO.getTest_yn())){
|
||||
// YF => 실패 테스트 데이터
|
||||
return this._getTestMsgReturnData(msgRequestVO.getTest_yn());
|
||||
}
|
||||
|
||||
// step2.수신자 전화번호 정상 여부 체크(정상 번호에 대해서만 발송 가능)
|
||||
// 1020
|
||||
// 폰번호 확인 - 빈 값 -> 유효성 정규식
|
||||
if(this.getCallToListChk(msgRequestVO)){
|
||||
return new RestResponse(new FailRestResponse("STAT_1020",""));
|
||||
}
|
||||
|
||||
// 치환 데이터 및 수신자 번호 VO 생성
|
||||
msgRequestVO.setMjonMsgSendVOList(this.buildMsgSendVOList(msgRequestVO));
|
||||
|
||||
// sms 변수 변경
|
||||
msgRequestVO.setSmsTxtArea(msgRequestVO.getSmsTxt());
|
||||
|
||||
|
||||
MjonResponseVO munjaSendResponse = apiService.postForEntity(
|
||||
"/web/mjon/msgdata/sendMsgDataAjax_advc.do"
|
||||
, msgRequestVO
|
||||
, String.class
|
||||
);
|
||||
|
||||
// convertMjonDataToApiResponse => MjonResponseVO 데이터를 ApiResponse 데이터로 변환하는 메소드
|
||||
log.info(" + munjaSendResponse :: [{}]", munjaSendResponse.toString());
|
||||
if("OK".equals(munjaSendResponse.getResult())){ // 성공
|
||||
return new RestResponse(SendSucRestResponse.convertMjonDataToApiResponse(munjaSendResponse));
|
||||
}else{ // 실패
|
||||
return new RestResponse(new FailRestResponse(munjaSendResponse.getStatCode(),""));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@ -36,12 +36,15 @@ public class SendAtRestController {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param msgRequestVO
|
||||
* @param msgAtRequestVO
|
||||
* @Discription [문자 발송] 같은 내용으로 여려명에게 보냄
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/api/kakao/at/sendMsg")
|
||||
public ResponseEntity<RestResponse> sendMsg(MsgAtRequestVO msgAtRequestVO) throws Exception {
|
||||
|
||||
// https://smartsms.aligo.in/friendapi.html
|
||||
|
||||
return ResponseEntity.ok().body(sendAtService.sendAtData(msgAtRequestVO));
|
||||
// return ResponseEntity.ok().body(sendService.sendMsgData(msgRequestVO));
|
||||
}
|
||||
|
||||
@ -41,4 +41,16 @@ Ganpandaup.estimate.template.url=https://www.munjaon.co.kr/publish/email_form_ga
|
||||
|
||||
biz.root.url=https://kapi.ppurio.com
|
||||
biz.api.key=dheBWCONP6J5
|
||||
biz.id=itn0202
|
||||
biz.id=itn0202
|
||||
|
||||
|
||||
# ?? ?? actuator ?? ???? ?? ?
|
||||
# management.server.port=8081
|
||||
|
||||
# actuator base path ?? (???: /actuator)
|
||||
# management.endpoints.web.base-path=/manage
|
||||
|
||||
# health ?? ?? ??
|
||||
management.endpoint.health.show-details=always
|
||||
# actuator endpoint ?? ??
|
||||
management.endpoints.web.exposure.include=health,info,metrics
|
||||
|
||||
Loading…
Reference in New Issue
Block a user