Commit 8dd434f5 authored by tangwei's avatar tangwei

视频地址实时获取

parent c6fd0660
......@@ -4,12 +4,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -188,6 +185,7 @@ public interface EquipFeignClient {
*/
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current, @RequestParam("size") long size, @RequestParam("buildingId") Long buildingId);
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideopag( @RequestParam("current") String current,
@RequestParam("size") String size,
......@@ -196,6 +194,24 @@ public interface EquipFeignClient {
@RequestParam("equipmentName") String equipmentName
);
@RequestMapping(value = "/monitorView/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList(
@RequestParam(value = "viewId") Long viewId,
@RequestParam(value = "videoName" ,required =false) String videoName,
@RequestParam(value = "videoCode" ,required =false) String videoCode,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size
);
@RequestMapping(value = "/confirmAlarm/getDetailsById", method = RequestMethod.GET)
public Map<String, Object> getDetailsById(@RequestParam Long alamId, @RequestParam Long equipId, @RequestParam String type, @RequestParam String area) ;
/**
*
*获取视频列表
......
......@@ -336,6 +336,58 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(pag);
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询视图下的视频列表")
@RequestMapping(value = "monitorView/video/page", method = RequestMethod.GET)
public ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList(
@RequestParam(value = "viewId") Long viewId,
@RequestParam(value = "videoName" ,required =false) String videoName,
@RequestParam(value = "videoCode" ,required =false) String videoCode,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception
{
ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.queryUncheckedVideoList(viewId,videoName, videoCode,current,size);
Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
if (records != null && records.size() > 0) {
for (Map<String, Object> record : records) {
ResponseModel<String> da = videoFeignClient.videoUrlByIndexCode(record.get("code") + "");
String url = da != null ? da.getResult().substring(da.getResult().indexOf("openUrl")) : null;
record.put("url", url);
}
pag.setRecords(records);
}
return ResponseHelper.buildResponse(pag);
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "confirmAlarm/getDetailsById")
@ApiOperation(value = "根据id,type查询确警页面相关数据")
public ResponseModel<Map<String, Object>> getDetailsById(@RequestParam Long alamId, @RequestParam Long equipId, @RequestParam String type, @RequestParam String area) {
Map<String, Object> data = equipFeignClient.getDetailsById( alamId, equipId, type, area);
List<Map<String, Object>> records = data != null ? (List<Map<String, Object>>)data.get("video") : null;
if (records != null && records.size() > 0) {
for (Map<String, Object> record : records) {
ResponseModel<String> da = videoFeignClient.videoUrlByIndexCode(record.get("code") + "");
String url = da != null ? da.getResult().substring(da.getResult().indexOf("openUrl")) : null;
record.put("url", url);
}
data.put("video",records);
}
return ResponseHelper.buildResponse(data);
}
/**
* 水源列表分页查询
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment