fix(优化):订单统计按时间升序,新增设备视频流生成,新增设备推流地址缓存逻辑
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@ package com.central.device.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonElement;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.device.feign.OrderCenterService;
|
||||
@@ -140,7 +141,7 @@ public class ApiDeviceController {
|
||||
data.addProperty("file_md5", lineFile.getSign());
|
||||
// 设置设备视频流地址
|
||||
try {
|
||||
data.addProperty("stream_urls", liveStreamService.generateStreamUrls(deviceId).toString());
|
||||
data.add("stream_urls", gson.fromJson(liveStreamService.generateStreamUrls(deviceId).toJSONString(), JsonElement.class));
|
||||
} catch (Exception e) {
|
||||
log.error("生成设备推流/拉流地址异常: deviceId={}, error={}", deviceId, e.getMessage(), e);
|
||||
data.addProperty("stream_urls", "{}"); // 或者空字符串 ""
|
||||
|
||||
Reference in New Issue
Block a user