From f34eb9c9e6b61b596d0085e9a2baec48628b23e1 Mon Sep 17 00:00:00 2001
From: Lawrence <1934378145@qq.com>
Date: 星期四, 14 一月 2021 23:53:57 +0800
Subject: [PATCH] 通道查询排序输出,避免列表杂乱无章

---
 src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
index 950d8f5..a75d753 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
@@ -1,10 +1,13 @@
 package com.genersoft.iot.vmp.vmanager.platform;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
+import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce;
+import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam;
 import com.github.pagehelper.PageInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -14,6 +17,9 @@
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import com.genersoft.iot.vmp.conf.SipConfig;
+
+import java.util.List;
+import java.util.Map;
 
 
 @CrossOrigin
@@ -25,6 +31,7 @@
 
     @Autowired
     private IVideoManagerStorager storager;
+
     @Autowired
     private IRedisCatchStorage redisCatchStorage;
 
@@ -141,5 +148,52 @@
         return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK);
     }
 
+    @RequestMapping("/platforms/channelList")
+    @ResponseBody
+    public PageInfo<ChannelReduce> channelList(int page, int count,
+                                              @RequestParam(required = false) String platformId,
+                                              @RequestParam(required = false) String query,
+                                              @RequestParam(required = false) Boolean online,
+                                              @RequestParam(required = false) Boolean choosed,
+                                              @RequestParam(required = false) Boolean channelType){
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("鏌ヨ鎵�鏈夋墍鏈夐�氶亾API璋冪敤");
+        }
+        PageInfo<ChannelReduce> channelReduces = null;
+        if (platformId != null ) {
+            channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, choosed);
+        }else {
+            channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, null, false);
+        }
+
+        return channelReduces;
+    }
+
+
+    @RequestMapping("/platforms/updateChannelForGB")
+    @ResponseBody
+    public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("缁欎笂绾у钩鍙版坊鍔犲浗鏍囬�氶亾API璋冪敤");
+        }
+        int result = storager.updateChannelForGB(param.getPlatformId(), param.getChannelReduces());
+
+        return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK);
+    }
+
+    @RequestMapping("/platforms/delChannelForGB")
+    @ResponseBody
+    public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("缁欎笂绾у钩鍙版坊鍔犲浗鏍囬�氶亾API璋冪敤");
+        }
+        int result = storager.delChannelForGB(param.getPlatformId(), param.getChannelReduces());
+
+        return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK);
+    }
+
 
 }

--
Gitblit v1.8.0