package com.gkhy.safePlatform.account.controller; import com.gkhy.safePlatform.account.model.dto.req.AddAndUpdateCameraDTO; import com.gkhy.safePlatform.account.model.dto.req.CameraQuery; import com.gkhy.safePlatform.account.service.CameraManageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/sysAdmin/camera") public class CameraManageController{ @Autowired private CameraManageService cameraManageService; @PostMapping("/add") public Object addNewCamera(@RequestBody AddAndUpdateCameraDTO addCameraDTO){ return cameraManageService.saveNewCamera(addCameraDTO); } @PostMapping("/mod") public Object modCamera(@RequestBody AddAndUpdateCameraDTO updateCameraDTO){ return cameraManageService.updateCameraInfo(updateCameraDTO); } @GetMapping("/del") public Object deleteCamera(@RequestParam Long cameraId){ return cameraManageService.deleteCameraById(cameraId); } @PostMapping("/find/byDep/page") public Object ListCamerasByBizDepId(@RequestBody CameraQuery query){ return cameraManageService.listCamerasByDepId(query); } @GetMapping("/find/byDep") public Object ListCamerasByBizDepId(Long depId){ return cameraManageService.listCamerasByDepId(depId); } @PostMapping("/find/byCondition") public Object ListCamerasByBizConditoion(@RequestBody CameraQuery query){ return cameraManageService.listCamerasByCondition(query); } @GetMapping("/find/byId") public Object findByCameraId(Long id){ return cameraManageService.findByCameraId(id); } @GetMapping("/find/byAll") public Object findAllCamera(){ return cameraManageService.listAllCameras(); } @GetMapping("/find/byUser") public Object findUserAccessCameras(Long userId){ return cameraManageService.listAccessCamerasByUserId(userId); } }