문자발송요청시 요청 IP를 테이블에 기록하도록 수정함.

main
이범준 12 months ago
parent 7746f430d2
commit abc1ecc775

@ -87,6 +87,12 @@
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

@ -340,6 +340,11 @@ public class MessageEntity extends AbstractEntity {
*/
private String taskSeCd;
/**
* IP
*/
private String dmndIp;
/**
* 1,2,3
*/

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.applib.AppCmmnUtil;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.interfaces.message.MessageEntity;
@ -51,7 +53,10 @@ public class MessageInterfaceController extends AbstractController {
};
@PostMapping(name="문자전송 요청 등록", value="/regist")
public ModelAndView regist(@RequestBody JSONObject apiSpec) {
public ModelAndView regist(HttpServletRequest hreq, @RequestBody JSONObject apiSpec) {
String dmndIp = AppCmmnUtil.getClientIpAddr(hreq);
ModelAndView mav = new ModelAndView("jsonView");
MessageUtil forPlainText = new MessageUtil("plain");
@ -186,6 +191,7 @@ public class MessageInterfaceController extends AbstractController {
for(Map<String,Object> req : reqs) {
MessageEntity messageEntity = new MessageEntity();
messageEntity.setDmndIp(dmndIp);
messageEntity.setSubId(nuri2Id);
messageEntity.setSggCd(sggCd);

@ -77,6 +77,7 @@ SELECT A.MSG_KEY
, (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.SGG_CD) AS SGG_NM
, A.TASK_SE_CD
, GET_CODE_NM('FIM054', A.TASK_SE_CD) AS TASK_SE_NM
, DMND_IP
, (CASE
WHEN A.RSLT_CODE = '0' OR A.RSLT_CODE = '1000'
THEN '성공'
@ -159,6 +160,7 @@ INSERT
, MSG_DTL_PRPS
, SGG_CD
, TASK_SE_CD
, DMND_IP
)
VALUES (
NEXTVAL(SQ_NURI2_NRMSG_DATA)
@ -219,6 +221,7 @@ VALUES (
, #{msgDtlPrps}
, #{sggCd}
, #{taskSeCd}
, #{dmndIp}
)
</insert>

Loading…
Cancel
Save