Kaynağa Gözat

DB 연동 및 click event

inkoreakim 2 yıl önce
ebeveyn
işleme
7c6283d8ed

+ 3 - 1
build.gradle

@@ -43,7 +43,9 @@ dependencies {
     implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
 
     // mssql
-    implementation 'com.microsoft.sqlserver:mssql-jdbc:9.4.0.jre8'
+    //implementation 'com.microsoft.sqlserver:mssql-jdbc:9.4.0.jre8'
+    //mysql
+    implementation 'mysql:mysql-connector-java:8.0.32'
 
 
 }

+ 7 - 6
src/main/java/com/example/ili_web/main/controller/MainController.java

@@ -6,10 +6,11 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+
 @Controller
 @Slf4j
 public class MainController {
-
+    final String HTML_PATH = "html/";
     /**
      method -> index
      description -> index 페이지이동
@@ -20,7 +21,7 @@ public class MainController {
     @GetMapping("/")
     public String index () {
         log.info("========== Move to index ==========");
-        return "/html/index.html";
+        return HTML_PATH + "index.html";
     }
 
     /**
@@ -33,7 +34,7 @@ public class MainController {
     @GetMapping("/about")
     public String about () {
         log.info("========== Move to about ==========");
-        return "/html/about.html";
+        return HTML_PATH + "about.html";
     }
 
     /**
@@ -46,7 +47,7 @@ public class MainController {
     @GetMapping("/business-sector")
     public String businessSector () {
         log.info("========== Move to business-sector ==========");
-        return "/html/business-sector.html";
+        return HTML_PATH + "business-sector.html";
     }
 
     /**
@@ -59,12 +60,12 @@ public class MainController {
     @GetMapping("/info-plaza")
     public String infoPlaza () {
         log.info("========== Move to info-plaza ==========");
-        return "/html/info-plaza.html";
+        return HTML_PATH + "info-plaza.html";
     }
 
     @GetMapping("/contact-us")
     public String contactUs () {
         log.info("========== Move to info-plaza ==========");
-        return "/html/contact-us.html";
+        return HTML_PATH + "contact-us.html";
     }
 }

+ 8 - 4
src/main/resources/application.properties

@@ -1,6 +1,10 @@
 #spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
 logging.level.org.springframework.web=INFO
-spring.datasource.url=jdbc:sqlserver://210.183.61.202:14451;databaseName=ili_web
-spring.datasource.username=ili_web
-spring.datasource.password=ili_web!!
-spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
+spring.datasource.url=jdbc:mysql://103.55.191.37:3306/logisticsbiz?iliweb_test
+spring.datasource.username=logisticsbiz
+spring.datasource.password=#il2020)(*
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+
+
+#?? ??
+server.port=80

+ 6 - 0
src/main/resources/static/js/business-sector/bizChangeInner.js

@@ -0,0 +1,6 @@
+function changeInner (name) {
+    const element = document.getElementById(`${name}`)
+    const anotherElement = document.getElementsByClassName('container marketing');
+    for (let div of anotherElement) div.style.display = 'none';
+    element.style.display = 'block'
+}

+ 2 - 2
src/main/resources/templates/html/about.html

@@ -15,7 +15,7 @@
     <link href="/css/about.css" rel="stylesheet">
 </head>
 <body>
-<header th:include="/html/common/header" id="header"></header>
+<header th:include="html/common/header" id="header"></header>
 
 <main>
     <div class="carousel slide" data-bs-ride="carousel" id="myCarousel">
@@ -129,7 +129,7 @@
     </div>
 </main>
 <hr class="featurette-divider">
-<footer class="footer" th:include="/html/common/footer"></footer>
+<footer class="footer" th:include="html/common/footer"></footer>
 </body>
 <script src="/js/about/scroll.js"></script>
 </html>

+ 19 - 16
src/main/resources/templates/html/business-sector.html

@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="en" xmlns:th="http://www.thymeleaf.org">
+<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
 <head>
     <meta charset="utf-8">
     <meta content="width=device-width, initial-scale=1" name="viewport">
@@ -19,7 +19,7 @@
     <link href="/css/index.css" rel="stylesheet">
 </head>
 <body>
-<header th:include="/html/common/header">
+<header th:include="html/common/header">
 </header>
 <main>
     <div class="carousel slide" data-bs-ride="carousel" id="myCarousel">
@@ -39,17 +39,19 @@
                     <div class="carousel-caption">
                         <h1>사업영역</h1>
                         <p>The Master of Global Logistics</p>
-                        <p><a class="btn" href="#plane" th:onclick="scrollToDiv('outline')">항공운송</a>
-                            <a class="btn" href="#greeting" th:onclick="scrollToDiv('greeting')">해상운송</a>
-                            <a class="btn" href="#history" th:onclick="scrollToDiv('history')">복합운송</a>
-                            <a class="btn" href="#philosophy" th:onclick="scrollToDiv('philosophy')">국제특송</a>
-                            <a class="btn" href="#philosophy" th:onclick="scrollToDiv('philosophy')">전자상거래</a>
+                        <p>
+                            <button class="btn btn-primary"  th:onclick="changeInner('inner_airplane')">항공운송</button>
+                            <button class="btn btn-primary"  th:onclick="changeInner('inner_ship')">해상운송</button>
+                            <button class="btn btn-primary"  th:onclick="changeInner('inner_multi')">복합운송</button>
+                            <button class="btn btn-primary"  th:onclick="changeInner('philosophy')">국제특송</button>
+                            <button class="btn btn-primary"  th:onclick="changeInner('philosophy')">전자상거래</button>
                         </p>
-                        <p><a class="btn" href="#outline" th:onclick="scrollToDiv('outline')">특수화물</a>
-                            <a class="btn" href="#greeting" th:onclick="scrollToDiv('greeting')">철도운송</a>
-                            <a class="btn" href="#history" th:onclick="scrollToDiv('history')">유통물류</a>
-                            <a class="btn" href="#philosophy" th:onclick="scrollToDiv('philosophy')">국경운송</a>
-                            <a class="btn" href="#philosophy" th:onclick="scrollToDiv('philosophy')">물류컨설팅</a>
+                        <p>
+                            <button class="btn btn-primary" th:onclick="changeInner('outline')">특수화물</button>
+                            <button class="btn btn-primary" th:onclick="changeInner('greeting')">철도운송</button>
+                            <button class="btn btn-primary" th:onclick="changeInner('history')">유통물류</button>
+                            <button class="btn btn-primary" th:onclick="changeInner('philosophy')">국경운송</button>
+                            <button class="btn btn-primary" th:onclick="changeInner('philosophy')">물류컨설팅</button>
                         </p>
                     </div>
                 </div>
@@ -58,16 +60,17 @@
     </div>
     <!-- 업무내용 설명 -->
 
-    <div class="container marketing" th:include="/html/business-inner/airplane" id="inner_airplane" style="display: none">
+    <div class="container marketing" th:include="html/business-inner/airplane" id="inner_airplane" >
     </div>
-    <div class="container marketing" th:include="/html/business-inner/ship" id="inner_ship" style="display: none">
+    <div class="container marketing" th:include="html/business-inner/ship" id="inner_ship" style="display: none">
     </div>
-    <div class="container marketing" th:include="/html/business-inner/multi" id="multi">
+    <div class="container marketing" th:include="html/business-inner/multi" id="inner_multi" style="display: none">
     </div>
 </main>
 
-<footer class="footer" th:include="/html/common/footer">
+<footer class="footer" th:include="html/common/footer">
 
 </footer>
 </body>
+<script src="/js/business-sector/bizChangeInner.js"></script>
 </html>

+ 1 - 1
src/main/resources/templates/html/common/header.html

@@ -22,7 +22,7 @@
                 </li>
             </ul>
             <form class="d-flex">
-                <button class="btn btn-success" type="button">물류회원전용</button>
+                <a class="btn btn-success" type="button" href="http://www.nn21.net">물류회원전용</a>
             </form>
         </div>
     </div>

+ 87 - 0
src/main/resources/templates/html/contact-inner/logi-advice.html

@@ -0,0 +1,87 @@
+<div class="row">
+    <div class="col-lg-4">
+    </div>
+    <div class="col-lg-4">
+        <h1>물류 자문</h1>
+    </div>
+    <div class="col-lg-4">
+    </div>
+</div>
+<!-- Grid -->
+<div class="row" style="height: 300px;">
+    <!-- 왼쪽 영역: 문의 목록 표시 -->
+    <div class="col-md-6">
+        <h3 class="text-center">문의 목록</h3>
+        <table class="table table-striped">
+            <thead>
+            <tr>
+                <th>일시</th>
+                <th>제목</th>
+                <th>작성자</th>
+            </tr>
+            </thead>
+            <tbody>
+            <!-- 여기에 문의 목록을 동적으로 추가 -->
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <!-- 추가적인 문의 목록 행들을 여기에 추가 -->
+            </tbody>
+        </table>
+        <nav aria-label="Page navigation">
+            <ul class="pagination justify-content-center">
+                <li class="page-item disabled">
+                    <a aria-disabled="true" class="page-link" href="#" tabindex="-1">Previous</a>
+                </li>
+                <li class="page-item"><a class="page-link" href="#">1</a></li>
+                <li class="page-item"><a class="page-link" href="#">2</a></li>
+                <li class="page-item"><a class="page-link" href="#">3</a></li>
+                <li class="page-item">
+                    <a class="page-link" href="#">Next</a>
+                </li>
+            </ul>
+        </nav>
+    </div>
+    <!-- 오른쪽 영역: 문의 내용 표시 -->
+    <div class="col-md-6">
+        <h3 class="text-center">문의 내용</h3>
+        <div class="row">
+
+            <div class="col">
+                <!-- 일시, 제목, 작성자 표시 -->
+                <p><strong>일시:</strong> 2024-03-04 15:00</p>
+                <p><strong>제목:</strong> 문의 제목 1</p>
+                <p><strong>작성자:</strong> 작성자 이름</p>
+            </div>
+            <!-- 내용 표시 textarea -->
+            <div class="row">
+                <!-- 내용 표시 textarea -->
+                <div class="col">
+                    <textarea class="form-control" rows="5" readonly>문의 내용을 여기에 표시합니다.</textarea>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 87 - 0
src/main/resources/templates/html/contact-inner/notice.html

@@ -0,0 +1,87 @@
+<div class="row">
+    <div class="col-lg-4">
+    </div>
+    <div class="col-lg-4">
+        <h1>안내 / 공지</h1>
+    </div>
+    <div class="col-lg-4">
+    </div>
+</div>
+<!-- Grid -->
+<div class="row" style="height: 300px;">
+    <!-- 왼쪽 영역: 문의 목록 표시 -->
+    <div class="col-md-6">
+        <h3 class="text-center">공지 목록</h3>
+        <table class="table table-striped">
+            <thead>
+            <tr>
+                <th>일시</th>
+                <th>제목</th>
+                <th>작성자</th>
+            </tr>
+            </thead>
+            <tbody>
+            <!-- 여기에 문의 목록을 동적으로 추가 -->
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <tr>
+                <td>2024-03-04</td>
+                <td>문의 제목1</td>
+                <td>김주한</td>
+            </tr>
+            <!-- 추가적인 문의 목록 행들을 여기에 추가 -->
+            </tbody>
+        </table>
+        <nav aria-label="Page navigation">
+            <ul class="pagination justify-content-center">
+                <li class="page-item disabled">
+                    <a aria-disabled="true" class="page-link" href="#" tabindex="-1">Previous</a>
+                </li>
+                <li class="page-item"><a class="page-link" href="#">1</a></li>
+                <li class="page-item"><a class="page-link" href="#">2</a></li>
+                <li class="page-item"><a class="page-link" href="#">3</a></li>
+                <li class="page-item">
+                    <a class="page-link" href="#">Next</a>
+                </li>
+            </ul>
+        </nav>
+    </div>
+    <!-- 오른쪽 영역: 문의 내용 표시 -->
+    <div class="col-md-6">
+        <h3 class="text-center">문의 내용</h3>
+        <div class="row">
+
+            <div class="col">
+                <!-- 일시, 제목, 작성자 표시 -->
+                <p><strong>일시:</strong> 2024-03-04 15:00</p>
+                <p><strong>제목:</strong> 문의 제목 1</p>
+                <p><strong>작성자:</strong> 작성자 이름</p>
+            </div>
+            <!-- 내용 표시 textarea -->
+            <div class="row">
+                <!-- 내용 표시 textarea -->
+                <div class="col">
+                    <textarea class="form-control" rows="5" readonly>문의 내용을 여기에 표시합니다.</textarea>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 5 - 93
src/main/resources/templates/html/contact-us.html

@@ -19,7 +19,7 @@
     <link href="/css/index.css" rel="stylesheet">
 </head>
 <body>
-<header th:include="/html/common/header">
+<header th:include="html/common/header">
 </header>
 <main>
     <div class="carousel slide" data-bs-ride="carousel" id="myCarousel">
@@ -40,6 +40,7 @@
                         <h1>고객센터</h1>
                         <p>The Master of Global Logistics</p>
                         <p><a class="btn" href="#plane" th:onclick="scrollToDiv('outline')">안내/공지</a>
+                            <a class="btn" href="#greeting" th:onclick="scrollToDiv('greeting')">물류견적</a>
                             <a class="btn" href="#greeting" th:onclick="scrollToDiv('greeting')">물류자문</a>
                             <a class="btn" href="#history" th:onclick="scrollToDiv('history')">무역자문</a>
                         </p>
@@ -50,103 +51,14 @@
     </div>
     <!-- 업무내용 설명 -->
 
-    <div class="container marketing" id="notice">
-        <div class="row">
-            <div class="col-lg-4">
-            </div>
-            <div class="col-lg-4">
-                <h1>안내 / 공지</h1>
-            </div>
-            <div class="col-lg-4">
-            </div>
-        </div>
-        <!-- Grid -->
-        <div class="row" style="height: 300px;">
-            <!-- 왼쪽 영역: 문의 목록 표시 -->
-            <div class="col-md-6">
-                <h3 class="text-center">문의 목록</h3>
-                <table class="table table-striped">
-                    <thead>
-                    <tr>
-                        <th>일시</th>
-                        <th>제목</th>
-                        <th>작성자</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    <!-- 여기에 문의 목록을 동적으로 추가 -->
-                    <tr>
-                        <td>2024-03-04</td>
-                        <td>문의 제목1</td>
-                        <td>김주한</td>
-                    </tr>
-                    <tr>
-                        <td>2024-03-04</td>
-                        <td>문의 제목1</td>
-                        <td>김주한</td>
-                    </tr>
-                    <tr>
-                        <td>2024-03-04</td>
-                        <td>문의 제목1</td>
-                        <td>김주한</td>
-                    </tr>
-                    <tr>
-                        <td>2024-03-04</td>
-                        <td>문의 제목1</td>
-                        <td>김주한</td>
-                    </tr>
-                    <tr>
-                        <td>2024-03-04</td>
-                        <td>문의 제목1</td>
-                        <td>김주한</td>
-                    </tr>
-                    <!-- 추가적인 문의 목록 행들을 여기에 추가 -->
-                    </tbody>
-                </table>
-                <nav aria-label="Page navigation">
-                    <ul class="pagination justify-content-center">
-                        <li class="page-item disabled">
-                            <a aria-disabled="true" class="page-link" href="#" tabindex="-1">Previous</a>
-                        </li>
-                        <li class="page-item"><a class="page-link" href="#">1</a></li>
-                        <li class="page-item"><a class="page-link" href="#">2</a></li>
-                        <li class="page-item"><a class="page-link" href="#">3</a></li>
-                        <li class="page-item">
-                            <a class="page-link" href="#">Next</a>
-                        </li>
-                    </ul>
-                </nav>
-            </div>
-            <!-- 오른쪽 영역: 문의 내용 표시 -->
-            <div class="col-md-6">
-                <h3 class="text-center">문의 내용</h3>
-                <div class="row">
-
-                    <div class="col">
-                        <!-- 일시, 제목, 작성자 표시 -->
-                        <p><strong>일시:</strong> 2024-03-04 15:00</p>
-                        <p><strong>제목:</strong> 문의 제목 1</p>
-                        <p><strong>작성자:</strong> 작성자 이름</p>
-                    </div>
-                    <!-- 내용 표시 textarea -->
-                    <div class="row">
-                        <!-- 내용 표시 textarea -->
-                        <div class="col">
-                            <textarea class="form-control" rows="5" readonly>문의 내용을 여기에 표시합니다.</textarea>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <div class="container marketing" id="inner_ship" style="display: none" th:include="/html/business-inner/ship">
+    <div class="container marketing" id="notice" th:include="html/contact-inner/notice">
     </div>
-    <div class="container marketing" id="multi" style="display: none" th:include="/html/business-inner/multi">
+    <div class="container marketing" id="logi_advice" th:include="html/contact-inner/logi-advice">
     </div>
     <hr class="featurette-divider">
 </main>
 
-<footer class="footer" th:include="/html/common/footer">
+<footer class="footer" th:include="html/common/footer">
 
 </footer>
 </body>

+ 4 - 4
src/main/resources/templates/html/index.html

@@ -20,7 +20,7 @@
 </head>
 <body>
 
-<header th:include="/html/common/header">
+<header th:include="html/common/header">
 </header>
 
 <main>
@@ -44,7 +44,7 @@
                     <div class="carousel-caption text-start">
                         <h1>국제종합물류 홈페이지를 찾아주신 여러분 환영합니다</h1>
                         <p>" 혁신경영으로 고객만족에 최선을 다하겠습니다 "</p>
-                        <p><a class="btn btn-lg btn-primary" href="#">회사소개</a></p>
+                        <p><a class="btn btn-lg btn-primary" href="/about">회사소개</a></p>
                     </div>
                 </div>
             </div>
@@ -76,7 +76,7 @@
                         <p>IL Logistics는 급변하는 글로벌 경쟁시장에서</p>
                         <p>고객의 실제적 상황에 따라 최적의 물류써비스를 제공하여</p>
                         <p>고객의 이익극대화에 최선을 다하고 있습니다</p>
-                        <p><a class="btn btn-lg btn-primary" href="#">사업영역</a></p>
+                        <p><a class="btn btn-lg btn-primary" href="/business-sector">사업영역</a></p>
                     </div>
                 </div>
             </div>
@@ -217,7 +217,7 @@
     </div><!-- /.container -->
 
 
-    <footer class="footer" th:include="/html/common/footer">
+    <footer class="footer" th:include="html/common/footer">
 
     </footer>
 </main>

+ 2 - 2
src/main/resources/templates/html/info-plaza.html

@@ -19,13 +19,13 @@
     <link href="/css/index.css" rel="stylesheet">
 </head>
 <body>
-<header th:include="/html/common/header">
+<header th:include="html/common/header">
 </header>
 <main>
 
 </main>
 
-<footer class="footer" th:include="/html/common/footer">
+<footer class="footer" th:include="html/common/footer">
 
 </footer>
 </body>