166 lines
4.6 KiB
Java
166 lines
4.6 KiB
Java
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;
|
||
import com.zcloud.util.Jurisdiction;
|
||
import com.zcloud.util.Tools;
|
||
import com.zcloud.util.hk.HKUtil;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.stereotype.Controller;
|
||
import org.springframework.util.ObjectUtils;
|
||
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;
|
||
}
|
||
/**新增
|
||
* @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()); //主键
|
||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //主键
|
||
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)){
|
||
map = new HashMap<String,Object>();
|
||
}
|
||
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)){
|
||
map = new HashMap<String,Object>();
|
||
}
|
||
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)){
|
||
map = new HashMap<String,Object>();
|
||
}
|
||
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;
|
||
}
|
||
}
|