浏览代码

视频直播间接口以及报警设备接口
2022年8月19日19时06分

纪新园 2 年之前
父节点
当前提交
c5e438e23d

+ 13 - 0
pom.xml

@@ -145,6 +145,19 @@
                 <version>${fastjson.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>org.apache.httpcomponents</groupId>
+                <artifactId>httpclient</artifactId>
+                <version>4.5.5</version>
+            </dependency>
+
+            <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
+            <dependency>
+                <groupId>com.google.code.gson</groupId>
+                <artifactId>gson</artifactId>
+                <version>2.8.7</version>
+            </dependency>
+
             <!--Token生成与解析-->
             <dependency>
                 <groupId>io.jsonwebtoken</groupId>

+ 11 - 0
ruoyi-admin/pom.xml

@@ -20,6 +20,17 @@
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
             <version>4.5.5</version>
         </dependency>
 

+ 187 - 60
ruoyi-admin/src/main/java/com/ruoyi/web/controller/liveBroadcast/controller/LiveBroadcastController.java

@@ -90,23 +90,28 @@ public class LiveBroadcastController {
     }
 
     /**
-     * 获取挑战码接口
+     * 根据监控点编号查询直播间信息
      */
-//    @ApiOperation("获取挑战码接口")
-    @PostMapping(value = "/challengeCode")
-    public AjaxResult challengeCode(@RequestParam(value = "name") String name,
-                                    @RequestParam(value = "productCode", required = false) String productCode,
-                                    @RequestParam(value = "type") String type) {
+    @ApiOperation("根据监控点编号查询直播间信息")
+    @PostMapping(value = "/cameraCode")
+    public AjaxResult cameraCode(@RequestParam(value = "cameraCode", required = false) String cameraCode,
+                            @RequestParam(value = "streamType", required = false) String streamType,
+                            @RequestParam(value = "projectId") String projectId,
+                                 @RequestParam(value = "Authorization") String Authorization,
+                             @RequestParam(value = "token") String token
+    ) {
 
         Map<String, Object> rsp = new HashMap<>();
 
-        rsp.put("name", name);
-        rsp.put("productCode", productCode);
-        rsp.put("type", type);
+        rsp.put("cameraCode", cameraCode);
+        rsp.put("streamType", streamType);
+        rsp.put("projectId", projectId);
 
         OkHttpClient okHttpClient = new OkHttpClient();
         Request request = new Request.Builder()
-                .url(LiveBroadcast.CHALLENGE_CODE)
+                .addHeader("access_token",token)
+                .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.CAMERA_CODE)
                 .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .build();
@@ -125,32 +130,32 @@ public class LiveBroadcastController {
     }
 
     /**
-     * 登录
+     * 开通直播间
      */
-//    @ApiOperation("登录")
-    @PostMapping(value = "/login")
-    public AjaxResult login(@RequestParam(value = "name") String name,
-                            @RequestParam(value = "password") String password,
-                            @RequestParam(value = "productCode", required = false) String productCode,
-                            @RequestParam(value = "type") String type,
-                            @RequestParam(value = "verifyCodeId", required = false) String verifyCodeId,
-                            @RequestParam(value = "expired", required = false) String expired,
-                            @RequestParam(value = "codeId") String codeId
+    @ApiOperation("开通直播间")
+    @PostMapping(value = "/create")
+    public AjaxResult create(@RequestParam(value = "title") String title,
+                             @RequestParam(value = "desc") String desc,
+                             @RequestParam(value = "projectId") String projectId,
+                             @RequestParam(value = "canWatch", required = false) String canWatch,
+                             @RequestParam(value = "autoVod", required = false) String autoVod,
+                             @RequestParam(value = "Authorization") String Authorization,
+                             @RequestParam(value = "token") String token
     ) {
 
         Map<String, Object> rsp = new HashMap<>();
 
-        rsp.put("name", name);
-        rsp.put("password", password);
-        rsp.put("productCode", productCode);
-        rsp.put("type", type);
-        rsp.put("verifyCodeId", verifyCodeId);
-        rsp.put("expired", expired);
-        rsp.put("codeId", codeId);
+        rsp.put("title", title);
+        rsp.put("desc", desc);
+        rsp.put("projectId", projectId);
+        rsp.put("canWatch", canWatch);
+        rsp.put("autoVod", autoVod);
 
         OkHttpClient okHttpClient = new OkHttpClient();
         Request request = new Request.Builder()
-                .url(LiveBroadcast.LOGIN)
+                .addHeader("Authorization",Authorization)
+                .addHeader("access_token",token)
+                .url(LiveBroadcast.CREATE)
                 .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .build();
@@ -168,30 +173,27 @@ public class LiveBroadcastController {
         return AjaxResult.success(result);
     }
 
-
     /**
-     * 根据监控点编号查询直播间信息
+     * 删除直播间
      */
-    @ApiOperation("根据监控点编号查询直播间信息")
-    @PostMapping(value = "/cameraCode")
-    public AjaxResult cameraCode(@RequestParam(value = "cameraCode", required = false) String cameraCode,
-                            @RequestParam(value = "streamType", required = false) String streamType,
-                            @RequestParam(value = "projectId") String projectId,
-                                 @RequestParam(value = "Authorization") String Authorization,
+    @ApiOperation("删除直播间")
+    @PostMapping(value = "/delete")
+    public AjaxResult delete(@RequestParam(value = "id") String id,
+                             @RequestParam(value = "projectId") String projectId,
+                             @RequestParam(value = "Authorization") String Authorization,
                              @RequestParam(value = "token") String token
     ) {
 
         Map<String, Object> rsp = new HashMap<>();
 
-        rsp.put("cameraCode", cameraCode);
-        rsp.put("streamType", streamType);
+        rsp.put("id", id);
         rsp.put("projectId", projectId);
 
         OkHttpClient okHttpClient = new OkHttpClient();
         Request request = new Request.Builder()
                 .addHeader("access_token",token)
                 .addHeader("Authorization",Authorization)
-                .url(LiveBroadcast.CAMERA_CODE)
+                .url(LiveBroadcast.DELETE)
                 .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .build();
@@ -210,32 +212,102 @@ public class LiveBroadcastController {
     }
 
     /**
-     * 开通直播间
+     * 开启直播
      */
-    @ApiOperation("开通直播间")
-    @PostMapping(value = "/create")
-    public AjaxResult create(@RequestParam(value = "title") String title,
-                             @RequestParam(value = "desc") String desc,
+    @ApiOperation("开启直播")
+    @PostMapping(value = "/open")
+    public AjaxResult open(@RequestParam(value = "source") String source,
                              @RequestParam(value = "projectId") String projectId,
-                             @RequestParam(value = "canWatch", required = false) String canWatch,
-                             @RequestParam(value = "autoVod", required = false) String autoVod,
                              @RequestParam(value = "Authorization") String Authorization,
                              @RequestParam(value = "token") String token
     ) {
 
         Map<String, Object> rsp = new HashMap<>();
 
-        rsp.put("title", title);
-        rsp.put("desc", desc);
+        rsp.put("source", source);
+        rsp.put("projectId", projectId);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("access_token",token)
+                .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.OPEN)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 关闭直播
+     */
+    @ApiOperation("关闭直播")
+    @PostMapping(value = "/close")
+    public AjaxResult close(@RequestParam(value = "source") String source,
+                           @RequestParam(value = "projectId") String projectId,
+                           @RequestParam(value = "Authorization") String Authorization,
+                           @RequestParam(value = "token") String token
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("source", source);
         rsp.put("projectId", projectId);
-        rsp.put("canWatch", canWatch);
-        rsp.put("autoVod", autoVod);
 
         OkHttpClient okHttpClient = new OkHttpClient();
         Request request = new Request.Builder()
+                .addHeader("access_token",token)
                 .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.CLOSE)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 根据直播源查询直播地址
+     */
+    @ApiOperation("根据直播源查询直播地址")
+    @PostMapping(value = "/address")
+    public AjaxResult address(@RequestParam(value = "source") String source,
+                            @RequestParam(value = "projectId") String projectId,
+                            @RequestParam(value = "Authorization") String Authorization,
+                            @RequestParam(value = "token") String token
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("source", source);
+        rsp.put("projectId", projectId);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
                 .addHeader("access_token",token)
-                .url(LiveBroadcast.CREATE)
+                .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.ADDRESS)
                 .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .build();
@@ -253,27 +325,36 @@ public class LiveBroadcastController {
         return AjaxResult.success(result);
     }
 
+
     /**
-     * 删除直播间
+     * 添加设备
      */
-    @ApiOperation("删除直播间")
-    @PostMapping(value = "/delete")
-    public AjaxResult delete(@RequestParam(value = "id") String id,
-                             @RequestParam(value = "projectId") String projectId,
-                             @RequestParam(value = "Authorization") String Authorization,
-                             @RequestParam(value = "token") String token
+    @ApiOperation("添加设备")
+    @PostMapping(value = "/save")
+    public AjaxResult save(@RequestParam(value = "deviceSerial") String deviceSerial,
+                              @RequestParam(value = "validateCode") String validateCode,
+                              @RequestParam(value = "deviceOrgId") String deviceOrgId,
+                              @RequestParam(value = "deviceName",required = false) String deviceName,
+                              @RequestParam(value = "modelType",required = false) String modelType,
+                              @RequestParam(value = "projectId") String projectId,
+                              @RequestParam(value = "Authorization") String Authorization,
+                              @RequestParam(value = "token") String token
     ) {
 
         Map<String, Object> rsp = new HashMap<>();
 
-        rsp.put("id", id);
+        rsp.put("deviceSerial", deviceSerial);
         rsp.put("projectId", projectId);
+        rsp.put("validateCode", validateCode);
+        rsp.put("deviceOrgId", deviceOrgId);
+        rsp.put("deviceName", deviceName);
+        rsp.put("modelType", modelType);
 
         OkHttpClient okHttpClient = new OkHttpClient();
         Request request = new Request.Builder()
                 .addHeader("access_token",token)
                 .addHeader("Authorization",Authorization)
-                .url(LiveBroadcast.DELETE)
+                .url(LiveBroadcast.SAVE)
                 .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
                 .build();
@@ -291,4 +372,50 @@ public class LiveBroadcastController {
         return AjaxResult.success(result);
     }
 
+    /**
+     * 获取Web端视频监控画面
+     */
+    @ApiOperation("获取Web端视频监控画面")
+    @PostMapping(value = "/videoWeb")
+    public AjaxResult videoWeb(@RequestParam(value = "deviceSerial") String deviceSerial,
+                           @RequestParam(value = "channelNo",required = false) String channelNo,
+                           @RequestParam(value = "videoLevel",required = false) String videoLevel,
+                           @RequestParam(value = "recordType",required = false) String recordType,
+                           @RequestParam(value = "projectId") String projectId,
+                           @RequestParam(value = "Authorization") String Authorization,
+                           @RequestParam(value = "token") String token
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("deviceSerial", deviceSerial);
+        rsp.put("projectId", projectId);
+        rsp.put("channelNo", channelNo);
+        rsp.put("videoLevel", videoLevel);
+        rsp.put("recordType", recordType);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("access_token",token)
+                .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.VIDEO_WEB)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+
+
 }

+ 1 - 27
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/controller/MonitoringAlarmsController.java

@@ -75,33 +75,7 @@ public class MonitoringAlarmsController {
     public AjaxResult queryAlarmList(@RequestParam(value = "pageNum") int pageNum,
                                      @RequestParam(value = "pageSize") int pageSize,
                                      @RequestParam(value = "token") String token) {
-
-        String interfaceUrl = MonitoringAlarms.API_PREFIX_DEV + MonitoringAlarms.QUERY_ALARM_LIST;
-
-        QueryAlarmInfoListBean queryAlarmInfoListBean = new QueryAlarmInfoListBean();
-//        long r = System.currentTimeMillis();
-        long r = OpenApi.getSystemTimer(MonitoringAlarms.API_PREFIX_DEV);
-        queryAlarmInfoListBean.setR(r);
-        queryAlarmInfoListBean.setNonce(VerifyCodeUtils.generateVerifyCode(6));
-        queryAlarmInfoListBean.setToken(token);
-         queryAlarmInfoListBean.setAlarmType(2);
-        queryAlarmInfoListBean.setEndTime(0);
-        queryAlarmInfoListBean.setEndTime(0);
-        queryAlarmInfoListBean.setPageSize(pageSize);
-        queryAlarmInfoListBean.setPageNum(pageNum);
-        queryAlarmInfoListBean.setProjectId(234);
-
-        String sign = RequestUtils.getParameterSignature(queryAlarmInfoListBean);
-        queryAlarmInfoListBean.setSign(sign);
-        String jsonString =  JsonUtil.toJson(queryAlarmInfoListBean);
-        String retStr = null;
-        try {
-            retStr =  HttpUtil.post(interfaceUrl,jsonString,"application/json","utf-8",10000,30000,null);
-            System.out.println(retStr);
-
-        }catch (Exception ex){
-            System.out.println(ex);
-        }
+        String retStr = OpenApi.queryAlarmList(MonitoringAlarms.API_PREFIX_DEV,token);
         JSONObject result = JSON.parseObject(retStr);
         return AjaxResult.success(result);
     }

+ 14 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/main/OpenApi.java

@@ -1,17 +1,14 @@
 package com.ruoyi.web.controller.monitoringAlarms.main;
 
-
-import com.alibaba.fastjson.JSON;
-import com.fasterxml.jackson.annotation.JsonFormat;
+import com.google.gson.Gson;
 import com.ruoyi.common.utils.JsonUtil;
+import com.ruoyi.web.controller.monitoringAlarms.utils.RequestUtils;
 import com.ruoyi.web.controller.monitoringAlarms.req.QueryAlarmInfoListBean;
 import com.ruoyi.web.controller.monitoringAlarms.req.QueryTokenBean;
 import com.ruoyi.web.controller.monitoringAlarms.resp.QueryTimerResp;
 import com.ruoyi.web.controller.monitoringAlarms.resp.QueryTokenResp;
 import com.ruoyi.web.controller.monitoringAlarms.utils.HttpUtil;
-import com.ruoyi.web.controller.monitoringAlarms.utils.RequestUtils;
 import com.ruoyi.web.controller.monitoringAlarms.utils.VerifyCodeUtils;
-import springfox.documentation.spring.web.json.Json;
 
 public class OpenApi {
 
@@ -19,8 +16,8 @@ public class OpenApi {
     public static void main(String[] args) {
         try {
             // 获取token
-            String appId = "";
-            String appSecret = "";
+            String appId = "26GgM5hQYPPOa6GW";
+            String appSecret = "fa6370788e207c06a9dcbfb01b46ddff9c396124";
             String url = "https://aim.360os.com/";
             String token =  getToken(url,appId,appSecret);
 
@@ -38,8 +35,7 @@ public class OpenApi {
         QueryTimerResp queryTimerResp = null;
         try {
             String strRet = HttpUtil.get(interfaceUrl);
-
-            queryTimerResp = JSON.parseObject(strRet,QueryTimerResp.class);
+            queryTimerResp = new Gson().fromJson(strRet,QueryTimerResp.class);
         }catch (Exception ex){
         }
         return queryTimerResp.getData().getSysTime();
@@ -59,14 +55,14 @@ public class OpenApi {
         queryTokenBean.setAppId(appId);
         queryTokenBean.setAppSecret(appSecret);
 
-        String jsonString = JsonUtil.toJson(queryTokenBean);
+        String jsonString = new Gson().toJson(queryTokenBean);
         String retStr = null;
         QueryTokenResp queryTokenResp = null;
         try {
             retStr =  HttpUtil.post(interfaceUrl,jsonString,"application/json","utf-8",10000,10000,null);
             System.out.println(retStr);
 
-            queryTokenResp = JSON.parseObject(retStr,QueryTokenResp.class);
+            queryTokenResp = new Gson().fromJson(retStr,QueryTokenResp.class);
 
         }catch (Exception ex){
             System.out.println(ex);
@@ -90,7 +86,7 @@ public class OpenApi {
         queryAlarmInfoListBean.setR(r);
         queryAlarmInfoListBean.setNonce(VerifyCodeUtils.generateVerifyCode(6));
         queryAlarmInfoListBean.setToken(token);
-       // queryAlarmInfoListBean.setAlarmType(2);
+        // queryAlarmInfoListBean.setAlarmType(2);
         queryAlarmInfoListBean.setEndTime(0);
         queryAlarmInfoListBean.setEndTime(0);
         queryAlarmInfoListBean.setPageSize(20);
@@ -99,7 +95,12 @@ public class OpenApi {
 
         String sign = RequestUtils.getParameterSignature(queryAlarmInfoListBean);
         queryAlarmInfoListBean.setSign(sign);
-        String jsonString =  JsonUtil.toJson(queryAlarmInfoListBean);
+        String jsonString =  new Gson().toJson(queryAlarmInfoListBean);
+        System.out.println(jsonString);
+
+        String jsonString1 =  JsonUtil.toJson(queryAlarmInfoListBean);
+        System.out.println(jsonString1);
+
         String retStr = null;
         try {
             retStr =  HttpUtil.post(interfaceUrl,jsonString,"application/json","utf-8",10000,30000,null);

+ 14 - 16
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/RequestUtils.java

@@ -1,14 +1,14 @@
 package com.ruoyi.web.controller.monitoringAlarms.utils;
 
-import com.alibaba.fastjson.JSON;
+
+
 import com.google.common.reflect.TypeToken;
-import com.ruoyi.common.utils.JsonUtil;
+import com.google.gson.*;
 import com.ruoyi.web.controller.monitoringAlarms.req.BaseBean;
+import com.ruoyi.web.controller.monitoringAlarms.req.QueryAlarmInfoListBean;
 import org.apache.commons.codec.digest.DigestUtils;
-
 import java.lang.reflect.Type;
-import java.util.SortedMap;
-import java.util.TreeMap;
+import java.util.*;
 
 /**
  * 网络请求工具类,因为sping boot 依赖,所以放这里。
@@ -22,14 +22,13 @@ public class RequestUtils {
     //签名书
     public final static String KEY_SIGNA = "sign";
     // token
-    public final static String KEY_TOKEN = "token";
+    public final static String KEY_TOKEN ="token";
     // 用户id
-    public final static String KEY_UID = "uid";
+    public final static String KEY_UID ="uid";
 
-    private static Type typeToken = new TypeToken<TreeMap<String, Object>>() {
-    }.getType();
+    private static Type typeToken = new TypeToken<TreeMap<String, Object>>(){}.getType();
 
-    /*static Gson gson = new GsonBuilder()
+    static Gson gson = new GsonBuilder()
             .registerTypeAdapter(
                     new TypeToken<TreeMap<String, Object>>(){}.getType(),
                     new JsonDeserializer<TreeMap<String, Object>>() {
@@ -51,22 +50,21 @@ public class RequestUtils {
                             }
                             return treeMap;
                         }
-                    }).create();*/
+                    }).create();
 
 
     /**
      * 对公共参数进行签名
-     *
      * @param baseBean
      * @return
      */
     public static String getParameterSignature(BaseBean baseBean) {
 
-        String serverSign = "";
+        String serverSign ="";
         try {
 
-            SortedMap<String, Object> map = JSON.parseObject(JsonUtil.toJson(baseBean), typeToken);
-            String paramsJsonStr = JsonUtil.toJson(map);
+            SortedMap<String, Object> map =  gson.fromJson( gson.toJson(baseBean), typeToken);
+            String paramsJsonStr = new Gson().toJson(map);
             serverSign = getSignature(paramsJsonStr);
 
         } catch (Exception ex) {
@@ -77,7 +75,6 @@ public class RequestUtils {
 
     /**
      * 获取签名信息
-     *
      * @param parameters
      * @return
      */
@@ -87,4 +84,5 @@ public class RequestUtils {
     }
 
 
+
 }

+ 17 - 8
ruoyi-common/src/main/java/com/ruoyi/common/constant/LiveBroadcast.java

@@ -14,19 +14,28 @@ public class LiveBroadcast {
     //获取access_token
     public static final String GET_ACCESS_TOKEN = "https://open.hikyun.com/artemis/oauth/token";
 
-    //登录接口
-    public static final String LOGIN = "https://open.hikyun.com/artemis/api/eits/v1/login";
-
-    //获取挑战码
-    public static final String CHALLENGE_CODE = "https://open.hikyun.com/artemis/api/eits/v1/challengeCode";
-
     //根据监控点编号查询直播间信息
     public static final String CAMERA_CODE = "https://open.hikyun.com/artemis/api/eits/v1/global/camera/live/get/by/cameracode";
 
     //开通直播间
-    public static final String CREATE = "https://open.hikyun.com/artemis/api/eits/v2/global/saas/live/create";
+    public static final String CREATE = "https://open.hikyun.com/artemis/api/eits/v1/seastart/live/create/project/id";
 
     //删除直播间
-    public static final String DELETE = "https://open.hikyun.com/artemis/api/eits/v2/global/saas/live/delete";
+    public static final String DELETE = "https://open.hikyun.com/artemis/api/eits/v1/seastart/live/delete/projectIdAndLiveId";
+
+    //开启直播
+    public static final String OPEN = "https://open.hikyun.com/artemis/api/eits/v1/global/live/video/open";
+
+    //关闭直播
+    public static final String CLOSE = "https://open.hikyun.com/artemis/api/eits/v1/global/live/video/close";
+
+    //根据直播源查询直播地址
+    public static final String ADDRESS = "https://open.hikyun.com/artemis/api/eits/v1/global/live/address/get";
+
+    //添加设备
+    public static final String SAVE = "https://open.hikyun.com/artemis/api/eits/v1/global/device/save";
+
+    //获取Web端视频监控画面
+    public static final String VIDEO_WEB = "https://open.hikyun.com/artemis/api/eits/v1/global/live/video/web";
 
 }