Merge pull request '添加hiking服务远程调用接口 修改当前datacenter为调用远程服务 补充service实现类' (#101) from cgt into master
Reviewed-on: #101
This commit is contained in:
commit
d24075b1df
@ -35,6 +35,10 @@ public interface CameraMapper extends BaseMapperX<CameraDO> {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDO>().eq(CameraDO::getRegionIndexCode, regionIndexCode));
|
||||
}
|
||||
|
||||
default List<CameraDO> selectCameraByRegionIndexCodePage(String regionIndexCode, Integer start, Integer end) {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDO>().eq(CameraDO::getRegionIndexCode, regionIndexCode).last("limit " + start + "," + end));
|
||||
}
|
||||
|
||||
default String selectCameraIndexCodeByCameraName(String cameraName) {
|
||||
return selectOne(new LambdaQueryWrapperX<CameraDO>().eq(CameraDO::getCameraName, cameraName)).getCameraIndexCode();
|
||||
}
|
||||
|
@ -2,8 +2,10 @@ package cn.iocoder.yudao.module.datacenter.service.camera;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.CameraClientApi;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraPageReqVO;
|
||||
@ -22,6 +24,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@ -42,6 +45,8 @@ public class CameraServiceImpl implements CameraService {
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
private static final String ACCESS_TOKEN_KEY = "hikingAPI:access_token";
|
||||
|
||||
@Autowired
|
||||
private CameraClientApi cameraClientApi;
|
||||
|
||||
public String getAccessToken() {
|
||||
// 检查 Redis 中是否有 access_token
|
||||
@ -136,21 +141,41 @@ public class CameraServiceImpl implements CameraService {
|
||||
return IntegrationURL.getPreviewURL(cameraIndexCode, streamType, protocol, transmode, expand, streamform, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getPreviewUrlRPC(String cameraIndexCode, Integer streamType, String protocol, Integer transmode, String expand, String streamform) {
|
||||
return cameraClientApi.selectPreviewUrlByCameraIndexCode(cameraIndexCode, streamType, protocol, transmode, expand, streamform);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayBackUrl(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType) {
|
||||
return IntegrationURL.getPlaybackURL(cameraIndexCode,recordLocation, protocol, transmode, beginTime, endTime, uuid, expand, streamform,lockType, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getPlayBackUrlRPC(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType) {
|
||||
return cameraClientApi.selectPlayBackUrlByCameraIndexCode(cameraIndexCode, recordLocation, protocol, transmode, beginTime, endTime, uuid, expand, streamform, lockType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selZoom(String cameraIndexCode,int startX,int startY,int endX,int endY) {
|
||||
return IntegrationURL.getControlURL(cameraIndexCode, startX, startY, endX, endY, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> selZoomRPC(String cameraIndexCode, int startX, int startY, int endX, int endY) {
|
||||
return cameraClientApi.selZoom(cameraIndexCode, startX, startY, endX, endY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String controlling(String cameraIndexCode, Integer action, String command, Integer speed, Integer presetIndex) {
|
||||
return IntegrationURL.getYunTaiOperationURL(cameraIndexCode, action, command, speed, presetIndex, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> controllingRPC(String cameraIndexCode, Integer action, String command, Integer speed, Integer presetIndex) {
|
||||
return cameraClientApi.controlling(cameraIndexCode, action, command, speed, presetIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CameraDTO> selectCameraByRegionIndexCode(String regionIndexCode) {
|
||||
List<CameraDO> cameraDOS = cameraMapper.selectCameraByRegionIndexCode(regionIndexCode);
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.hiking.service.camera;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.module.hiking.IntegrationURL;
|
||||
import cn.iocoder.yudao.module.hiking.api.camera.dto.CameraDTO;
|
||||
import cn.iocoder.yudao.module.hiking.service.region.RegionService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
@ -156,6 +158,16 @@ public class CameraServiceImpl implements CameraService {
|
||||
return IntegrationURL.getPlaybackURL(cameraIndexCode, recordLocation,protocol,transmode,beginTime,endTime, uuid, expand, streamform, lockType, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selZoom(String cameraIndexCode,int startX,int startY,int endX,int endY) {
|
||||
return IntegrationURL.getControlURL(cameraIndexCode, startX, startY, endX, endY, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String controlling(String cameraIndexCode, Integer action, String command, Integer speed, Integer presetIndex) {
|
||||
return IntegrationURL.getYunTaiOperationURL(cameraIndexCode, action, command, speed, presetIndex, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCameraCheckByCameraIndexCode(CameraSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
@ -165,4 +177,6 @@ public class CameraServiceImpl implements CameraService {
|
||||
cameraMapper.updateByCameraIndexCode(updateObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user