Merge branch 'master' of
http://yongjoon.cho@vcs.iten.co.kr:9999/hylee/mjon_api
This commit is contained in:
commit
9b2e63cd6e
44
src/main/java/com/itn/mjonApi/cmn/apiServer/ApiService.java
Normal file
44
src/main/java/com/itn/mjonApi/cmn/apiServer/ApiService.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
package com.itn.mjonApi.cmn.apiServer;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.itn.mjonApi.mjon.api.send.mapper.domain.MjonResponseVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* packageName : com.itn.mjonApi.cmn.apiServer
|
||||||
|
* fileName : ApiService
|
||||||
|
* author : hylee
|
||||||
|
* date : 2023-05-15
|
||||||
|
* description : API 서버 호출 Service - 호출 후 데이터 정제 까지 구현
|
||||||
|
* ===========================================================
|
||||||
|
* DATE AUTHOR NOTE
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* 2023-05-15 hylee 최초 생성
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ApiService <T> {
|
||||||
|
|
||||||
|
private RestTemplate restTemplate;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ApiService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MjonResponseVO postForEntity(String url, Object request, Class<String> responseType) throws JsonProcessingException {
|
||||||
|
ResponseEntity<String> spamChkEntity = (ResponseEntity<String>) restTemplate.postForEntity(
|
||||||
|
url
|
||||||
|
, request
|
||||||
|
, responseType
|
||||||
|
);
|
||||||
|
|
||||||
|
MjonResponseVO spamResponse = MjonResponseVO.getMjonResponse(spamChkEntity);
|
||||||
|
|
||||||
|
|
||||||
|
return spamResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -29,10 +29,23 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 모든 api 요청에 대한 key 인증 밑 lettnloginlog Insert
|
||||||
|
*/
|
||||||
registry.addInterceptor(certifInterceptor())
|
registry.addInterceptor(certifInterceptor())
|
||||||
.addPathPatterns("/api/accessKey/**")
|
.addPathPatterns("/api/**")
|
||||||
//.addPathPatterns("/api/accessTest/**")
|
.excludePathPatterns("/api/accessTest/**")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2023-05-16
|
||||||
|
* send에 대한 interceptor 설정 - lettngnrlmber_access_log Insert
|
||||||
|
* 진행중
|
||||||
|
*/
|
||||||
|
// registry.addInterceptor(certifInterceptor())
|
||||||
|
// .addPathPatterns("/api/send/**")
|
||||||
|
// ;
|
||||||
//.excludePathPatterns("/css/**", "/images/**", "/js/**");
|
//.excludePathPatterns("/css/**", "/images/**", "/js/**");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,13 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
|
||||||
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
|
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO;
|
||||||
|
import com.itn.mjonApi.cmn.idgen.service.IdgenService;
|
||||||
|
import com.itn.mjonApi.mjon.api.access.service.AccessKeyService;
|
||||||
|
import com.itn.mjonApi.mjon.log.service.LettnLoginLogService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@ -15,14 +22,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||||||
import org.springframework.web.servlet.HandlerInterceptor;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
//import java.sql.Date;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO;
|
|
||||||
import com.itn.mjonApi.cmn.idgen.service.IdgenService;
|
|
||||||
import com.itn.mjonApi.mjon.api.access.service.AccessKeyService;
|
|
||||||
import com.itn.mjonApi.mjon.log.service.LettnLoginLogService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* packageName : com.itn.mjonApi.mjon.send.web
|
* packageName : com.itn.mjonApi.mjon.send.web
|
||||||
@ -36,6 +38,7 @@ import com.itn.mjonApi.mjon.log.service.LettnLoginLogService;
|
|||||||
* 2023-02-15 hylee 최초 생성
|
* 2023-02-15 hylee 최초 생성
|
||||||
*/
|
*/
|
||||||
//@Component
|
//@Component
|
||||||
|
@Slf4j
|
||||||
public class CertifInterceptor implements HandlerInterceptor{
|
public class CertifInterceptor implements HandlerInterceptor{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -85,7 +88,7 @@ public class CertifInterceptor implements HandlerInterceptor{
|
|||||||
System.out.println(clientIp);
|
System.out.println(clientIp);
|
||||||
}
|
}
|
||||||
// URL 접속정보
|
// URL 접속정보
|
||||||
//String referer = request.getHeader("Referer");
|
String referer = request.getHeader("Referer");
|
||||||
//System.out.println("=====preHandle=5=apikey=refer="+referer);
|
//System.out.println("=====preHandle=5=apikey=refer="+referer);
|
||||||
|
|
||||||
String serverIp = request.getRemoteAddr();
|
String serverIp = request.getRemoteAddr();
|
||||||
@ -100,45 +103,60 @@ public class CertifInterceptor implements HandlerInterceptor{
|
|||||||
//step0-2.IP 체크
|
//step0-2.IP 체크
|
||||||
{
|
{
|
||||||
try{
|
try{
|
||||||
String referer = request.getHeader("Referer");
|
|
||||||
|
|
||||||
//step0-1.log 남기기
|
//step0-1.log 남기기
|
||||||
LettnLoginLogVO lettnLoginLogVO = new LettnLoginLogVO();
|
|
||||||
|
|
||||||
//ip
|
//ip
|
||||||
HttpServletRequest req = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
|
HttpServletRequest req = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||||
String ip = req.getHeader("X-FORWARDED-FOR");
|
String ip = req.getHeader("X-FORWARDED-FOR");
|
||||||
if (ip == null){ ip = req.getRemoteAddr();}
|
if (ip == null){ ip = req.getRemoteAddr();}
|
||||||
|
|
||||||
lettnLoginLogVO.setConectIp(ip);
|
|
||||||
|
|
||||||
|
// lettnLoginLogVO.setConectIp(ip);
|
||||||
|
|
||||||
//사용자 여부
|
//사용자 여부
|
||||||
lettnLoginLogVO.setUserAt("U");
|
// lettnLoginLogVO.setUserAt("U");
|
||||||
|
|
||||||
//사용자 ID
|
//사용자 ID
|
||||||
lettnLoginLogVO.setConectId(request.getParameter("mberId"));
|
// lettnLoginLogVO.setConectId(request.getParameter("mberId"));
|
||||||
|
|
||||||
//device type
|
//device type
|
||||||
if(_isMobile(request)){
|
// if(_isMobile(request)){
|
||||||
lettnLoginLogVO.setDeviceType("M");
|
// lettnLoginLogVO.setDeviceType("M");
|
||||||
}else{
|
// }else{
|
||||||
lettnLoginLogVO.setDeviceType("P");
|
// lettnLoginLogVO.setDeviceType("P");
|
||||||
}
|
// }
|
||||||
|
|
||||||
//program_nm - API 값 고정
|
|
||||||
lettnLoginLogVO.setProgrmFileNm("API");
|
// lettnLoginLogVO.setProgrmFileNm("API");
|
||||||
lettnLoginLogVO.setMenuNm("API");
|
// lettnLoginLogVO.setMenuNm("API");
|
||||||
lettnLoginLogVO.setMenuNo("100");
|
// lettnLoginLogVO.setMenuNo("100");
|
||||||
|
|
||||||
//url
|
//url
|
||||||
lettnLoginLogVO.setUrl(request.getRequestURI());
|
// lettnLoginLogVO.setUrl(request.getRequestURI());
|
||||||
|
|
||||||
|
// hylee Builder 패턴으로 변경 => 20230516
|
||||||
|
LettnLoginLogVO lettnLoginLogVO =
|
||||||
|
new LettnLoginLogVO()
|
||||||
|
.builder()
|
||||||
|
.logId(idgenApiLogId.getNextStringId()) // idgen ID
|
||||||
|
.conectId(request.getParameter("mberId")) //사용자 ID
|
||||||
|
.userAt("U") //사용자 여부
|
||||||
|
.conectIp(ip)
|
||||||
|
.deviceType(_isMobile(request) ? "M" : "P") //device type
|
||||||
|
.progrmFileNm("API") //program_nm, menuNm, menuNo - API 값 고정
|
||||||
|
.menuNm("API")
|
||||||
|
.menuNo("100")
|
||||||
|
.url(request.getRequestURI())
|
||||||
|
.build();
|
||||||
|
|
||||||
//IP 컬럼 길이를 늘려서 비교 조건 제거함 2023-04-05
|
//IP 컬럼 길이를 늘려서 비교 조건 제거함 2023-04-05
|
||||||
if (lettnLoginLogVO.getUrl().length()>200){ //길이문제로 오류가 발생하는 경우도 처리하도록 수정
|
if (lettnLoginLogVO.getUrl().length()>200){ //길이문제로 오류가 발생하는 경우도 처리하도록 수정
|
||||||
lettnLoginLogVO.setUrl(lettnLoginLogVO.getUrl().substring(0,199));
|
lettnLoginLogVO.setUrl(lettnLoginLogVO.getUrl().substring(0,199));
|
||||||
}
|
}
|
||||||
|
|
||||||
// logId :: idgen 사용으로 수정 => 2023-04-25
|
// logId :: idgen 사용으로 수정 => 2023-04-25
|
||||||
lettnLoginLogVO.setLogId(idgenApiLogId.getNextStringId());
|
// lettnLoginLogVO.setLogId(idgenApiLogId.getNextStringId());
|
||||||
lettnLoginLogService.insert(lettnLoginLogVO);
|
lettnLoginLogService.insert(lettnLoginLogVO);
|
||||||
|
|
||||||
|
|
||||||
@ -166,20 +184,26 @@ public class CertifInterceptor implements HandlerInterceptor{
|
|||||||
//step1.키 검증 - accessKey & mberId 는 검증을 위한 필수값
|
//step1.키 검증 - accessKey & mberId 는 검증을 위한 필수값
|
||||||
{
|
{
|
||||||
try{
|
try{
|
||||||
String referer = request.getHeader("Referer");
|
// AccessKeyVO accessKeyVO = new AccessKeyVO();
|
||||||
AccessKeyVO accessKeyVO = new AccessKeyVO();
|
// accessKeyVO.setAccessKey(request.getParameter("accessKey"));
|
||||||
accessKeyVO.setAccessKey(request.getParameter("accessKey"));
|
// accessKeyVO.setMberId(request.getParameter("mberId"));
|
||||||
accessKeyVO.setMberId(request.getParameter("mberId"));
|
// accessKeyVO.setCallInfo(referer);
|
||||||
accessKeyVO.setCallInfo(referer);
|
|
||||||
|
// hylee Builder 패턴으로 변경 => 20230516
|
||||||
accessKeyVO = accessKeyService.selectRKey(accessKeyVO);
|
AccessKeyVO accessKeyVO = accessKeyService.selectRKey(
|
||||||
|
new AccessKeyVO().builder()
|
||||||
|
.accessKey(request.getParameter("accessKey"))
|
||||||
|
.mberId(request.getParameter("mberId"))
|
||||||
|
.callInfo(referer)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
//인증 실패
|
//인증 실패
|
||||||
if (accessKeyVO ==null) {
|
if (accessKeyVO ==null) {
|
||||||
|
|
||||||
this._jsonResult(response, HttpStatus.UNAUTHORIZED);
|
this._jsonResult(response, HttpStatus.UNAUTHORIZED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception ex) {
|
}catch(Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.itn.mjonApi.mjon.api.access.service;
|
package com.itn.mjonApi.mjon.api.access.service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
|
|
||||||
public interface AccessKeyService {
|
public interface AccessKeyService {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.itn.mjonApi.mjon.api.access.service;
|
package com.itn.mjonApi.mjon.api.access.service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
|
|
||||||
public interface AccessTokenService {
|
public interface AccessTokenService {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
import com.itn.mjonApi.mjon.api.access.service.AccessKeyService;
|
import com.itn.mjonApi.mjon.api.access.service.AccessKeyService;
|
||||||
import com.itn.mjonApi.mjon.api.access.service.mapper.AccessKeyMapper;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.AccessKeyMapper;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
import com.itn.mjonApi.mjon.api.access.service.AccessTokenService;
|
import com.itn.mjonApi.mjon.api.access.service.AccessTokenService;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.itn.mjonApi.mjon.api.access.service.mapper;
|
package com.itn.mjonApi.mjon.api.access.service.mapper;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.itn.mjonApi.mjon.api.access.service.mapper;
|
package com.itn.mjonApi.mjon.api.access.service.mapper;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO;
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package com.itn.mjonApi.cmn.idgen.mapper.domain;
|
package com.itn.mjonApi.mjon.api.access.service.mapper.domain;
|
||||||
/*
|
/*
|
||||||
table : mj_mymsg
|
table : mj_mymsg
|
||||||
comment : '내문자 보관함';
|
comment : '내문자 보관함';
|
||||||
@ -12,6 +12,7 @@ import java.io.Serializable;
|
|||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
public class AccessKeyVO implements Serializable {
|
public class AccessKeyVO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7865729705175845268L;
|
private static final long serialVersionUID = -7865729705175845268L;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.itn.mjonApi.cmn.idgen.mapper.domain;
|
package com.itn.mjonApi.mjon.api.access.service.mapper.domain;
|
||||||
/*
|
/*
|
||||||
table : mj_mymsg
|
table : mj_mymsg
|
||||||
comment : '내문자 보관함';
|
comment : '내문자 보관함';
|
||||||
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.SendMsgVO;
|
import com.itn.mjonApi.mjon.api.access.service.mapper.domain.SendMsgVO;
|
||||||
import com.itn.mjonApi.cmn.msg.PlainResponse;
|
import com.itn.mjonApi.cmn.msg.PlainResponse;
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
import com.itn.mjonApi.mjon.api.access.service.AccessKeyService;
|
import com.itn.mjonApi.mjon.api.access.service.AccessKeyService;
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.service
|
||||||
|
* @fileName : PriceService.java
|
||||||
|
* @author : JunHo Lee
|
||||||
|
* @date : 2023.05.15
|
||||||
|
* @description :
|
||||||
|
* ===========================================================
|
||||||
|
* DATE AUTHOR NOTE
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* 2023.05.15 JunHo Lee 최초 생성
|
||||||
|
*/
|
||||||
|
public interface PriceService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.service.impl
|
||||||
|
* @fileName : PriceServiceImpl.java
|
||||||
|
* @author : JunHo Lee
|
||||||
|
* @date : 2023.05.15
|
||||||
|
* @description :
|
||||||
|
* ===========================================================
|
||||||
|
* DATE AUTHOR NOTE
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* 2023.05.15 JunHo Lee 최초 생성
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PriceServiceImpl implements PriceService {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.service.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.service.mapper
|
||||||
|
* @fileName : PriceMapper.java
|
||||||
|
* @author : JunHo Lee
|
||||||
|
* @date : 2023.05.15
|
||||||
|
* @description :
|
||||||
|
* ===========================================================
|
||||||
|
* DATE AUTHOR NOTE
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* 2023.05.15 JunHo Lee 최초 생성
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PriceMapper {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class PriceResponse {
|
||||||
|
|
||||||
|
//private HttpStatus status;
|
||||||
|
private int resultCode;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
private LocalDateTime localDateTime;
|
||||||
|
|
||||||
|
private Object object;
|
||||||
|
|
||||||
|
private List<?> objectList;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 200-OK : 정상접속
|
||||||
|
* 401-Unauthorized : 인증실패
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
|
||||||
|
public PriceResponse(HttpStatus status, String message, LocalDateTime timestamp) {
|
||||||
|
this.resultCode = status.value();
|
||||||
|
checkMessage(status, message);
|
||||||
|
this.localDateTime = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PriceResponse(HttpStatus status, String message, LocalDateTime timestamp, Object object) {
|
||||||
|
this.resultCode = status.value();
|
||||||
|
checkMessage(status, message);
|
||||||
|
|
||||||
|
this.object= object;
|
||||||
|
this.localDateTime = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PriceResponse(HttpStatus status, String message, LocalDateTime timestamp, List<?> objectList) {
|
||||||
|
this.resultCode = status.value();
|
||||||
|
checkMessage(status, message);
|
||||||
|
|
||||||
|
this.objectList = objectList;
|
||||||
|
this.localDateTime = timestamp;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkMessage(HttpStatus status, String message) {
|
||||||
|
if ("".equals(message)){ this.message = status.name();
|
||||||
|
}else { this.message = message; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class PriceVO implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7865729705175845268L;
|
||||||
|
|
||||||
|
private String mberId; // 사용자 ID
|
||||||
|
|
||||||
|
// private double shortPrice; // 단문 이용단가
|
||||||
|
// private double longPrice; // 장문 이용단가
|
||||||
|
// private double picturePrice; // 그림 이용단가
|
||||||
|
|
||||||
|
// private double userMoney; // 잔액
|
||||||
|
|
||||||
|
// private int sendPsbltEa; //발송 가능건 수
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.web;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.cmn.msg.PlainResponse;
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.PriceVO;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.web
|
||||||
|
* @fileName : PriceRestController.java
|
||||||
|
* @author : JunHo Lee
|
||||||
|
* @date : 2023.05.15
|
||||||
|
* @description :
|
||||||
|
* ===========================================================
|
||||||
|
* DATE AUTHOR NOTE
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* 2023.05.15 JunHo Lee 최초 생성
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
public class PriceRestController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @methodName : selectPrice
|
||||||
|
* @author : JunHo Lee
|
||||||
|
* @date : 2023.05.16
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/inqry/selectPrice")
|
||||||
|
public ResponseEntity<PlainResponse> selectPrice(PriceVO priceVO){
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println(priceVO.getMberId());
|
||||||
|
//1. 잔액
|
||||||
|
|
||||||
|
//2. 이용단가
|
||||||
|
|
||||||
|
//3. 발송가능건수
|
||||||
|
|
||||||
|
return ResponseEntity.ok(new PlainResponse(HttpStatus.OK, "test" , LocalDateTime.now(), ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
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 org.springframework.http.ResponseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* packageName : com.itn.mjonApi.cmn.msg
|
||||||
|
* fileName : mjonResponse
|
||||||
|
* author : hylee
|
||||||
|
* date : 2023-05-12
|
||||||
|
* description :
|
||||||
|
* ===========================================================
|
||||||
|
* DATE AUTHOR NOTE
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* 2023-05-12 hylee 최초 생성
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class MjonResponseVO {
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
private String result;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MjonMsgVO implements Serializable {
|
public class MsgRequestVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -165,7 +165,7 @@ public class MjonMsgVO implements Serializable {
|
|||||||
private Float agentPrice;
|
private Float agentPrice;
|
||||||
|
|
||||||
private float smsPrice; // sms 단가
|
private float smsPrice; // sms 단가
|
||||||
private float mmsPrice; // mms 단가
|
// private float mmsPrice; // mms 단가
|
||||||
private float kakaoAtPrice; // 카카오 알림톡 단가
|
private float kakaoAtPrice; // 카카오 알림톡 단가
|
||||||
private float kakaoFtPrice; // 카카오 친구톡 단가
|
private float kakaoFtPrice; // 카카오 친구톡 단가
|
||||||
private float kakaoFtImgPrice;// 카카오 이미지 단가
|
private float kakaoFtImgPrice;// 카카오 이미지 단가
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.send.service;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.mjon.api.send.mapper.domain.MjonResponseVO;
|
||||||
|
import com.itn.mjonApi.mjon.api.send.mapper.domain.MsgRequestVO;
|
||||||
|
|
||||||
|
public interface SendService {
|
||||||
|
|
||||||
|
|
||||||
|
MjonResponseVO sendMsgData(MsgRequestVO msgRequestVO) throws Exception;
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.send.service.impl;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.cmn.apiServer.ApiService;
|
||||||
|
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.apache.catalina.connector.Response;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class SendServiceImpl implements SendService {
|
||||||
|
|
||||||
|
private ApiService<Response> apiService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SendServiceImpl(ApiService<Response> apiService) {
|
||||||
|
this.apiService = apiService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MjonResponseVO sendMsgData(MsgRequestVO msgRequestVO) throws Exception {
|
||||||
|
|
||||||
|
// 스팸체크 하는 부분
|
||||||
|
MjonResponseVO spamChkEntity = apiService.postForEntity(
|
||||||
|
"/web/user/login/selectSpamTxtChkAjax.do"
|
||||||
|
, msgRequestVO
|
||||||
|
, String.class
|
||||||
|
);
|
||||||
|
|
||||||
|
if("spams".equals(spamChkEntity.getResult())){
|
||||||
|
msgRequestVO.setSpamStatus("Y");
|
||||||
|
};
|
||||||
|
|
||||||
|
// 문자 전송하는 부분
|
||||||
|
MjonResponseVO munjaSendResponse = apiService.postForEntity(
|
||||||
|
"/web/user/login/sendMsgDataAjax.do"
|
||||||
|
, msgRequestVO
|
||||||
|
, String.class
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return munjaSendResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,12 +1,17 @@
|
|||||||
package com.itn.mjonApi.mjon.api.send.web;
|
package com.itn.mjonApi.mjon.api.send.web;
|
||||||
|
|
||||||
import com.itn.mjonApi.mjon.api.send.mapper.domain.MjonMsgVO;
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
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.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* packageName : com.itn.mjonApi.mjon.send.web
|
* packageName : com.itn.mjonApi.mjon.send.web
|
||||||
@ -20,6 +25,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
* 2023-02-15 hylee 최초 생성
|
* 2023-02-15 hylee 최초 생성
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 치환문자가 있으면 , => §로 치환
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@ -31,53 +37,51 @@ public class SendRestController {
|
|||||||
this.restTemplate = restTemplate;
|
this.restTemplate = restTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SendService sendService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param mjonMsgVO
|
* @param msgRequestVO
|
||||||
* @Discription 문자 발송 테스트
|
* @Discription 문자 발송 테스트
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/api/sendTest")
|
@PostMapping("/api/send/sendTest")
|
||||||
public Object sendTest(MjonMsgVO mjonMsgVO){
|
public MjonResponseVO sendTest(MsgRequestVO msgRequestVO) throws Exception {
|
||||||
|
|
||||||
|
return sendService.sendMsgData(msgRequestVO);
|
||||||
|
|
||||||
return restTemplate.postForEntity(
|
|
||||||
"/web/user/login/sendMsgDataAjax.do"
|
|
||||||
,mjonMsgVO
|
|
||||||
, Object.class
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param mjonMsgVO
|
* @param msgRequestVO
|
||||||
* @Discription 스팸문자 테스트
|
* @Discription 스팸문자 테스트
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/api/selectSpamTxtChkAjax")
|
@PostMapping("/api/selectSpamTxtChkAjax")
|
||||||
public Object selectSpamTxtChkAjax(MjonMsgVO mjonMsgVO){
|
public Object selectSpamTxtChkAjax(MsgRequestVO msgRequestVO){
|
||||||
log.info(" :: START/api/selectSpamTxtChkAjax");
|
log.info(" :: START/api/selectSpamTxtChkAjax smsTxt :: [{}]", msgRequestVO.getSmsTxt());
|
||||||
return restTemplate.postForEntity(
|
|
||||||
"/web/user/login/selectSpamTxtChkAjax.do"
|
|
||||||
,mjonMsgVO
|
|
||||||
, Object.class
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(
|
||||||
/**
|
"http://localhost:8080/web/user/login/selectSpamTxtChkAjax.do"
|
||||||
*
|
, msgRequestVO
|
||||||
* @param mjonMsgVO
|
, String.class
|
||||||
* @Discription 리턴 데이터 테스트
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/api/returnTest")
|
|
||||||
public Object returnTest(MjonMsgVO mjonMsgVO){
|
|
||||||
|
|
||||||
return restTemplate.postForEntity(
|
|
||||||
"/web/user/login/returnTest.do"
|
|
||||||
, mjonMsgVO
|
|
||||||
, Object.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -85,6 +89,4 @@ public class SendRestController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.itn.mjonApi.mjon.log.service;
|
package com.itn.mjonApi.mjon.log.service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO;
|
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO;
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
|
|
||||||
public interface LettnLoginLogService {
|
public interface LettnLoginLogService {
|
||||||
|
|||||||
@ -1,18 +1,15 @@
|
|||||||
package com.itn.mjonApi.mjon.log.service.impl;
|
package com.itn.mjonApi.mjon.log.service.impl;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||||
import java.util.List;
|
import com.itn.mjonApi.mjon.log.service.LettnLoginLogService;
|
||||||
|
import com.itn.mjonApi.mjon.log.service.mapper.LettnLoginLogMapper;
|
||||||
|
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO;
|
import java.time.LocalDateTime;
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
import java.util.List;
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO;
|
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
|
||||||
import com.itn.mjonApi.mjon.log.service.LettnLoginLogService;
|
|
||||||
import com.itn.mjonApi.mjon.log.service.mapper.LettnLoginLogMapper;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LettnLoginLogServiceImpl implements LettnLoginLogService {
|
public class LettnLoginLogServiceImpl implements LettnLoginLogService {
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
package com.itn.mjonApi.mjon.log.service.mapper;
|
package com.itn.mjonApi.mjon.log.service.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface LettnLoginLogMapper {
|
public interface LettnLoginLogMapper {
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.itn.mjonApi.mjon.log.service.mapper.domain;
|
||||||
|
/*
|
||||||
|
table : mj_mymsg
|
||||||
|
comment : '내문자 보관함';
|
||||||
|
*/
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LettnApiSendMsgLogVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String LOG_NO; // access log 고유번호
|
||||||
|
private String MBER_ID; // 일반회원ID
|
||||||
|
private String MSG_GROUP_ID; // 문자 그룹 ID
|
||||||
|
private String REQ_REGIST_PNTTM; // 요청등록일시
|
||||||
|
private String REQ_REGISTER_ID; // 요청등록자ID
|
||||||
|
private String RES_UPDT_PNTTM; // 응답수정일시
|
||||||
|
private String RES_UPDUSR_ID;//응답수정자ID
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.itn.mjonApi.cmn.idgen.mapper.domain;
|
package com.itn.mjonApi.mjon.log.service.mapper.domain;
|
||||||
/*
|
/*
|
||||||
table : mj_mymsg
|
table : mj_mymsg
|
||||||
comment : '내문자 보관함';
|
comment : '내문자 보관함';
|
||||||
@ -12,6 +12,7 @@ import java.io.Serializable;
|
|||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
public class LettnLoginLogVO implements Serializable {
|
public class LettnLoginLogVO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7865729705175845268L;
|
private static final long serialVersionUID = -7865729705175845268L;
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package com.itn.mjonApi.mjon.member.mapper;
|
|
||||||
|
|
||||||
import com.itn.mjonApi.mjon.member.mapper.domain.MyMsgVO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface MyMsgMapper {
|
|
||||||
|
|
||||||
/**/
|
|
||||||
List<MyMsgVO> findAll();
|
|
||||||
|
|
||||||
@Select("select * from MJ_MYMSG")
|
|
||||||
List<MyMsgVO> findAll_2();
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package com.itn.mjonApi.mjon.member.mapper.domain;
|
|
||||||
/*
|
|
||||||
table : mj_mymsg
|
|
||||||
comment : '내문자 보관함';
|
|
||||||
*/
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class MyMsgVO implements Serializable {
|
|
||||||
|
|
||||||
|
|
||||||
private Integer msgId; /*auto_increment comment '문자 고유아이디' primary key*/
|
|
||||||
private String mberId; /*comment '회원 아이디'*/
|
|
||||||
private String esntlId; /*null comment '회원고유 아이디'*/
|
|
||||||
private String subject; /*null comment '문자 제목'*/
|
|
||||||
private String smsTxt; /*null comment '문자 내용'*/
|
|
||||||
private String smsLen; /*null comment '문자 길이'*/
|
|
||||||
private String atchFileId1; /*null comment '첨부파일번호'*/
|
|
||||||
private String atchFileId2; /*null comment '첨부파일번호'*/
|
|
||||||
private String atchFileId3; /*null comment '첨부파일번호'*/
|
|
||||||
private String regdate; /*null comment '등록일자'*/
|
|
||||||
private String msgType; /*default 'S' null comment '문자종류'*/
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.itn.mjonApi.mjon.member.service;
|
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
|
||||||
|
|
||||||
public interface MemberService {
|
|
||||||
|
|
||||||
|
|
||||||
RestResponse findAll();
|
|
||||||
|
|
||||||
RestResponse findAll2();
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.itn.mjonApi.mjon.member.service.impl;
|
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
|
||||||
import com.itn.mjonApi.mjon.member.mapper.MyMsgMapper;
|
|
||||||
import com.itn.mjonApi.mjon.member.mapper.domain.MyMsgVO;
|
|
||||||
import com.itn.mjonApi.mjon.member.service.MemberService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class MemberServiceImpl implements MemberService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
MyMsgMapper myMsgMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RestResponse findAll() {
|
|
||||||
List<MyMsgVO> MyMsgListVO = myMsgMapper.findAll();
|
|
||||||
return new RestResponse(HttpStatus.OK, "성공", LocalDateTime.now(), MyMsgListVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RestResponse findAll2() {
|
|
||||||
List<MyMsgVO> MyMsgListVO = myMsgMapper.findAll_2();
|
|
||||||
return new RestResponse(HttpStatus.OK, "성공", LocalDateTime.now(), MyMsgListVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
package com.itn.mjonApi.mjon.member.web;
|
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
|
||||||
import com.itn.mjonApi.mjon.member.service.MemberService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
public class MemberRestController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MemberService memberService;
|
|
||||||
|
|
||||||
@GetMapping("/member/mymsg")
|
|
||||||
public ResponseEntity<RestResponse> mymsg(){
|
|
||||||
return ResponseEntity.ok(memberService.findAll());
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/member/mymsg_2")
|
|
||||||
public ResponseEntity<RestResponse> mymsg2(){
|
|
||||||
return ResponseEntity.ok(memberService.findAll2());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -14,4 +14,5 @@ server.port=8088
|
|||||||
|
|
||||||
logging.level.root=info
|
logging.level.root=info
|
||||||
|
|
||||||
api.root.url=http://localhost:8080
|
#api.root.url=http://192.168.0.125:8095/
|
||||||
|
api.root.url=http://localhost:8080/
|
||||||
@ -10,9 +10,8 @@ spring.datasource.url=jdbc:log4jdbc:mysql://192.168.0.125:3306/mjon?serverTimezo
|
|||||||
spring.datasource.username=mjonUr
|
spring.datasource.username=mjonUr
|
||||||
spring.datasource.password=mjon!@#$
|
spring.datasource.password=mjon!@#$
|
||||||
|
|
||||||
|
|
||||||
server.port=9100
|
server.port=9100
|
||||||
|
|
||||||
logging.level.root=info
|
logging.level.root=info
|
||||||
|
|
||||||
api.root.url=http://localhost:8080
|
api.root.url=http://192.168.0.125:8095/
|
||||||
|
|||||||
@ -18,3 +18,5 @@ logging.level.jdbc.resultsettable=off
|
|||||||
|
|
||||||
spring.devtools.restart.enabled=true
|
spring.devtools.restart.enabled=true
|
||||||
spring.devtools.livereload.enabled=true
|
spring.devtools.livereload.enabled=true
|
||||||
|
|
||||||
|
server.error.whitelabel.enabled=false
|
||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<mapper namespace="com.itn.mjonApi.mjon.api.access.service.mapper.AccessKeyMapper">
|
<mapper namespace="com.itn.mjonApi.mjon.api.access.service.mapper.AccessKeyMapper">
|
||||||
|
|
||||||
<select id="findAll" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO">
|
<select id="findAll" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM lettngnrlmber_access_key
|
FROM lettngnrlmber_access_key
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<!-- access_key 정보 R -->
|
<!-- access_key 정보 R -->
|
||||||
<!-- <include refid="AccessKeyDAO.select_column_name"/> -->
|
<!-- <include refid="AccessKeyDAO.select_column_name"/> -->
|
||||||
<!-- <include refid="AccessKeyDAO.table_name"/> a -->
|
<!-- <include refid="AccessKeyDAO.table_name"/> a -->
|
||||||
<select id="selectR" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO">
|
<select id="selectR" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="select_column_name"/>
|
<include refid="select_column_name"/>
|
||||||
FROM
|
FROM
|
||||||
@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRKey" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO">
|
<select id="selectRKey" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="select_column_name"/>
|
<include refid="select_column_name"/>
|
||||||
FROM
|
FROM
|
||||||
@ -96,7 +96,12 @@
|
|||||||
AND a.ACCESS_KEY = #{accessKey}
|
AND a.ACCESS_KEY = #{accessKey}
|
||||||
AND a.MBER_ID = #{mberId}
|
AND a.MBER_ID = #{mberId}
|
||||||
AND a.ACCESS_no = b.ACCESS_NO
|
AND a.ACCESS_no = b.ACCESS_NO
|
||||||
AND b.CALL_INFO LIKE CONCAT(#{callInfo}, '%')
|
/*
|
||||||
|
임시 주석
|
||||||
|
AND b.CALL_INFO LIKE CONCAT(#{callInfo}, '%')
|
||||||
|
lettngnrlmber_access_call_info 테이블에 데이터가 현재 없어서 에러가 남
|
||||||
|
*/
|
||||||
|
limit 1
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
@ -130,5 +135,5 @@
|
|||||||
<include refid="table_name"/>
|
<include refid="table_name"/>
|
||||||
WHERE
|
WHERE
|
||||||
ACCESS_NO = #{accessNo}
|
ACCESS_NO = #{accessNo}
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<mapper namespace="com.itn.mjonApi.mjon.api.access.service.mapper.AccessTokenMapper">
|
<mapper namespace="com.itn.mjonApi.mjon.api.access.service.mapper.AccessTokenMapper">
|
||||||
|
|
||||||
<select id="findAll" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO">
|
<select id="findAll" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM lettngnrlmber_access_token
|
FROM lettngnrlmber_access_token
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<!-- access_key 정보 R -->
|
<!-- access_key 정보 R -->
|
||||||
<!-- <include refid="AccessKeyDAO.select_column_name"/> -->
|
<!-- <include refid="AccessKeyDAO.select_column_name"/> -->
|
||||||
<!-- <include refid="AccessKeyDAO.table_name"/> a -->
|
<!-- <include refid="AccessKeyDAO.table_name"/> a -->
|
||||||
<select id="selectR" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO">
|
<select id="selectR" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="select_column_name"/>
|
<include refid="select_column_name"/>
|
||||||
FROM
|
FROM
|
||||||
@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRToken" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.AccessKeyVO">
|
<select id="selectRToken" resultType="com.itn.mjonApi.mjon.api.access.service.mapper.domain.AccessKeyVO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="select_column_name"/>
|
<include refid="select_column_name"/>
|
||||||
FROM
|
FROM
|
||||||
|
|||||||
@ -3,12 +3,6 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.itn.mjonApi.mjon.member.mapper.MyMsgMapper">
|
<mapper namespace="com.itn.mjonApi.mjon.api.inqry.service.mapper.PriceMapper">
|
||||||
|
|
||||||
<select id="findAll">
|
|
||||||
SELECT
|
|
||||||
*
|
|
||||||
FROM MJ_MYMSG
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- access_key 정보 R -->
|
<!-- access_key 정보 R -->
|
||||||
<select id="selectR" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO">
|
<select id="selectR" resultType="com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="select_column_name"/>
|
<include refid="select_column_name"/>
|
||||||
FROM
|
FROM
|
||||||
@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRKey" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO">
|
<select id="selectRKey" resultType="com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="select_column_name"/>
|
<include refid="select_column_name"/>
|
||||||
FROM
|
FROM
|
||||||
@ -115,7 +115,7 @@
|
|||||||
LOG_ID = #{logId}
|
LOG_ID = #{logId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectIgnoreIpCnt" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.LettnLoginLogVO">
|
<select id="selectIgnoreIpCnt" resultType="com.itn.mjonApi.mjon.log.service.mapper.domain.LettnLoginLogVO">
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(A.IGNORE_NO) AS CNT
|
COUNT(A.IGNORE_NO) AS CNT
|
||||||
FROM mj_ignore_ip A
|
FROM mj_ignore_ip A
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user