103 lines
3.9 KiB
Plaintext
103 lines
3.9 KiB
Plaintext
package com.securityControl.system.controller;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.securityControl.common.log.annotation.Log;
|
|
import com.securityControl.common.log.enums.BusinessType;
|
|
import com.securityControl.common.log.enums.OperationType;
|
|
import com.securityControl.system.domain.vo.ReturnCodeEntity;
|
|
import com.securityControl.system.domain.vo.SysUserEntity;
|
|
import com.securityControl.system.domain.vo.VideoConfigVo;
|
|
import com.securityControl.system.service.VideoConfigService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 视频配置控制层
|
|
*/
|
|
@RestController
|
|
@RequestMapping(value = "/videoConfig/")
|
|
@Slf4j
|
|
public class VideoConfigController {
|
|
|
|
@Autowired
|
|
private VideoConfigService service;
|
|
|
|
|
|
@PostMapping("getVideoConfigPageList")
|
|
@Log(title = "系统管理", menu = "视频配置", businessType = BusinessType.QUERY, details = "配置列表", grade = OperationType.QUERY_SYS, type = "系统日志")
|
|
public Map<String, Object> getVideoConfigList(VideoConfigVo videoConfigVo) {
|
|
PageHelper.startPage(videoConfigVo.getPage(), videoConfigVo.getLimit());
|
|
List<VideoConfigVo> list = service.getVideoConfigList(videoConfigVo);
|
|
PageInfo<VideoConfigVo> pageInfo = new PageInfo<VideoConfigVo>(list);
|
|
Map<String, Object> map = new HashMap<String, Object>(16);
|
|
map.put("code", 200);
|
|
map.put("msg", "数据获取成功");
|
|
map.put("count", pageInfo.getTotal());
|
|
map.put("data", pageInfo.getList());
|
|
map.put("curr", videoConfigVo.getPage());
|
|
map.put("limit", videoConfigVo.getLimit());
|
|
return map;
|
|
}
|
|
@PostMapping("insertVideoConfig")
|
|
@Log(title = "系统管理", menu = "视频配置", businessType = BusinessType.INSERT, details = "新增配置", grade = OperationType.ADD_SYS, type = "系统日志")
|
|
public ReturnCodeEntity insertVideoConfig(VideoConfigVo videoConfigVo) {
|
|
ReturnCodeEntity entity = new ReturnCodeEntity();
|
|
try {
|
|
entity = service.insertVideoConfig(videoConfigVo);
|
|
} catch (Exception e) {
|
|
entity.setCode("202");
|
|
entity.setMsg("解析异常,请联系管理员");
|
|
// log.error(e.toString(),e);
|
|
}
|
|
return entity;
|
|
}
|
|
|
|
@PostMapping("updateVideoConfig")
|
|
@Log(title = "系统管理", menu = "视频配置", businessType = BusinessType.UPDATE, details = "修改配置", grade = OperationType.UPDATE_SYS, type = "系统日志")
|
|
public ReturnCodeEntity updateVideoConfig(VideoConfigVo videoConfigVo) {
|
|
ReturnCodeEntity entity = new ReturnCodeEntity();
|
|
try {
|
|
entity = service.updateVideoConfig(videoConfigVo);
|
|
} catch (Exception e) {
|
|
entity.setCode("202");
|
|
entity.setMsg("解析异常,请联系管理员");
|
|
}
|
|
return entity;
|
|
}
|
|
/**
|
|
* 用户管理新增
|
|
* @return
|
|
*/
|
|
@PostMapping("getVideoConfigById")
|
|
public VideoConfigVo getVideoConfigById(VideoConfigVo videoConfigVo) {
|
|
try {
|
|
return service.getVideoConfigById(videoConfigVo);
|
|
} catch (Exception e) {
|
|
log.error(e.toString(),e);
|
|
}
|
|
return new VideoConfigVo() ;
|
|
}
|
|
|
|
/**
|
|
* 用户管理新增
|
|
* @return
|
|
*/
|
|
@PostMapping("updateVideoConfigStatus")
|
|
public ReturnCodeEntity updateVideoConfigStatus(VideoConfigVo videoConfigVo) {
|
|
try {
|
|
return service.updateVideoConfigStatus(videoConfigVo);
|
|
} catch (Exception e) {
|
|
log.error(e.toString(),e);
|
|
}
|
|
return new ReturnCodeEntity() ;
|
|
}
|
|
}
|