12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- package com.fdkankan.fusion.controller;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.fdkankan.fusion.common.ResultData;
- import com.fdkankan.fusion.response.BindCameraDto;
- import com.fdkankan.fusion.service.ITmCameraService;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.util.CollectionUtils;
- import org.springframework.web.bind.annotation.*;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * <p>
- * 相机关联关系表 前端控制器
- * </p>
- *
- * @author
- * @since 2023-07-28
- */
- @RestController
- @RequestMapping("/web/camera")
- public class TmCameraController {
- @Autowired
- ITmCameraService tmCameraService;
- /**
- * 获取相机详情
- */
- @GetMapping("/getCameraDetail")
- public ResultData getCameraDetail(@RequestParam(required = false) String snCode) {
- return ResultData.ok(tmCameraService.getDetail(snCode));
- }
- /**
- * 获取用户的相机列表
- * @param pageNum 页码
- * @param pageSize 每页大小
- * @param snCode sn码
- * @param deptId 所属架构ID
- * @param type 查询类型 1场景同步里面查询相机 2,相机管理列表
- */
- @GetMapping("/getUserCameraList")
- public ResultData getUserCameraList(
- @RequestParam(value = "pageNum", required = false,defaultValue = "1") Long pageNum,
- @RequestParam(value = "pageSize", required = false,defaultValue = "10") Long pageSize,
- @RequestParam(value = "snCode" , required = false) String snCode,
- @RequestParam(value = "deptId", required = false) String deptId,
- @RequestParam(value = "type", required = false) Integer type,
- @RequestParam(value = "searchKey", required = false) String searchKey
- ) {
- return ResultData.ok(tmCameraService.pageList(pageNum,pageSize,snCode,deptId,type,searchKey));
- }
- /**
- * 绑定相机/切换绑定
- */
- @PostMapping(value = "/bindNew")
- public ResultData bindNew(@RequestBody BindCameraDto param){
- tmCameraService.bind(param);
- return ResultData.ok("绑定成功");
- }
- /**
- * 解绑相机
- */
- @PostMapping(value = "/unbind")
- public ResultData unbind(@RequestBody BindCameraDto param){
- tmCameraService.unBind(param);
- return ResultData.ok("解绑成功");
- }
- /**
- * 编辑
- */
- @PostMapping(value = "/edit")
- public ResultData edit(@RequestBody BindCameraDto param){
- tmCameraService.edit(param);
- return ResultData.ok();
- }
- }
|