qa-prevention-gwj/src/main/java/com/zcloud/controller/keyProjects/PlatformvideomanagementCont...

166 lines
4.6 KiB
Java
Raw Normal View History

2023-11-07 09:32:12 +08:00
package com.zcloud.controller.keyProjects;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.keyProjects.PlatformvideomanagementService;
2024-01-09 16:01:16 +08:00
import com.zcloud.util.Jurisdiction;
2023-11-07 09:32:12 +08:00
import com.zcloud.util.Tools;
import com.zcloud.util.hk.HKUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
2023-12-27 11:12:51 +08:00
import org.springframework.util.ObjectUtils;
2023-11-07 09:32:12 +08:00
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* luoxiaobao
* 2023-07-21
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/platformvideomanagement")
public class PlatformvideomanagementController extends BaseController {
@Autowired
private PlatformvideomanagementService platformvideomanagementService;
@RequestMapping(value="/savePosition")
@ResponseBody
public Object savePosition() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
if(pd.get("PLATFORMVIDEOMANAGEMENT_ID") != null){
platformvideomanagementService.edit(pd);
}else{
pd.put("PLATFORMVIDEOMANAGEMENT_ID", this.get32UUID()); //主键
platformvideomanagementService.save(pd);
}
map.put("result", errInfo);
return map;
}
@RequestMapping(value="/delLocation")
@ResponseBody
public Object delLocation() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
platformvideomanagementService.delLocation(pd);
map.put("result", errInfo);
return map;
}
2023-11-07 09:32:12 +08:00
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@ResponseBody
public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("PLATFORMVIDEOMANAGEMENT_ID", this.get32UUID()); //主键
2024-01-09 16:01:16 +08:00
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //主键
2023-11-07 09:32:12 +08:00
platformvideomanagementService.save(pd);
map.put("result", errInfo);
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/getHlsPath")
@ResponseBody
public Object getHlsPath() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
PageData pd =this.getPageData();
map = HKUtil.camerasPreviewURLs(pd.getString("INDEXCODE"),"hls");
if(ObjectUtils.isEmpty(map)){
2023-12-27 11:12:51 +08:00
map = new HashMap<String,Object>();
}
2023-11-07 09:32:12 +08:00
map.put("result", "success");
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/getRtspPath")
@ResponseBody
public Object getRtspPath() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
PageData pd =this.getPageData();
map = HKUtil.camerasPreviewURLs(pd.getString("INDEXCODE"),"rtsp");
if(ObjectUtils.isEmpty(map)){
2023-12-27 11:12:51 +08:00
map = new HashMap<String,Object>();
}
2023-11-07 09:32:12 +08:00
map.put("result", "success");
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/platformList")
@ResponseBody
public Object platformList() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
PageData pd =this.getPageData();
map = HKUtil.cameraSearch(pd);
if(ObjectUtils.isEmpty(map)){
2023-12-27 11:12:51 +08:00
map = new HashMap<String,Object>();
}
2023-11-07 09:32:12 +08:00
map.put("result", "success");
return map;
}
/**
* @param page
* @throws Exception
*/
@RequestMapping(value="/list")
@ResponseBody
public Object list(Page page) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = platformvideomanagementService.list(page); //列出Platformvideomanagement列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/listAll")
@ResponseBody
public Object listAll() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> varList = platformvideomanagementService.listAll(pd); //列出Platformvideomanagement列表
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
}