瀏覽代碼

update 2024-03-12

junggilpark 1 年之前
父節點
當前提交
2ff6867ec6

+ 7 - 7
src/main/java/com/its/web/controller/common/CommonController.java

@@ -44,14 +44,14 @@ public class CommonController {
     @GetMapping(value="/upload/{imageName}")
     @ResponseBody
     public byte[] getImage(@PathVariable("imageName") String imageName) {
-        return this.service.upload(imageName, "image");
+        return this.service.upload(imageName);
     }
 
-    @ApiOperation(value = "홍보동영상 소스 가져오기")
-    @GetMapping(value="/video/{imageName}")
-    @ResponseBody
-    public byte[] getVideo(@PathVariable("imageName") String imageName) {
-        return this.service.upload(imageName, "video");
-    }
+//    @ApiOperation(value = "홍보동영상 소스 가져오기")
+//    @GetMapping(value="/video/{imageName}")
+//    @ResponseBody
+//    public byte[] getVideo(@PathVariable("imageName") String imageName) {
+//        return this.service.upload(imageName, "video");
+//    }
 
 }

+ 5 - 4
src/main/java/com/its/web/service/common/CommonService.java

@@ -113,12 +113,13 @@ public class CommonService {
         return uploadImageInfo;
     }
 
-    public byte[] upload(String imageName, String type) {
+//    public byte[] upload(String imageName, String type) {
+    public byte[] upload(String imageName) {
         byte[] image = null;
         File file = new File(imageLocation, imageName);
-        if (type.equals("video")) {
-            file = new File(videoLocation, imageName);
-        }
+//        if (type.equals("video")) {
+//            file = new File(videoLocation, imageName);
+//        }
 
         int fileSize = (int) file.length();
         if (fileSize > 0) {

+ 1 - 3
src/main/java/com/its/web/service/traffic/TrafficService.java

@@ -142,9 +142,7 @@ public class TrafficService {
         Map<String, List<TbAtrdDto>> resultMap = new HashMap<>();
         atrdList.forEach(atrd->{
             if (atrd != null) {
-                if (resultMap.get(atrd.getAtrdNm()) == null) {
-                    resultMap.put(atrd.getAtrdNm(), new ArrayList<TbAtrdDto>());
-                }
+                resultMap.computeIfAbsent(atrd.getAtrdNm(), k -> new ArrayList<TbAtrdDto>());
                 resultMap.get(atrd.getAtrdNm()).add(atrd);
             }
         });

+ 2 - 2
src/main/resources/mybatis/mapper/its/traffic/TrafficMapper.xml

@@ -495,7 +495,7 @@
         <if test="upHillId != null and downHillId != null ">
             AND A.atrd_id in (#{upHillId}, #{downHillId})
         </if>
-        ORDER BY A.atrd_id, C.ord;
+        ORDER BY A.atrd_id, C.ord
     </select>
 
     <select id="findAtrdIfscVertexByIdAndLevel" parameterType="java.util.HashMap" resultType="com.its.web.dto.traffic.TbAtrdDto">
@@ -554,7 +554,7 @@
         <if test="upHillId != null and downHillId != null ">
             AND A.atrd_id in (#{upHillId}, #{downHillId})
         </if>
-        ORDER BY A.atrd_id, C.ord, D.ord;
+        ORDER BY A.atrd_id, C.ord, D.ord
     </select>
 
     <select id="findAtrdLinkVertexByIdAndLevel" parameterType="java.util.HashMap" resultType="com.its.web.dto.traffic.TbAtrdDto">

+ 6 - 3
src/main/resources/static/css/main.css

@@ -220,13 +220,16 @@ body {
     align-items: flex-start;
 }
 .mainWrap .bottom > div:nth-child(2) > div:first-child{
-    width: 100%;
+    width: 80%;
+    height: 100%;
+    border-radius: 5%;
 }
 .mainWrap .bottom video {
-    width: 80%;
+    width: 100%;
     /*height: calc(100% - 30px);*/
     height: 100%;
     border-radius: 15px;
+    background-color: black;
 }
 .mainWrap .mid > div {
     width: calc(33.3333%);
@@ -457,7 +460,7 @@ body {
         padding: 1.5rem 1.5rem 0.5rem 1.5rem;
         height: 135px;
     }
-    .mainWrap .bottom > div:nth-child(2) video {
+    .mainWrap .bottom > div:nth-child(2) > div:first-child{
         width: 100%;
     }
     .mainWrap .bottom > div:nth-child(2) {

File diff suppressed because it is too large
+ 307 - 440
src/main/resources/static/js/traffic/traffic.js


二進制
src/main/resources/static/video/video.mp4


+ 2 - 2
src/main/resources/templates/include/head.html

@@ -3,6 +3,6 @@
 <script th:src="@{/js/jquery/jquery-ui-touch-punch.min.js}"></script>
 <link rel="stylesheet" th:href="@{/css/common.css}">
 <link rel="stylesheet" th:href="@{/css/jquery-ui.css}">
-<link rel="stylesheet" th:href="@{/js/jquery-confirm-v3.3.4/jquery-confirm.min.css}">
+<!--<link rel="stylesheet" th:href="@{/js/jquery-confirm-v3.3.4/jquery-confirm.min.css}">-->
 <script th:src="@{/js/common/common.js}"></script>
-<script th:src="@{/js/jquery-confirm-v3.3.4/jquery-confirm.min.js}"></script>
+<!--<script th:src="@{/js/jquery-confirm-v3.3.4/jquery-confirm.min.js}"></script>-->

+ 31 - 30
src/main/resources/templates/include/traffic.html

@@ -87,35 +87,36 @@
     </ul>
 </div>
 <script th:inline="javascript">
-    const type = [[${type}]];
-    switch (type) {
-        case 'cctv' :
-            _CctvFlag = true;
-            _CctvListFlag = true;
-            break;
-        case 'intersection' :
-            _IntersectionFlag = true;
-            _IntersectionListFlag = true;
-            break;
-        case 'vms' :
-            _VmsFlag = true;
-            _VmsListFlag = true;
-            break;
-        case 'incident' :
-            _IncidentFlag = true;
-            _IncidentListFlag = true;
-            break;
-        case 'traffic' :
-            _TrafficFlag = true;
-            _TrafficListFlag = true;
-            break;
-        case 'parking' :
-            _ParkingFlag = true;
-            _ParkingListFlag = true;
-            break;
-    }
-    const tab = $('#' + type + '-tab');
-    const legend = $('#' + type + '-legend');
+    const _type = [[${type}]];
+    // switch (type) {
+    //     case 'cctv' :
+    //         _CctvFlag = true;
+    //         _CctvListFlag = true;
+    //         break;
+    //     case 'intersection' :
+    //         _IntersectionFlag = true;
+    //         _IntersectionListFlag = true;
+    //         break;
+    //     case 'vms' :
+    //         _VmsFlag = true;
+    //         _VmsListFlag = true;
+    //         break;
+    //     case 'incident' :
+    //         _IncidentFlag = true;
+    //         _IncidentListFlag = true;
+    //         break;
+    //     case 'traffic' :
+    //         _TrafficFlag = true;
+    //         _TrafficListFlag = true;
+    //         break;
+    //     case 'parking' :
+    //         _ParkingFlag = true;
+    //         _ParkingListFlag = true;
+    //         break;
+    // }
+
+    const tab = $('#' + _type + '-tab');
+    const legend = $('#' + _type + '-legend');
     tab.addClass('active');
     tab.on('click', ()=>{
         return;
@@ -123,5 +124,5 @@
     legend.addClass('active');
     tab.children().eq(0).addClass('active');
     legend.children().eq(0).addClass('active');
-    $('.traffic-color-legend').addClass(type);
+    $('.traffic-color-legend').addClass(_type);
 </script>

+ 8 - 5
src/main/resources/templates/main/main.html

@@ -41,11 +41,12 @@
                             <div>포항시교통정보센터 홍보 영상입니다.</div>
                         </div>
                         <div>
-                            <!--                            <div><img src="/images/icon/video.png" alt="동영상 아이콘">홍보 동영상</div>-->
-                            <video controls>
-                                <source src="/api/common/video/video.mp4" preload="metadata" type="video/mp4">
-                                이 문장은 여러분의 브라우저가 video 태그를 지원하지 않을 때 화면에 표시됩니다!
-                            </video>
+                            <div>
+                                <video id="video" muted playsinline controls>
+                                    <source src="/video/video.mp4" preload="metadata" type="video/mp4">
+                                    이 문장은 여러분의 브라우저가 video 태그를 지원하지 않을 때 화면에 표시됩니다!
+                                </video>
+                            </div>
                         </div>
                     </div>
                     <div class="mid">
@@ -103,6 +104,8 @@
 
 <script th:inline="javascript">
     //    let isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
+
+
     const popup = [[${popup}]];
     if (popup && popup.length > 0) {
         let top = $('header').innerHeight();

Some files were not shown because too many files changed in this diff