문자 테스트 페이지 생성 및 기능 구현

This commit is contained in:
hehihoho3@gmail.com 2025-04-30 17:47:30 +09:00
parent bff11e5087
commit c38f61bfec
18 changed files with 1043 additions and 1114 deletions

View File

@ -54,7 +54,7 @@ public class ApiSmsTestMsgController {
* @methodName : ussIonApikeyUserAPIKEYList
* @author : 이호영
* @date : 2025. 4. 29.
* @description : api 문자 발송 테스트
* @description : 문자발송
* @return : String
* @param searchVO
* @param request
@ -71,9 +71,9 @@ public class ApiSmsTestMsgController {
return "/uss/ion/api/test/sms/sendMsgForm";
}
// 대량문자발송
@RequestMapping(value= {"/uss/ion/api/test/sms/sendMsgsForm.do"})
public String sendMsgsForm(@ModelAttribute("searchVO") ApiKeyVO searchVO,
HttpServletRequest request ,
@ -84,4 +84,40 @@ public class ApiSmsTestMsgController {
return "/uss/ion/api/test/sms/sendMsgsForm";
}
// 그룹데이터 조회
@RequestMapping(value= {"/uss/ion/api/test/sms/sendHstryFrom.do"})
public String sendHstryFrom(@ModelAttribute("searchVO") ApiKeyVO searchVO,
HttpServletRequest request ,
ModelMap model) throws Exception{
//value 가져오기
return "/uss/ion/api/test/sms/sendHstryFrom";
}
// 문자데이터 조회
@RequestMapping(value= {"/uss/ion/api/test/sms/sendHstryDetailFrom.do"})
public String sendHstryDetailFrom(@ModelAttribute("searchVO") ApiKeyVO searchVO,
HttpServletRequest request ,
ModelMap model) throws Exception{
//value 가져오기
return "/uss/ion/api/test/sms/sendHstryDetailFrom";
}
// 금액 조회
@RequestMapping(value= {"/uss/ion/api/test/sms/sendSelectPriceFrom.do"})
public String sendSelectPriceFrom(@ModelAttribute("searchVO") ApiKeyVO searchVO,
HttpServletRequest request ,
ModelMap model) throws Exception{
//value 가져오기
return "/uss/ion/api/test/sms/sendSelectPriceFrom";
}
}

View File

@ -4,6 +4,44 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style>
.subte {
padding: 14px 25px;
border-radius: 5px;
border: 3px solid #ececec;
background: #fafafa;
font-size: 15px;
color: #444;
line-height: 1.6;
font-family: '맑은 고딕', sans-serif;
margin-top: 10px;
}
.subte dl {
margin: 0;
}
.subte dt {
font-weight: bold;
margin-top: 8px;
}
.subte dd {
margin: 0 0 6px 15px;
word-break: break-all;
color: #333;
}
.subte .url-list {
margin-left: 20px;
}
.toggle-btn {
background-color: #3b82f6;
color: #fff;
border: none;
border-radius: 4px;
padding: 6px 12px;
cursor: pointer;
font-size: 14px;
margin-top: 10px;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
// 기존 코드 유지하면서, 이거 추가
@ -29,12 +67,37 @@ $(document).ready(function() {
</ul>
</div>
<div class="subte">
<p>- </p>
<p>- 전송내역dd에 다운로드하여 주시기 바랍니다.</p>
<p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p>
<p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p>
<p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p>
<!-- 토글 버튼 -->
<button id="toggleBtn" class="toggle-btn">API 정보 보기/숨기기</button>
<div class="subte" id="subteBox" style="display: none;">
<dl>
<dt>[mberId]</dt>
<dd>dudgusw</dd>
<dt>[apiKey]</dt>
<dd>c2ea9d96775c95c3de9096445db9971d658a</dd>
<dt>[공통 API URL]</dt>
<dd>http://119.193.215.98:8087/ -> 개발서버</dd>
<dt>[세부 엔드포인트]</dt>
<dd class="url-list">- 문자발송 : /api/send/sendMsg -> jsp_example_send_msg_r1.jsp</dd>
<dd class="url-list">- 대량문자발송 : /api/send/sendMsgs -> jsp_example_send_msgs_r1.jsp</dd>
<dd class="url-list">- 전체발송내역 : /api/send/sendHstry -> jsp_example_hstry_r1.jsp</dd>
<dd class="url-list">- 상세발송내역 : /api/send/sendHstryDetail -> jsp_example_hstry_detail_r1.jsp</dd>
<dd class="url-list">- 발송가능건수 : /api/send/sendSelectPrice -> jsp_example_select_price_r1.jsp</dd>
</dl>
</div>
<script>
$(function() {
$('#toggleBtn').click(function() {
$('#subteBox').slideToggle(200, function() {
let isVisible = $('#subteBox').is(':visible');
$('#toggleBtn').text(isVisible ? 'API 정보 숨기기' : 'API 정보 보기');
});
});
});
</script>

View File

@ -1,225 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript" src="./jquery-3.5.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//발송가능건수
$("#ajax_select_price").click(function(){
$('#dynamicTbody').append("");
//document.updatePasswordForm.action = '/web/user/sendRESTAPI_test_r1_send.do';
//document.updatePasswordForm.submit();
var searchWebParam = {
'p_mberId' : $('#mberId').val()
, 'p_apiKey' : $('#apiKey').val()
, 'p_msgGroupId' : $('#msgGroupId').val()
, 'p_page' : $('#page').val()
, 'p_pageSize' : $('#pageSize').val()
, 'p_testYn' : $('#testYn').val()
};
//검색 API를 Ajax로 이용 하기 위한 호출
$.ajax({
url : "./jsp_example_hstry_detail_r1.jsp",
//형식을 json으로 받을 것이기 때문에 지정하여 주었습니다.
dataType : "json",
async : false,
type : "POST",
data : searchWebParam,
success: function (returnData, status) {
console.log('returnData : ', returnData);
if (returnData.data.resultCode=="0"){
//makeResult(returnData);
if(returnData.data.objectList.length == 0){
alert('조회 결과가 없습니다.')
}else{
makeResult(returnData);
}
/*
$("span#sp").text(returnData.shortPrice);
$("span#lp").text(returnData.longPrice);
$("span#pp").text(returnData.picturePrice);
$("span#um").text(returnData.userMoney);
$("span#sspe").text(returnData.shortSendPsbltEa);
$("span#lspe").text(returnData.longSendPsbltEa);
$("span#pspe").text(returnData.pictureSendPsbltEa);
*/
} else{
alert(returnData.data.resultCode+" : "+returnData.data.msg);
}
},
error : function(request, status, error){
alert(request+"///"+error+"///"+status+"///"+"AJAX_ERROR");
console.log("AJAX_ERROR");
}
});
});
});
function makeResult(p_returnData){
var v_html = "";
try {
for (var i=0;i<p_returnData.data.objectList.length;i++){
v_html += "<tr>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].msgId;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].msgTypeName;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].callFrom;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].callTo;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].msgResult;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].regdate;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].reqdate;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].remainMsgCnt;
v_html += "</td>";
v_html += "</tr>";
}
} catch (error) {
console.error(error);
// Expected output: ReferenceError: nonExistentFunction is not defined
// (Note: the exact output may be browser-dependent)
}
v_html += "";
//$('#divResult').append("aaaaaa");
$('#dynamicTbody').html(v_html);
}
</script>
<div class="inner">
<!-- send top -->
<div class="send_top">
<div class="mypage_content current" id="tab5_3">
<div class="heading">
<h2><a href="./jsp_example_start_form_r1.jsp">돌아가기</a></h2>
<br/>
<h2>상세발송정보(샘플-문자온)</h2>
*mberId와 accessKey값은 실제 서비스시에는 jsp_example_hstry_r1.jsp 파일에 작성하여 사용하세요
<br/>(샘플 페이지에서는 월활한 테스트를 위해 파라미터 형식으로 제공합니다.)
<br/><br/><br/>
</div>
<div class="mem_cont_in">
<div class="input_list">
<!--
<div class="input_list_item">
<div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/>
</div>
</div>
<div class="input_list_item">
<div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/>
</div>
</div>
-->
<div class="input_list_item">
<div class="input_left">*메시지ID
<input type="text" class="list_inputType1" id="msgGroupId" maxlength="100" value="MSGGID_0000000011452" size="100"/>
</div>
</div>
<div class="input_list_item">
<div class="input_left">페이지번호
<input type="text" class="list_inputType1" id="page" maxlength="100" value="" size="100"/>(기본값-1)
</div>
</div>
<div class="input_list_item">
<div class="input_left">페이지당 출력갯수
<input type="text" class="list_inputType1" id="pageSize" maxlength="100" value="" size="100"/>(기본값-30(30~500))
</div>
</div>
<div class="input_list_item">
<div class="input_left">테스트여부
<input type="text" class="list_inputType1" id="testYn" maxlength="100" value="" size="100"/>(기본값 없음, YF-테스트(실패), YS-테스트(성공)
</div>
</div>
<div class="mem_btnWrap2">
&nbsp;<button type="button" class="mem_btn3" style="width: 100%;" id="ajax_select_price" onclick="return false;">상세발송정보 요청</button>
</div>
</div>
</div>
<div class="list_cont" id="listTab_1">
<table class="board_list">
<colgroup>
<col style="width: 200px;">
<col style="width: 220px;">
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 200px;">
</colgroup>
<thead>
<tr>
<th scope="row">메시지상세ID
</th>
<th scope="row">문자구분(유형)
</th>
<th scope="row">발신번호
</th>
<th scope="row">수신번호
</th>
<th scope="row">처리상태
</th>
<th scope="row">등록일시
</th>
<th scope="row">발송일시
</th>
<th scope="row">남겨진리스트수량(다음페이지여부)
</th>
</tr>
</thead>
<tbody id="dynamicTbody">
</tbody>
</table>
</div>
</div>
<!--// 마이페이지 - 비밀번호 변경 -->
</div>
<!--// send top -->
</div>
<!--// content 영역 -->

View File

@ -1,110 +0,0 @@
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="org.apache.http.HttpResponse"%>
<%@page import="org.apache.http.client.methods.HttpPost"%>
<%@page import="org.apache.http.impl.client.HttpClients"%>
<%@page import="org.apache.http.client.HttpClient"%>
<%@page import="org.apache.http.HttpEntity"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="org.apache.http.entity.ContentType"%>
<%@page import="org.apache.http.entity.mime.content.FileBody"%>
<%@page import="java.io.File"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.nio.charset.Charset"%>
<%@page import="org.apache.http.entity.mime.HttpMultipartMode"%>
<%@page import="org.apache.http.entity.mime.MultipartEntityBuilder"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=utf-8 " pageEncoding="utf-8"%>
<%
try{
//기본 설정값
final String encodingType = "UTF-8";
final String boundary = "__BDR__";
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "59d8d714ad68ae2e24e3ae2055334e3e"; //발급받은 api ke
//테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
//String apiKey = request.getParameter("p_apiKey"); //발급받은 api key
/******************** 전송요청 URL ********************/
final String apiUrl = "http://localhost:8088/api/inqry/hstryDetail"; // 전송요청 URL
// String apiUrl = "https://apidev.munjaon.co.kr:9998/api/inqry/hstryDetail";
/**************** 발송가능건수 예제 ******************/
System.out.println("상세발송이력");
Map<String, String> params = new HashMap<String, String>();
/******************** 인증정보 ********************/
params.put("mberId", mberId); //문자온 로그인 아이디
params.put("accessKey", apiKey); //APIKEY
/******************** 전송정보 ********************/
//(필수)
String p_msgGroupId = request.getParameter("p_msgGroupId"); //메시지 group id
//(선택)
String p_page = request.getParameter("p_page"); //페이지번호 기본-1
String p_pageSize = request.getParameter("p_pageSize"); //페이지당 출력갯수-30(30~500)
String p_testYn = request.getParameter("p_testYn"); //테스트데이터여부 '', 'YF', 'YS'
//추가 전송 데이터
params.put("msgGroupId" , p_msgGroupId); //문자 전송 정보
params.put("page" , p_page); //페이지번호
params.put("pageSize" , p_pageSize); //페이지당 출력갯수
params.put("test_yn" , p_testYn); //테스트 여부
String result = "";
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setBoundary(boundary);
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
builder.setCharset(Charset.forName(encodingType));
for(Iterator<String> i = params.keySet().iterator(); i.hasNext();){
String key = i.next();
//전달값이 없는 경우 오류
try{
builder.addTextBody(key, params.get(key)
, ContentType.create("Multipart/related", encodingType));
}catch(Exception ex){
//ex.printStackTrace()
}
}
HttpEntity entity = builder.build();
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(apiUrl);
post.setEntity(entity);
HttpResponse res = client.execute(post);
if(res != null){
BufferedReader in = new BufferedReader(new InputStreamReader(res.getEntity().getContent(), encodingType));
String buffer = null;
while((buffer = in.readLine())!=null){
result += buffer;
}
in.close();
}
out.print(result);
}catch(Exception e){
out.print("{\"resultCode\":99,\"message\":\"WRONG API METHOD\"}");
}
%>

View File

@ -1,258 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript" src="./jquery-3.5.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//발송가능건수
$("#ajax_select_price").click(function(){
$('#dynamicTbody').append("");
//document.updatePasswordForm.action = '/web/user/sendRESTAPI_test_r1_send.do';
//document.updatePasswordForm.submit();
var searchWebParam = {
'p_mberId' : $('#mberId').val()
, 'p_apiKey' : $('#apiKey').val()
, 'p_page' : $('#page').val()
, 'p_pageSize' : $('#pageSize').val()
, 'p_startDate' : $('#startDate').val()
, 'p_endDate' : $('#endDate').val()
, 'p_testYn' : $('#testYn').val()
};
//검색 API를 Ajax로 이용 하기 위한 호출
$.ajax({
url : "./jsp_example_hstry_r1.jsp",
//형식을 json으로 받을 것이기 때문에 지정하여 주었습니다.
dataType : "json",
async : false,
type : "POST",
data : searchWebParam,
success: function (returnData, status) {
console.log('returnData : ', returnData);
if (returnData.data.resultCode=="0"){
console.log('returnData.resultCode : ', typeof returnData.resultCode);
if(returnData.data.objectList.length == 0){
alert('조회 결과가 없습니다.')
}else{
makeResult(returnData);
}
/*
$("span#sp").text(returnData.shortPrice);
$("span#lp").text(returnData.longPrice);
$("span#pp").text(returnData.picturePrice);
$("span#um").text(returnData.userMoney);
$("span#sspe").text(returnData.shortSendPsbltEa);
$("span#lspe").text(returnData.longSendPsbltEa);
$("span#pspe").text(returnData.pictureSendPsbltEa);
*/
} else{
alert(returnData.data.resultCode+" : "+returnData.data.msg);
}
},
error : function(request, status, error){
alert(request+"///"+error+"///"+status+"///"+"AJAX_ERROR");
console.log("AJAX_ERROR");
}
});
});
});
function makeResult(p_returnData){
var v_html = "";
try {
for (var i=0;i<p_returnData.data.objectList.length;i++){
var data = p_returnData.data.objectList[i];
console.log('p_returnData.data.objectList['+i+'] : ', data);
console.log('.sCnt : ', data.scnt);
v_html += "<tr>";
v_html += "<td>";
v_html += data.msgGroupId;
v_html += "</td>";
v_html += "<td>";
v_html += data.msgTypeName;
v_html += "</td>";
v_html += "<td>";
v_html += data.callFrom;
v_html += "</td>";
v_html += "<td>";
v_html += data.ttlCnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.scnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.fcnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.wcnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.msgResult;
v_html += "</td>";
v_html += "<td>";
v_html += data.smsTxt.substring(1,20);
v_html += "</td>";
v_html += "<td>";
v_html += data.regdate;
v_html += "</td>";
v_html += "<td>";
v_html += data.reqdate;
v_html += "</td>";
v_html += "<td>";
v_html += data.remainMsgCnt;
v_html += "</td>";
v_html += "</tr>";
}
} catch (error) {
console.error(error);
// Expected output: ReferenceError: nonExistentFunction is not defined
// (Note: the exact output may be browser-dependent)
}
v_html += "";
//$('#divResult').append("aaaaaa");
$('#dynamicTbody').html(v_html);
}
</script>
<div class="inner">
<!-- send top -->
<div class="send_top">
<div class="mypage_content current" id="tab5_3">
<div class="heading">
<h2><a href="./jsp_example_start_form_r1.jsp">돌아가기</a></h2>
<br/>
<h2>전체발송정보(샘플-문자온)</h2>
*mberId와 accessKey값은 실제 서비스시에는 jsp_example_hstry_r1.jsp 파일에 작성하여 사용하세요
<br/>(샘플 페이지에서는 월활한 테스트를 위해 파라미터 형식으로 제공합니다.)
<br/><br/><br/>
</div>
<div class="mem_cont_in">
<div class="input_list">
<!--
<div class="input_list_item">
<div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/>
</div>
</div>
<div class="input_list_item">
<div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="12e749877379aa7426275414050694b953" size="100"/>
</div>
</div>
-->
<div class="input_list_item">
<div class="input_left">페이지번호
<input type="text" class="list_inputType1" id="page" maxlength="100" value="" size="100"/>(기본값-1)
</div>
</div>
<div class="input_list_item">
<div class="input_left">페이지당 출력갯수
<input type="text" class="list_inputType1" id="pageSize" maxlength="100" value="" size="100"/>(기본값-30(30~500))
</div>
</div>
<div class="input_list_item">
<div class="input_left">조회시작일자
<input type="text" class="list_inputType1" id="startDate" maxlength="100" value="" size="100"/>(기본값 오늘)ex)20230601
</div>
</div>
<div class="input_list_item">
<div class="input_left">조회마감일자
<input type="text" class="list_inputType1" id="endDate" maxlength="100" value="" size="100"/>(기본값 내일)ex)20230602
</div>
</div>
<div class="input_list_item">
<div class="input_left">테스트여부
<input type="text" class="list_inputType1" id="testYn" maxlength="100" value="" size="100"/>(기본값 없음, YF-테스트(실패), YS-테스트(성공)
</div>
</div>
<div class="mem_btnWrap2">
&nbsp;<button type="button" class="mem_btn3" style="width: 100%;" id="ajax_select_price" onclick="return false;">전체발송정보 요청</button>
</div>
</div>
</div>
<div class="list_cont" id="listTab_1">
<table class="board_list">
<colgroup>
<col style="width: 200px;">
<col style="width: 220px;">
<col style="width: 200px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 200px;">
</colgroup>
<thead>
<tr>
<th scope="row">메시지ID
</th>
<th scope="row">문자구분(유형)
</th>
<th scope="row">발신번호
</th>
<th scope="row">전체요청수
</th>
<th scope="row">성공건수
</th>
<th scope="row">실패건수
</th>
<th scope="row">대기건수
</th>
<th scope="row">처리상태
</th>
<th scope="row">문자내용
</th>
<th scope="row">등록일시
</th>
<th scope="row">발송일시
</th>
<th scope="row">남겨진리스트수량(다음페이지여부)
</th>
</tr>
</thead>
<tbody id="dynamicTbody">
</tbody>
</table>
</div>
</div>
<!--// 마이페이지 - 비밀번호 변경 -->
</div>
<!--// send top -->
</div>
<!--// content 영역 -->

View File

@ -1,109 +0,0 @@
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="org.apache.http.HttpResponse"%>
<%@page import="org.apache.http.client.methods.HttpPost"%>
<%@page import="org.apache.http.impl.client.HttpClients"%>
<%@page import="org.apache.http.client.HttpClient"%>
<%@page import="org.apache.http.HttpEntity"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="org.apache.http.entity.ContentType"%>
<%@page import="org.apache.http.entity.mime.content.FileBody"%>
<%@page import="java.io.File"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.nio.charset.Charset"%>
<%@page import="org.apache.http.entity.mime.HttpMultipartMode"%>
<%@page import="org.apache.http.entity.mime.MultipartEntityBuilder"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=utf-8 " pageEncoding="utf-8"%>
<%
try{
//기본 설정값
final String encodingType = "UTF-8";
final String boundary = "__BDR__";
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "59d8d714ad68ae2e24e3ae2055334e3e"; //발급받은 api ke
//테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
//String apiKey = request.getParameter("p_apiKey"); //발급받은 api key
/******************** 전송요청 URL ********************/
final String apiUrl = "http://localhost:8088/api/inqry/hstry";
/**************** 발송가능건수 예제 ******************/
System.out.println("전체발송이력");
Map<String, String> params = new HashMap<String, String>();
/******************** 인증정보 ********************/
params.put("mberId", mberId); //문자온 로그인 아이디
params.put("accessKey", apiKey); //APIKEY
/******************** 전송정보 ********************/
//(선택)
String p_page = request.getParameter("p_page"); //페이지번호 기본-1
String p_pageSize = request.getParameter("p_pageSize"); //페이지당 출력갯수-30(30~500)
String p_startDate = request.getParameter("p_startDate"); //조회시작일자-기본값 오늘
String p_endDate = request.getParameter("p_endDate"); //조회마감일자-기본값 내일
String p_testYn = request.getParameter("p_testYn"); //테스트데이터여부 '', 'YF', 'YS'
//추가 전송 데이터
params.put("page" , p_page); //페이지번호
params.put("pageSize" , p_pageSize); //페이지당 출력갯수
params.put("startDate" , p_startDate); //시작일자
params.put("endDate" , p_endDate); //마감일자
params.put("test_yn" , p_testYn); //테스트 여부
String result = "";
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setBoundary(boundary);
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
builder.setCharset(Charset.forName(encodingType));
for(Iterator<String> i = params.keySet().iterator(); i.hasNext();){
String key = i.next();
//전달값이 없는 경우 오류
try{
builder.addTextBody(key, params.get(key)
, ContentType.create("Multipart/related", encodingType));
}catch(Exception ex){
//ex.printStackTrace()
}
}
HttpEntity entity = builder.build();
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(apiUrl);
post.setEntity(entity);
HttpResponse res = client.execute(post);
if(res != null){
BufferedReader in = new BufferedReader(new InputStreamReader(res.getEntity().getContent(), encodingType));
String buffer = null;
while((buffer = in.readLine())!=null){
result += buffer;
}
in.close();
}
out.print(result);
}catch(Exception e){
out.print("{\"resultCode\":99,\"message\":\"WRONG API METHOD\"}");
}
%>

View File

@ -1,142 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript" src="./jquery-3.5.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//발송가능건수
$("#ajax_select_price").click(function(){
$("span#sp").text("");
$("span#lp").text("");
$("span#pp").text("");
$("span#um").text("");
$("span#sspe").text("");
$("span#lspe").text("");
$("span#pspe").text("");
//document.updatePasswordForm.action = '/web/user/sendRESTAPI_test_r1_send.do';
//document.updatePasswordForm.submit();
var searchWebParam = {
'p_mberId' : $('#mberId').val()
, 'p_apiKey' : $('#apiKey').val()
};
//검색 API를 Ajax로 이용 하기 위한 호출
$.ajax({
url : "./jsp_example_select_price_r1.jsp",
//형식을 json으로 받을 것이기 때문에 지정하여 주었습니다.
dataType : "json",
async : false,
type : "POST",
data : searchWebParam,
success: function (returnData, status) {
console.log('returnData : ', returnData)
//alert(returnData.shortPrice);
//alert(returnData.resultCode);
//alert(returnData.message);
//alert(returnData.longPrice);
if (returnData.data.resultCode=="0"){
$("span#sp").text(returnData.data.shortPrice);
$("span#lp").text(returnData.data.longPrice);
$("span#pp").text(returnData.data.picturePrice);
$("span#um").text(returnData.data.mberMoney);
$("span#sspe").text(returnData.data.shortSendPsbltEa);
$("span#lspe").text(returnData.data.longSendPsbltEa);
$("span#pspe").text(returnData.data.pictureSendPsbltEa);
} else{
alert(returnData.data.resultCode+" : "+returnData.data.msg);
}
},
error : function(request, status, error){
alert(request+"///"+error+"///"+status+"///"+"AJAX_ERROR");
console.log("AJAX_ERROR");
}
});
});
});
</script>
<div class="inner">
<!-- send top -->
<div class="send_top">
<div class="mypage_content current" id="tab5_3">
<div class="heading">
<h2><a href="./jsp_example_start_form_r1.jsp">돌아가기</a></h2>
<br/>
<h2>발송가능건수(샘플-문자온)</h2>
*mberId와 accessKey값은 실제 서비스시에는 jsp_example_select_price_r1.jsp 파일에 작성하여 사용하세요
<br/>*샘플 페이지에서는 월활한 테스트를 위해 파라미터 형식으로 제공합니다.
<br/><br/><br/>
</div>
<div class="mem_cont_in">
<div class="input_list">
<!--
<div class="input_list_item">
<div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/>
</div>
</div>
<div class="input_list_item">
<div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/>
</div>
</div>
-->
<div class="mem_btnWrap2">
&nbsp;<button type="button" class="mem_btn3" style="width: 100%;" id="ajax_select_price" onclick="return false;">발송가능건수 요청</button>
</div>
</div>
</div>
<div class="mem_cont_in">
<div class="input_list">
<div class="input_list_item">
<div class="input_left">단문단가 : <span class="input_left" id="sp"></span>
</div>
<div class="input_left">장문단가 : <span class="input_left" id="lp"></span>
</div>
<div class="input_left">그림문자단가 : <span class="input_left" id="pp"></span>
</div>
<div class="input_left">현재보유금액 : <span class="input_left" id="um"></span>
</div>
<div class="input_left">단문발송가능건수 : <span class="input_left" id="sspe"></span>
</div>
<div class="input_left">장문발송가능건수 : <span class="input_left" id="lspe"></span>
</div>
<div class="input_left">그림문자발송가능건수 : <span class="input_left" id="pspe"></span>
</div>
</div>
</div>
</div>
</div>
<!--// 마이페이지 - 비밀번호 변경 -->
</div>
<!--// send top -->
</div>
<!--// content 영역 -->

View File

@ -1,95 +0,0 @@
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="org.apache.http.HttpResponse"%>
<%@page import="org.apache.http.client.methods.HttpPost"%>
<%@page import="org.apache.http.impl.client.HttpClients"%>
<%@page import="org.apache.http.client.HttpClient"%>
<%@page import="org.apache.http.HttpEntity"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="org.apache.http.entity.ContentType"%>
<%@page import="org.apache.http.entity.mime.content.FileBody"%>
<%@page import="java.io.File"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.nio.charset.Charset"%>
<%@page import="org.apache.http.entity.mime.HttpMultipartMode"%>
<%@page import="org.apache.http.entity.mime.MultipartEntityBuilder"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@ page language="java" contentType="text/html; charset=utf-8 " pageEncoding="utf-8"%>
<%
try{
//기본 설정값
final String encodingType = "UTF-8";
final String boundary = "__BDR__";
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
final String mberId = "antelope"; //문자온 로그인 아이디
final String apiKey = "59d8d714ad68ae2e24e3ae2055334e3e"; //발급받은 api key
//테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
//String apiKey = request.getParameter("p_apiKey"); //발급받은 api key
/******************** 전송요청 URL ********************/
final String apiUrl = "https://api.munjaon.co.kr/api/inqry/price";
/**************** 발송가능건수 예제 ******************/
System.out.println("잔액|단가|발송가능건수");
Map<String, String> params = new HashMap<String, String>();
/******************** 인증정보 ********************/
params.put("mberId", mberId); //문자온 로그인 아이디
params.put("accessKey", apiKey); //APIKEY
/******************** 전송정보 ********************/
String result = "";
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setBoundary(boundary);
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
builder.setCharset(Charset.forName(encodingType));
for(Iterator<String> i = params.keySet().iterator(); i.hasNext();){
String key = i.next();
//전달값이 없는 경우 오류
try{
builder.addTextBody(key, params.get(key)
, ContentType.create("Multipart/related", encodingType));
}catch(Exception ex){
//ex.printStackTrace()
}
}
HttpEntity entity = builder.build();
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(apiUrl);
post.setEntity(entity);
HttpResponse res = client.execute(post);
if(res != null){
BufferedReader in = new BufferedReader(new InputStreamReader(res.getEntity().getContent(), encodingType));
String buffer = null;
while((buffer = in.readLine())!=null){
result += buffer;
}
in.close();
}
out.print(result);
}catch(Exception e){
out.print("{\"resultCode\":99,\"message\":\"WRONG API METHOD\"}");
}
%>

View File

@ -0,0 +1,256 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style>
.tabWrap {
width: 100%;
box-sizing: border-box;
margin-bottom: 20px;
}
.tabList {
display: flex;
justify-content: center; /* 가운데 정렬 */
padding: 0;
margin: 0;
height: 55px;
list-style: none;
background: #f4f4f4;
border-radius: 5px;
}
.tabList li {
flex: 1; /* 동일한 너비 */
text-align: center;
position: relative;
z-index: 10;
}
.tabList li::after{
content: "";
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: 30px;
background-color: #d4d4d4;
z-index: -1;
}
.tabList li:last-child::after{
content: none;
}
.tabList li a {
display: block;
text-decoration: none;
color: #333;
font-weight: 500;
line-height: 55px;
border-radius: 5px;
transition: background 0.2s ease;
}
.tabList li.active a {
background-color: #2e3a59;
color: white;
height: 55px;
}
</style>
<script type="text/javaScript" language="javascript">
$(document).ready(function(){
//발송가능건수
$("#ajax_select_price").click(function(){
$('#dynamicTbody').append("");
var searchWebParam = {
'p_mberId' : $('#mberId').val()
, 'p_apiKey' : $('#apiKey').val()
, 'p_msgGroupId' : $('#msgGroupId').val()
, 'p_page' : $('#page').val()
, 'p_pageSize' : $('#pageSize').val()
, 'p_testYn' : $('#testYn').val()
};
$.ajax({
url : "/sample_mjon/jsp_example_hstry_detail_r1.jsp",
//형식을 json으로 받을 것이기 때문에 지정하여 주었습니다.
dataType : "json",
async : false,
type : "POST",
data : searchWebParam,
success: function (returnData, status) {
console.log('returnData : ', returnData);
if (returnData.data.resultCode=="0"){
if(returnData.data.objectList.length == 0){
alert('조회 결과가 없습니다.')
}else{
makeResult(returnData);
}
} else{
alert(returnData.data.resultCode+" : "+returnData.data.msg);
}
},
error : function(request, status, error){
alert(request+"///"+error+"///"+status+"///"+"AJAX_ERROR");
console.log("AJAX_ERROR");
}
});
});
});
function makeResult(p_returnData){
var v_html = "";
try {
for (var i=0;i<p_returnData.data.objectList.length;i++){
v_html += "<tr>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].msgId;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].msgTypeName;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].callFrom;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].callTo;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].msgResult;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].regdate;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].reqdate;
v_html += "</td>";
v_html += "<td>";
v_html += p_returnData.data.objectList[i].remainMsgCnt;
v_html += "</td>";
v_html += "</tr>";
}
} catch (error) {
console.error(error);
// Expected output: ReferenceError: nonExistentFunction is not defined
// (Note: the exact output may be browser-dependent)
}
v_html += "";
$('#dynamicTbody').html(v_html);
}
</script>
<div class="contWrap">
<div class="pageTitle">
<div class="pageIcon">
<img src="/pb/img/pageTitIcon4.png" alt="">
</div>
<h2 class="titType1 c_222222 fwBold">api 문자 발송 테스트</h2>
<p class="tType6 c_999999">발송 테스트</p>
</div>
<div class="pageCont">
<%@include file="/WEB-INF/jsp/uss/ion/api/test/sms/include/tab_include.jsp" %>
<div class="pageCont">
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>조회 정보.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>* 메시지ID</th>
<td><input type="text" id="msgGroupId" value="MSGGID_0000000333362" style="width: 300px;" /></td>
</tr>
<tr>
<th>페이지번호<br />(기본값-1)</th>
<td><input type="text" id="page" value="" value="" ></td>
</tr>
<tr>
<th>페이지당 출력갯수<br />(기본값-30(30~500))</th>
<td><input type="text" id="pageSize" value="" style="width: 100px;"></td>
</tr>
<tr>
<th>테스트 여부<br />(testYn)</th>
<td><input type="text" id="testYn" name="testYn" style="width: 100px;">
(기본값 없음, YF-테스트(실패), YS-테스트(성공))</td>
</tr>
</tbody>
</table>
<div class="btnWrap">
<input type="button" class="btnType1" value="조 회"
id="ajax_select_price">
</div>
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>조회 결과.</p>
</span>
</div>
<div class="tableWrap">
<table class="tbType1">
<colgroup>
<col style="width: 200px;">
<col style="width: 180px;">
<col style="width: 180px;">
<col style="width: 180px;">
<col style="width: 180px;">
<col style="width: 180px;">
<col style="width: 180px;">
<col style="width: 180px;">
</colgroup>
<thead>
<tr>
<th>메세지ID</th>
<th>문자구분(유형)</th>
<th>발신번호</th>
<th>수신번호</th>
<th>처리상태</th>
<th>등록일시</th>
<th>발송일시</th>
<th>남은 페이지</th>
</tr>
</thead>
<tbody id="dynamicTbody">
<tr>
<td colspan="8"><!-- 번호 -->
조회하면 데이터가 나옵니다.
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--// 마이페이지 - 비밀번호 변경 -->
</div>
<!--// send top -->
</div>
<!--// content 영역 -->

View File

@ -0,0 +1,369 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!-- <meta http-equiv="content-type" content="text/html; charset=utf-8"> -->
<style>
.tabWrap {
width: 100%;
box-sizing: border-box;
margin-bottom: 20px;
}
.tabList {
display: flex;
justify-content: center; /* 가운데 정렬 */
padding: 0;
margin: 0;
height: 55px;
list-style: none;
background: #f4f4f4;
border-radius: 5px;
}
.tabList li {
flex: 1; /* 동일한 너비 */
text-align: center;
position: relative;
z-index: 10;
}
.tabList li::after{
content: "";
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: 30px;
background-color: #d4d4d4;
z-index: -1;
}
.tabList li:last-child::after{
content: none;
}
.tabList li a {
display: block;
text-decoration: none;
color: #333;
font-weight: 500;
line-height: 55px;
border-radius: 5px;
transition: background 0.2s ease;
}
.tabList li.active a {
background-color: #2e3a59;
color: white;
height: 55px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
//발송가능건수
$("#ajax_select_price").click(function(){
$('#dynamicTbody').append("");
var searchWebParam = {
'p_mberId' : $('#mberId').val()
, 'p_apiKey' : $('#apiKey').val()
, 'p_page' : $('#page').val()
, 'p_pageSize' : $('#pageSize').val()
, 'p_startDate' : $('#startDate').val()
, 'p_endDate' : $('#endDate').val()
, 'p_testYn' : $('#testYn').val()
};
//검색 API를 Ajax로 이용 하기 위한 호출
$.ajax({
url : "/sample_mjon/jsp_example_hstry_r1.jsp",
//형식을 json으로 받을 것이기 때문에 지정하여 주었습니다.
dataType : "json",
async : false,
type : "POST",
data : searchWebParam,
success: function (returnData, status) {
console.log('returnData : ', returnData);
if (returnData.data.resultCode=="0"){
console.log('returnData.resultCode : ', typeof returnData.resultCode);
if(returnData.data.objectList.length == 0){
alert('조회 결과가 없습니다.')
}else{
makeResult(returnData);
}
}else{
alert(returnData.data.resultCode+" : "+returnData.data.msg);
}
},
error : function(request, status, error){
alert(request+"///"+error+"///"+status+"///"+"AJAX_ERROR");
console.log("AJAX_ERROR");
}
});
});
});
function makeResult(p_returnData){
$('#dynamicTbody').empty();
var v_html = "";
try {
for (var i=0;i<p_returnData.data.objectList.length;i++){
var data = p_returnData.data.objectList[i];
console.log('p_returnData.data.objectList['+i+'] : ', data);
console.log('.sCnt : ', data.scnt);
v_html += "<tr>";
v_html += "<td title='" + data.msgGroupId+ "'>";
v_html += data.msgGroupId;
v_html += "</td>";
v_html += "<td>";
v_html += data.msgTypeName;
v_html += "</td>";
v_html += "<td>";
v_html += data.callFrom;
v_html += "</td>";
v_html += "<td>";
v_html += data.ttlCnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.scnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.fcnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.wcnt;
v_html += "</td>";
v_html += "<td>";
v_html += data.msgResult;
v_html += "</td>";
v_html += "<td title='" + data.smsTxt + "'>";
v_html += data.smsTxt.substring(0,20);
v_html += "</td>";
v_html += "<td title='" + data.regdate + "'>";
v_html += data.regdate;
v_html += "</td>";
v_html += "<td title='" + data.reqdate + "'>";
v_html += data.reqdate;
v_html += "</td>";
v_html += "<td>";
v_html += data.remainMsgCnt;
v_html += "</td>";
v_html += "</tr>";
}
} catch (error) {
console.error(error);
// Expected output: ReferenceError: nonExistentFunction is not defined
// (Note: the exact output may be browser-dependent)
}
v_html += "";
//$('#divResult').append("aaaaaa");
$('#dynamicTbody').html(v_html);
}
</script>
<div class="contWrap">
<div class="pageTitle">
<div class="pageIcon">
<img src="/pb/img/pageTitIcon4.png" alt="">
</div>
<h2 class="titType1 c_222222 fwBold">api 문자 발송 테스트</h2>
<p class="tType6 c_999999">발송 테스트</p>
</div>
<div class="pageCont">
<%@include file="/WEB-INF/jsp/uss/ion/api/test/sms/include/tab_include.jsp" %>
<div class="pageCont">
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>조회 정보.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>페이지번호<br />(기본값-1)</th>
<td><input type="text" id="page" value="" style="width: 100px;"></td>
</tr>
<tr>
<th>페이지당 출력갯수<br />(기본값-30(30~500))</th>
<td><input type="text" id="pageSize" value="" style="width: 100px;"></td>
</tr>
<tr>
<th>조회시작일자<br />(기본값 오늘)ex)20230601</th>
<td><input type="text" id="startDate" value="" style="width: 100px;"></td>
</tr>
<tr>
<th>조회마감일자<br />(기본값 내일)ex)20230602</th>
<td><input type="text" id="endDate" value="" style="width: 100px;"></td>
</tr>
<tr>
<th>테스트 여부<br />(testYn)</th>
<td><input type="text" id="testYn" name="testYn" style="width: 100px;">
(기본값 없음, YF-테스트(실패), YS-테스트(성공))</td>
</tr>
</tbody>
</table>
<div class="btnWrap">
<input type="button" class="btnType1" value="조 회"
id="ajax_select_price">
</div>
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>조회 결과.</p>
</span>
</div>
<div class="tableWrap">
<table class="tbType1">
<colgroup>
<col style="width: 6%">
<col style="width: 5%">
<col style="width: 9%">
<col style="width: 4%">
<col style="width: 4%">
<col style="width: 4%">
<col style="width: 4%">
<col style="width: 4%">
<col style="width: *%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 4%">
</colgroup>
<thead>
<tr>
<th>메세지ID</th>
<th>문자구분(유형)</th>
<th>발신번호</th>
<th>전체건수</th>
<th>성공건수</th>
<th>실패건수</th>
<th>대기건수</th>
<th>처리상태</th>
<th>문자내용</th>
<th>등록일시</th>
<th>발송일시</th>
<th>남은 페이지</th>
<!-- <th><input type="checkbox" name="checkAll" id="checkAll" onclick="fnCheckAll();"><label for="checkAll"></label><label for="checkAll"></label></th>
<th>번호<input type="button" class="sort sortBtn" id="sort_msgGroupId"></th>
<th>아이디<input type="button" class="sort sortBtn" id="sort_userId"></th>
<th>법인폰<input type="button" class="sort sortBtn" id="sort_adminSmsNoticeYn"></th>
<th>발신번호<input type="button" class="sort sortBtn" id="sort_callFrom"></th>
<th>발송건수<input type="button" class="sort sortBtn" id="sort_msgGroupCnt"></th>
<th>스미싱의심</th>
<th>요청시간<input type="button" class="sort sortBtn" id="sort_reqDate"></th>
<th>예약<input type="button" class="sort sortBtn" id="sort_reserveYn"></th>
<th>내용<input type="button" class="sort sortBtn" id="sort_smsTxt"></th>
<th>타입<input type="button" class="sort sortBtn" id="sort_msgTypeTxt"></th>
<th>방식<input type="button" class="sort sortBtn" id="sort_sendKind"></th> -->
</tr>
</thead>
<tbody id="dynamicTbody">
<tr>
<td colspan="12"><!-- 번호 -->
조회하면 데이터가 나옵니다.
</td>
</tr>
</tbody>
</table>
</div>
<%--
<div class="list_cont" id="listTab_1">
<table class="board_list">
<colgroup>
<col style="width: 200px;">
<col style="width: 220px;">
<col style="width: 200px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 100px;">
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 200px;">
</colgroup>
<thead>
<tr>
<th scope="row">메시지ID
</th>
<th scope="row">문자구분(유형)
</th>
<th scope="row">발신번호
</th>
<th scope="row">전체요청수
</th>
<th scope="row">성공건수
</th>
<th scope="row">실패건수
</th>
<th scope="row">대기건수
</th>
<th scope="row">처리상태
</th>
<th scope="row">문자내용
</th>
<th scope="row">등록일시
</th>
<th scope="row">발송일시
</th>
<th scope="row">남겨진리스트수량(다음페이지여부)
</th>
</tr>
</thead>
<tbody id="dynamicTbody">
</tbody>
</table>
</div> --%>
</div>
<!--// 마이페이지 - 비밀번호 변경 -->
</div>
<!--// send top -->
</div>
<!--// content 영역 -->

View File

@ -64,21 +64,6 @@
height: 55px;
}
.subte{
padding: 14px 25px;
border-radius: 5px;
border: 3px solid #ececec;
}
.subte p{
padding: 2px 0;
text-indent: -8px;
margin: 0 0 0 8px;
font-size: 15px;
line-height: 1.3;
color: #666;
font-weight: 500;
}
</style>
<!-- <script type="text/javascript" src="/js/jquery-3.5.0.js"></script> -->
@ -164,131 +149,103 @@
<!-- for validator #3 -->
<div class="contWrap">
<div class="pageTitle">
<div class="pageIcon">
<img src="/pb/img/pageTitIcon4.png" alt="">
</div>
<h2 class="titType1 c_222222 fwBold">api 문자 발송 테스트</h2>
<p class="tType6 c_999999">발송 테스트</p>
</div>
<div class="pageCont">
<%@include file="/WEB-INF/jsp/uss/ion/api/test/sms/include/tab_include.jsp" %>
<!-- <div class="tabWrap"> -->
<!-- <ul class="tabList"> -->
<!-- <li class="active"><a href="/uss/ion/api/test/sms/sendMsgForm.do">문자발송</a></li> -->
<!-- <li><a href="/uss/ion/api/test/sms/sendMsgsForm.do">대량문자발송</a></li> -->
<!-- <li><a href="/uss/ion/api/test/sms/sendHstryFrom.do">전체발송내역</a></li> -->
<!-- <li><a href="/uss/ion/api/test/sms/sendHstryDetailFrom.do">상세발송내역</a></li> -->
<!-- <li><a href="/uss/ion/api/test/sms/sendSelectPriceFrom.do">발송가능건수</a></li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- 설명문구 추가 -->
<!-- <div class="subte"> -->
<!-- <p>- </p> -->
<!-- <p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p> -->
<!-- <p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p> -->
<!-- <p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p> -->
<!-- <p>- 전송내역이 필요한 경우 기간 내에 다운로드하여 주시기 바랍니다.</p> -->
<!-- </div> -->
<div class="pageCont">
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>발신정보.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>발신자 번호 (callFrom)</th>
<td>
<input type="text" id="callFrom" name="callFrom"
class="input_text" value="01093414986" maxlength="100"
style="width: 300px;"></td>
</tr>
<tr>
<th>수신자 번호 (callToList)</th>
<td><input type="text" id="callToList" name="callToList"
class="input_text" value="01022265487,01011112222"
maxlength="300" style="width: 500px;"></td>
</tr>
<tr>
<th>문자 내용 (smsTxt)</th>
<td><input type="text" id="smsTxt" name="smsTxt"
class="input_text" value="문자 테스트~![*이름*]" maxlength="300"
style="width: 500px;"></td>
</tr>
<tr>
<th>치환용 이름 (nameStr)</th>
<td><input type="text" id="nameStr" name="nameStr"
class="input_text" value="홍길동1|홍길동2" maxlength="300"
style="width: 500px;"></td>
</tr>
<tr>
<th>테스트 여부 (testYn)</th>
<td><input type="text" id="testYn" name="testYn"
class="input_text" value="" maxlength="10" style="width: 100px;">
(기본값 없음, YF-테스트(실패), YS-테스트(성공))</td>
</tr>
</tbody>
</table>
<div class="btnWrap">
<input type="button" class="btnType1" value="발 송"
id="ajax_select_price">
</div>
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>발송 결과.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>메세지ID :</th>
<td>
<input type="text" id="mgi">
</td>
</tr>
<tr>
<th>성공수량 :</th>
<td>
<input type="text" id="sc" style="width: 500px;">
</td>
</tr>
<tr>
<th>실패수량 :</th>
<td>
<input type="text" id="fc" style="width: 500px;">
</td>
</tr>
<tr>
<th>block수량 :</th>
<td>
<input type="text" id="bc" style="width: 500px;">
</td>
</tr>
<tr>
<th>메세지타입 :</th>
<td>
<input type="text" id="mt" style="width: 500px;">
</td>
</tr>
</tbody>
</table>
</div>
<div class="contWrap">
<div class="pageTitle">
<div class="pageIcon">
<img src="/pb/img/pageTitIcon4.png" alt="">
</div>
<h2 class="titType1 c_222222 fwBold">api 문자 발송 테스트</h2>
<p class="tType6 c_999999">발송 테스트</p>
</div>
<div class="pageCont">
<%@include file="/WEB-INF/jsp/uss/ion/api/test/sms/include/tab_include.jsp" %>
<div class="pageCont">
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>발신정보.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>발신자 번호 (callFrom)</th>
<td><input type="text" id="callFrom" value="01093414986"></td>
</tr>
<tr>
<th>수신자 번호 (callToList)</th>
<td><input type="text" id="callToList" value="01022265487,01011112222"></td>
</tr>
<tr>
<th>문자 내용 (smsTxt)</th>
<td><input type="text" id="smsTxt" value="문자 테스트~![*이름*]"></td>
</tr>
<tr>
<th>치환용 이름 (nameStr)</th>
<td><input type="text" id="nameStr" value="홍길동1|홍길동2"></td>
</tr>
<tr>
<th>테스트 여부 (testYn)</th>
<td><input type="text" id="testYn" name="testYn" style="width: 100px;">
(기본값 없음, YF-테스트(실패), YS-테스트(성공))</td>
</tr>
</tbody>
</table>
<div class="btnWrap">
<input type="button" class="btnType1" value="발 송"
id="ajax_select_price">
</div>
<div class="listTop maxWth">
<span class="tType4 c_456ded fwBold">
<p>발송 결과.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>메세지ID :</th>
<td>
<input type="text" id="mgi">
</td>
</tr>
<tr>
<th>성공수량 :</th>
<td>
<input type="text" id="sc" style="width: 500px;">
</td>
</tr>
<tr>
<th>실패수량 :</th>
<td>
<input type="text" id="fc" style="width: 500px;">
</td>
</tr>
<tr>
<th>block수량 :</th>
<td>
<input type="text" id="bc" style="width: 500px;">
</td>
</tr>
<tr>
<th>메세지타입 :</th>
<td>
<input type="text" id="mt" style="width: 500px;">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

View File

@ -65,21 +65,6 @@
height: 55px;
}
.subte{
padding: 14px 25px;
border-radius: 5px;
border: 3px solid #ececec;
}
.subte p{
padding: 2px 0;
text-indent: -8px;
margin: 0 0 0 8px;
font-size: 15px;
line-height: 1.3;
color: #666;
font-weight: 500;
}
</style>

View File

@ -0,0 +1,201 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style>
.tabWrap {
width: 100%;
box-sizing: border-box;
margin-bottom: 20px;
}
.tabList {
display: flex;
justify-content: center; /* 가운데 정렬 */
padding: 0;
margin: 0;
height: 55px;
list-style: none;
background: #f4f4f4;
border-radius: 5px;
}
.tabList li {
flex: 1; /* 동일한 너비 */
text-align: center;
position: relative;
z-index: 10;
}
.tabList li::after{
content: "";
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: 30px;
background-color: #d4d4d4;
z-index: -1;
}
.tabList li:last-child::after{
content: none;
}
.tabList li a {
display: block;
text-decoration: none;
color: #333;
font-weight: 500;
line-height: 55px;
border-radius: 5px;
transition: background 0.2s ease;
}
.tabList li.active a {
background-color: #2e3a59;
color: white;
height: 55px;
}
</style>
<script type="text/javaScript" language="javascript">
$(document).ready(function(){
//발송가능건수
$("#ajax_select_price").click(function(){
$("span#sp").text("");
$("span#lp").text("");
$("span#pp").text("");
$("span#um").text("");
$("span#sspe").text("");
$("span#lspe").text("");
$("span#pspe").text("");
var searchWebParam = {
'p_mberId' : $('#mberId').val()
, 'p_apiKey' : $('#apiKey').val()
};
//검색 API를 Ajax로 이용 하기 위한 호출
$.ajax({
url : "/sample_mjon/jsp_example_select_price_r1.jsp",
//형식을 json으로 받을 것이기 때문에 지정하여 주었습니다.
dataType : "json",
async : false,
type : "POST",
data : searchWebParam,
success: function (returnData, status) {
console.log('returnData : ', returnData)
if (returnData.data.resultCode=="0"){
$("#sp").text(returnData.data.shortPrice);
$("#lp").text(returnData.data.longPrice);
$("#pp").text(returnData.data.picturePrice);
$("#um").text(returnData.data.mberMoney);
$("#sspe").text(returnData.data.shortSendPsbltEa);
$("#lspe").text(returnData.data.longSendPsbltEa);
$("#pspe").text(returnData.data.pictureSendPsbltEa);
} else{
alert(returnData.data.resultCode+" : "+returnData.data.msg);
}
},
error : function(request, status, error){
alert(request+"///"+error+"///"+status+"///"+"AJAX_ERROR");
console.log("AJAX_ERROR");
}
});
});
});
</script>
<div class="contWrap">
<div class="pageTitle">
<div class="pageIcon">
<img src="/pb/img/pageTitIcon4.png" alt="">
</div>
<h2 class="titType1 c_222222 fwBold">api 문자 발송 테스트</h2>
<p class="tType6 c_999999">발송 테스트</p>
</div>
<div class="pageCont">
<%@include file="/WEB-INF/jsp/uss/ion/api/test/sms/include/tab_include.jsp" %>
<div class="btnWrap">
<input type="button" class="btnType2" id="ajax_select_price" value="조회">
</div>
<div class="listTop maxWth" style="margin-top:30px">
<span class="tType4 c_456ded fwBold">
<p>발송 결과.</p>
</span>
</div>
<table class="tbType2">
<colgroup>
<col style="width: 20%">
<col style="width: 80%">
</colgroup>
<tbody>
<tr>
<th>단문단가 :</th>
<td id="sp">
</td>
</tr>
<tr>
<th>장문단가 :</th>
<td id="lp">
</td>
</tr>
<tr>
<th>그림문자단가 :</th>
<td id="pp">
</td>
</tr>
<tr>
<th>현재보유금액 :</th>
<td id="um">
</td>
</tr>
<tr>
<th>단문발송가능건수 :</th>
<td id="sspe">
</td>
</tr>
<tr>
<th>장문발송가능건수 :</th>
<td id="lspe">
</td>
</tr>
<tr>
<th>그림문자발송가능건수 :</th>
<td id="pspe">
</td>
</tr>
</tbody>
</table>
</div>
<!--// 마이페이지 - 비밀번호 변경 -->
</div>
<!--// send top -->
</div>
<!--// content 영역 -->

View File

@ -25,7 +25,7 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "59d8d714ad68ae2e24e3ae2055334e3e"; //발급받은 api ke
final String apiKey = "c2ea9d96775c95c3de9096445db9971d658a"; //발급받은 api ke
//테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
@ -33,7 +33,8 @@
/******************** 전송요청 URL ********************/
final String apiUrl = "http://localhost:8088/api/inqry/hstryDetail"; // 전송요청 URL
// final String apiUrl = "http://localhost:8088/api/inqry/hstryDetail"; // 전송요청 URL
final String apiUrl = "http://119.193.215.98:8087/api/inqry/hstryDetail"; //개발테스트용 URL
// String apiUrl = "https://apidev.munjaon.co.kr:9998/api/inqry/hstryDetail";
/**************** 발송가능건수 예제 ******************/

View File

@ -25,7 +25,7 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "59d8d714ad68ae2e24e3ae2055334e3e"; //발급받은 api ke
final String apiKey = "c2ea9d96775c95c3de9096445db9971d658a"; //발급받은 api key
//테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
@ -33,7 +33,7 @@
/******************** 전송요청 URL ********************/
final String apiUrl = "http://localhost:8088/api/inqry/hstry";
final String apiUrl = "http://119.193.215.98:8087/api/inqry/hstry"; //개발테스트용 URL
/**************** 발송가능건수 예제 ******************/
System.out.println("전체발송이력");

View File

@ -24,8 +24,8 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
final String mberId = "antelope"; //문자온 로그인 아이디
final String apiKey = "59d8d714ad68ae2e24e3ae2055334e3e"; //발급받은 api key
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "c2ea9d96775c95c3de9096445db9971d658a"; //발급받은 api ke
//테스트용
@ -34,7 +34,7 @@
/******************** 전송요청 URL ********************/
final String apiUrl = "https://api.munjaon.co.kr/api/inqry/price";
final String apiUrl = "http://119.193.215.98:8087/api/inqry/price";
/**************** 발송가능건수 예제 ******************/
System.out.println("잔액|단가|발송가능건수");

View File

@ -35,7 +35,7 @@
/******************** 전송 요청 URL ********************/
// final String apiUrl = "https://api.munjaon.co.kr/api/send/sendMsg"; //개발테스트용 URL
// final String apiUrl = "http://localhost:8088/api/send/sendMsg"; //개발테스트용 URL URL
final String apiUrl = "http://192.168.0.176:8088/api/send/sendMsg"; //개발테스트용 URL
final String apiUrl = "http://119.193.215.98:8087/api/send/sendMsg"; //개발테스트용 URL
/******************** 전송 정보 ********************/
//필수 값

View File

@ -35,7 +35,7 @@
/******************** 전송 요청 URL ********************/
// final String apiUrl = "http://api.munjaon.co.kr/api/send/sendMsgs"; //개발테스트용 URL
// final String apiUrl = "http://localhost:8088/api/send/sendMsgs"; //개발테스트용 URL
final String apiUrl = "http://192.168.0.176:8088/api/send/sendMsgs"; //개발테스트용 URL
final String apiUrl = "http://119.193.215.98:8087/api/send/sendMsgs"; //개발테스트용 URL
/******************** 전송 정보 ********************/
//필수 값’