| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.jdbc.Null; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | if (DeviceConstants.NOT_UNIQUE.equals(ardCameraService.checkCameraIpAndPortUnique(camera))) { |
| | | return error("新增相机'" + camera.getIp() + ":" + camera.getPort() + "'失败,相机已存在"); |
| | | } |
| | | ArdCamera existingCamera = ardCameraService.checkAirportHasCamera(camera); |
| | | if (existingCamera != null) { |
| | | return error("该机场已被相机【" + existingCamera.getName() + "】(" + existingCamera.getIp() + ") 关联"); |
| | | } |
| | | return success(ardCameraService.insertArdCamera(camera)); |
| | | } |
| | | |
| | |
| | | if (DeviceConstants.NOT_UNIQUE.equals(ardCameraService.checkCameraIpAndPortUnique(camera))) { |
| | | return error("修改相机'" + camera.getIp() + ":" + camera.getPort() + "'失败,相机已存在"); |
| | | } |
| | | ArdCamera existingCamera = ardCameraService.checkAirportHasCamera(camera); |
| | | if (existingCamera != null) { |
| | | return error("该机场已被相机【" + existingCamera.getName() + "】(" + existingCamera.getIp() + ") 关联"); |
| | | } |
| | | return success(ardCameraService.updateArdCamera(camera)); |
| | | } |
| | | |