Quellcode durchsuchen

api 신청 페이지 수정중 / 약관동의 페이지 주석 처리 / highlight.js 추가

huiwon.seo vor 4 Jahren
Ursprung
Commit
24a84cf2b5

+ 6 - 6
src/main/java/com/lemon/lifecenter/controller/LoginController.java

@@ -171,12 +171,12 @@ public class LoginController extends LifeCenterController {
                 }
                 
                 // 동의하지않은 필수약관 갯수가 0이상일 경우
-                if( acceptTotal > 0 ) {
-                    LifeCenterSessionController.setSession( request, "sesAcceptCheck", "Y" );
-                    url = "/accept/list";
-                } else {
-                    LifeCenterSessionController.setSession( request, "sesAcceptCheck", "N" );
-                }
+//                if( acceptTotal > 0 ) {
+//                    LifeCenterSessionController.setSession( request, "sesAcceptCheck", "Y" );
+//                    url = "/accept/list";
+//                } else {
+//                    LifeCenterSessionController.setSession( request, "sesAcceptCheck", "N" );
+//                }
             }
         }
         

+ 107 - 13
src/main/webapp/WEB-INF/jsp/api/info.jsp

@@ -4,6 +4,10 @@
 <%@ page language="java" contentType="text/html; charset=UTF-8"
     pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script src="/resources/plugins/highlight/highlight.pack.js"></script>
+<link rel="stylesheet" href="/resources/plugins/highlight/styles/androidstudio.css">
+<script>hljs.initHighlightingOnLoad();</script>
+
 <script>
 $( function(){
     $( "#newForm" ).validate({
@@ -198,11 +202,13 @@ $( function(){
                                                     </div>
                                                 </div>
                                                 
-                                                <div class="row mb-5">
-                                                    <div class="col-12 text-center">
-                                                        <button class="btn btn-success btn-block p-2" onclick="location.href='./new';">신청자 정보 수정</button>
+                                                <c:if test="${viewType eq 'USER'}">
+                                                    <div class="row mb-5">
+                                                        <div class="col-12 text-center">
+                                                            <button class="btn btn-success btn-block p-2" onclick="location.href='./new';">신청자 정보 수정</button>
+                                                        </div>
                                                     </div>
-                                                </div>
+                                                </c:if>
                                                 
                                                 <c:if test="${viewType eq 'USER' and info.useYn eq 'C'}">
                                                     <h2 class="text-dark mb-3 pb-2 border-bottom">API 연동 안내</h2>
@@ -211,7 +217,7 @@ $( function(){
                                                             <h3 class="mb-4"><span class="badge badge-warning h6">></span> Request</h3>
                                                             
                                                             <h5>URL</h5>
-                                                            <div class="bg-dark text-white p-3 border-radius m-2">
+                                                            <div class="bg-dark text-white p-3 border-radius m-2 h5">
                                                                 <div>
                                                                     <span class="mr-2 text-warning">POST</span> 
                                                                     <span>/lifeCenter/api/toAction</span>
@@ -328,8 +334,8 @@ $( function(){
                                                             <div class="mt-3">
                                                                 <span class="h4 text-muted p-2">생활치료센터의 모든 환자일 경우</span>
                                                             </div>
-                                                            <div class="bg-dark m-2 p-4">
-<pre class="mb-0"><code class="language-json hljs h4 text-light">{
+                                                            <div class="m-2">
+<pre class="mb-0"><code class="p-3 h4">{
   <span class="hljs-attr">"resourceType"</span>: <span class="hljs-string">"patientInfoList"</span>,
   <span class="hljs-attr">"patientNumber"</span>: <span class="hljs-string">""</span>,
   <span class="hljs-attr">"patientName"</span>: <span class="hljs-string">""</span>,
@@ -346,8 +352,8 @@ $( function(){
                                                             <div class="mt-5">
                                                                 <span class="h4 text-muted p-2">생활치료센터의 모든 환자일 경우 (patientNumber로 단일 대상)</span>
                                                             </div>
-                                                            <div class="bg-dark m-2 p-4">
-<pre class="mb-0"><code class="language-json hljs h4 text-light">{
+                                                            <div class="m-2">
+<pre class="mb-0"><code class="p-3 h4">{
   <span class="hljs-attr">"resourceType"</span>: <span class="hljs-string">"patientInfoList"</span>,
   <span class="hljs-attr">"patientNumber"</span>: <span class="hljs-string">"62817236"</span>,
   <span class="hljs-attr">"patientName"</span>: <span class="hljs-string">""</span>,
@@ -364,8 +370,8 @@ $( function(){
                                                             <div class="mt-5">
                                                                 <span class="h4 text-muted p-2 mt-3">생활치료센터의 모든 환자일 경우 (patientNumber가 없는 경우 단일 대상)</span>
                                                             </div>
-                                                            <div class="bg-dark m-2 p-4">
-<pre class="mb-0"><code class="language-json hljs h4 text-light">{
+                                                            <div class="m-2">
+<pre class="mb-0"><code class="p-3 h4">{
   <span class="hljs-attr">"resourceType"</span>: <span class="hljs-string">"patientInfoList"</span>,
   <span class="hljs-attr">"patientNumber"</span>: <span class="hljs-string">""</span>,
   <span class="hljs-attr">"patientName"</span>: <span class="hljs-string">"홍길동"</span>,
@@ -381,12 +387,98 @@ $( function(){
                                                             
                                                             <h3 class="text-dark mb-3 pb-2 border-bottom mt-5" id="token"><span class="badge badge-danger text-white"> ! </span> Token 생성 방법</h3>
                                                             <div class="h6 p-3 border bg-muted">
-                                                                <div class="mb-2 h4 text-muted">api 신청자 ID, 요양기관기호, 현재시간을 합쳐서 발급받은 api key로 AES256 암호화  구분자는 | 로 구분</div>
+                                                                <div class="mb-2 h4 text-muted">- 생성한 token은 15분 이내 까지 유효함</div>
+                                                                <div class="mb-2 h4 text-muted">- api 신청자 ID, 요양기관기호, 현재시간을 합쳐서 발급받은 api key로 AES256 암호화  구분자는 | 로 구분</div>
                                                                 <div class="mb-2 h4"><code>decrypt : admin0027|31100988|2021-01-19 10:24:23</code><br/><code>encrypt : FPg9yiuiBmzYIixL1zL549mA6zzPo4rbRSvCSAc6e2eB7q9AjONroEuMJtB7kJ8u</code></div>
                                                             </div>
                                                             
                                                             
-                                                            <h3 class="mb-4"><span class="badge badge-warning h6">></span> Response</h3>
+                                                            <div class="mt-3">
+                                                                <span class="h4 text-muted p-2 mt-3">현재 시간</span>
+                                                            </div>
+<div class="m-2">
+<pre class="mb-0"><code class="p-3 h4">public static String getNow() {
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+
+        return dateFormat.format(date);
+    }
+</code></pre></div>
+                                                            
+                                                            
+                                                            <div class="mt-3">
+                                                                <span class="h4 text-muted p-2 mt-3">AES256 encrypt</span>
+                                                            </div>
+<div class="m-2">
+<pre class="mb-0"><code class="p-3 h4">public static byte[] IV = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+public static String aesEncrypt(String encKey, byte[] iv, String paramInput) throws Exception {
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        SecretKeySpec key = new SecretKeySpec(encKey.getBytes("UTF-8"), "AES");
+
+        cipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv));
+
+        byte[] cipherText = cipher.doFinal(paramInput.getBytes("UTF-8"));
+
+        return Base64.getEncoder().encodeToString(cipherText);
+    }
+</code></pre></div>
+                                                            
+                                                            
+                                                            
+                                                            <h3 class="mb-4 mt-5"><span class="badge badge-warning h6">></span> Response</h3>
+                                                            
+                                                            <h5>Success</h5>
+                                                            <div class="p-2 mb-3">
+                                                                <table class="table">
+                                                                    <thead>
+                                                                        <tr>
+                                                                            <th>Type</th>
+                                                                            <th>Description</th>
+                                                                        </tr>
+                                                                    </thead>
+                                                                    
+                                                                    <tbody>
+                                                                        <tr>
+                                                                            <td><code>String</code></td>
+                                                                            <td>요청 성공시 랜덤 문자열(api key) retrun <br/>
+                                                                                <code class="text-info">Ex) FPg9yiuiBmzYIixL1zL549mA6zzPo4rbRSvCSAc6e2eB7q9AjONroEuMJtB7kJ8u</code>
+                                                                            </td>
+                                                                        </tr>
+                                                                    </tbody>
+                                                                </table>
+                                                            </div>
+                                                            
+                                                            
+                                                            <h5>Failure</h5>
+                                                            <div class="p-2">
+                                                                <table class="table">
+                                                                    <thead>
+                                                                        <tr>
+                                                                            <th>Name</th>
+                                                                            <th>Type</th>
+                                                                            <th>Value</th>
+                                                                            <th>Description</th>
+                                                                        </tr>
+                                                                    </thead>
+                                                                    
+                                                                    <tbody>
+                                                                        <tr>
+                                                                            <td rowspan="3">error</td>
+                                                                            <td rowspan="3"><code>String</code></td>
+                                                                            <td>emptyToken</td>
+                                                                            <td>토큰이 없는 경우</td>
+                                                                        </tr>
+                                                                        <tr>
+                                                                            <td>invalidParameters</td>
+                                                                            <td>필수입력 값과 token의 값이 일치하지 않는 경우</td>
+                                                                        </tr>
+                                                                        <tr>
+                                                                            <td>expireToken</td>
+                                                                            <td>토큰 유효 시간이 지났을 경우</td>
+                                                                        </tr>
+                                                                    </tbody>
+                                                                </table>
+                                                            </div>
                                                         </div>
                                                     </div>
                                                 </c:if>
@@ -396,9 +488,11 @@ $( function(){
                                 </c:choose>
                                 
                                 <!-- 서비스 소개 내용 -->
+                                <c:if test="${viewType eq 'USER'}">
                                 <button class="btn btn-light text-center border-bottom mt-3" onclick="$('div.api-info-wrap').toggle( 200 );$(this).children().toggleClass('fa-caret-up');">
                                     <i class="fa fa-fw fa-caret-down text-dark text-muted"></i>
                                 </button>
+                                </c:if>
                                 
                                 <div class="api-info-wrap mt-4" <c:if test="${info ne null}">style="display:none;"</c:if>>
                                     <h2 class="text-dark mb-3 pb-2 border-bottom mt-4">생활치료센터 비대면진료시스템 API 목록</h2>

+ 3 - 0
src/main/webapp/WEB-INF/jsp/include/sidebar.jsp

@@ -89,6 +89,9 @@
                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "push"}'>active</c:if>">
                             <a class="sidebar-link" href="/push/list">푸시 서비스 관리</a>
                         </li>
+                        <li class="sidebar-item <c:if test='${data._MENUPATH eq "apiapplication"}'>active</c:if>">
+                            <a class="sidebar-link" href="/apiApplication/info">API 서비스 신청</a>
+                        </li>
                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "apimanager"}'>active</c:if>">
                             <a class="sidebar-link" href="/apiManager/list">API 서비스 관리</a>
                         </li>

Datei-Diff unterdrückt, da er zu groß ist
+ 452 - 0
src/main/webapp/resources/plugins/highlight/highlight.pack.js


+ 66 - 0
src/main/webapp/resources/plugins/highlight/styles/androidstudio.css

@@ -0,0 +1,66 @@
+/*
+Date: 24 Fev 2015
+Author: Pedro Oliveira <kanytu@gmail . com>
+*/
+
+.hljs {
+  color: #a9b7c6;
+  background: #282b2e;
+  display: block;
+  overflow-x: auto;
+  padding: 0.5em;
+}
+
+.hljs-number,
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet {
+  color: #6897BB;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-deletion {
+  color: #cc7832;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link {
+  color: #629755;
+}
+
+.hljs-comment,
+.hljs-quote {
+  color: #808080;
+}
+
+.hljs-meta {
+  color: #bbb529;
+}
+
+.hljs-string,
+.hljs-attribute,
+.hljs-addition {
+  color: #6A8759;
+}
+
+.hljs-section,
+.hljs-title,
+.hljs-type {
+  color: #ffc66d;
+}
+
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+  color: #e8bf6a;
+}
+
+.hljs-emphasis {
+  font-style: italic;
+}
+
+.hljs-strong {
+  font-weight: bold;
+}

+ 99 - 0
src/main/webapp/resources/plugins/highlight/styles/default.css

@@ -0,0 +1,99 @@
+/*
+
+Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
+
+*/
+
+.hljs {
+  display: block;
+  overflow-x: auto;
+  padding: 0.5em;
+  background: #F0F0F0;
+}
+
+
+/* Base color: saturation 0; */
+
+.hljs,
+.hljs-subst {
+  color: #444;
+}
+
+.hljs-comment {
+  color: #888888;
+}
+
+.hljs-keyword,
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-meta-keyword,
+.hljs-doctag,
+.hljs-name {
+  font-weight: bold;
+}
+
+
+/* User color: hue: 0 */
+
+.hljs-type,
+.hljs-string,
+.hljs-number,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+  color: #880000;
+}
+
+.hljs-title,
+.hljs-section {
+  color: #880000;
+  font-weight: bold;
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+  color: #BC6060;
+}
+
+
+/* Language color: hue: 90; */
+
+.hljs-literal {
+  color: #78A960;
+}
+
+.hljs-built_in,
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+  color: #397300;
+}
+
+
+/* Meta color: hue: 200 */
+
+.hljs-meta {
+  color: #1f7199;
+}
+
+.hljs-meta-string {
+  color: #4d99bf;
+}
+
+
+/* Misc effects */
+
+.hljs-emphasis {
+  font-style: italic;
+}
+
+.hljs-strong {
+  font-weight: bold;
+}