정수빈 정수빈 2025-07-29
Merge branch 'master' of http://subsub8729@vcs.iten.co.kr:9999/hylee/mjon_git
@070315b1b0363574a39828f70c63406747499bf2
src/main/java/itn/let/mjo/test/web/TestController.java
--- src/main/java/itn/let/mjo/test/web/TestController.java
+++ src/main/java/itn/let/mjo/test/web/TestController.java
@@ -42,6 +42,7 @@
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
@@ -3501,5 +3502,40 @@
 		
 	}
 	
+	
+	@RequestMapping("/uss/ion/test/callNicepay.do")
+    public String callNicepay(Model model) {
+        String url = "https://dev.nicepay.co.kr/webapi/sslConnectionTest.jsp";
+        String mid = "itn180208m"; // 실제 MID 값으로 변경
+        
+        try {
+            // RestTemplate 사용
+            RestTemplate restTemplate = new RestTemplate();
+            
+            // 헤더 설정
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+            
+            // 파라미터 설정
+            MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
+            params.add("MID", mid);
+
+            HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
+
+            // POST 요청
+            ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class);
+
+            // JSP에 전달
+            model.addAttribute("result", response.getBody());
+            model.addAttribute("url", url);
+            model.addAttribute("mid", mid);
+
+        } catch (Exception e) {
+            model.addAttribute("result", "에러 발생: " + e.getMessage());
+        }
+
+        return "uss/ion/test/TestNicePaySSL"; // nicepayResult.jsp로 이동
+    }
+	
 
 }
 
src/main/webapp/WEB-INF/jsp/uss/ion/test/TestNicePaySSL.jsp (added)
+++ src/main/webapp/WEB-INF/jsp/uss/ion/test/TestNicePaySSL.jsp
@@ -0,0 +1,57 @@
+<%@ page contentType="text/html; charset=utf-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
+
+
+<html lang="ko">
+<head>
+<title>세금계산서 관리</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+	<div class="contWrap">
+		<div class="pageTitle">
+			<div class="pageIcon"><img src="/pb/img/pageTitIcon4.png" alt=""></div>
+			<h2 class="titType1 c_222222 fwBold">Nicepay SSL 호출 결과</h2>
+			<p class="tType6 c_999999">Nicepay SSL 호출 결과</p>
+		</div>
+		<div class="pageCont">
+			<!-- 세금계산서 -->
+			<div class="tableWrap">
+				<table class="tbType1">
+					<colgroup>
+						<col style="width: 40%">
+						<col style="width: 20%">
+						<col style="width: 40%">
+					</colgroup>
+					<thead>
+						<tr>
+							<th>url</th>
+							<th>mid</th>
+							<th>결과</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr>
+							<td>
+								${url}
+							</td>
+							<td>
+								${mid}
+							</td>
+							<td>
+								${result}
+							</td>							
+						</tr>
+					</tbody>
+				</table>
+			</div>
+			<div class="btnWrap">
+			</div>
+		</div>
+	</div>
+
+</body>
+</html>(No newline at end of file)
Add a comment
List