| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.utils.sdk.dhsdk.service.impl.DhSdkStrategy; |
| | | import com.ruoyi.utils.sdk.dhsdk.service.impl.DahuaSDK; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | public class DhSdkController extends BaseController { |
| | | |
| | | @Resource |
| | | private DhSdkStrategy sdk; |
| | | private DahuaSDK sdk; |
| | | |
| | | |
| | | @ApiOperation(value = "云台控制", notes = "Code:1-左上 2-上 3-右上 4-左 5-巡航 6-右 7-左下 8-下 9-右下 10-焦距变大 11-焦距变小\n" + |
| | |
| | | public @ResponseBody |
| | | AjaxResult pTZControl(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(sdk.pTZControl(cmd)); |
| | | return sdk.pTZControl(cmd); |
| | | } |
| | | |
| | | @ApiOperation("获取PTZ") |
| | |
| | | public @ResponseBody |
| | | AjaxResult setPTZ(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(sdk.setPtz(cmd)); |
| | | return sdk.setPtz(cmd); |
| | | } |
| | | |
| | | @ApiOperation("设置零方位角") |
| | |
| | | public @ResponseBody |
| | | AjaxResult setZeroPTZ(@RequestBody CameraCmd cmd) { |
| | | cmd.setOperator(SecurityUtils.getUserId()); |
| | | return toAjax(sdk.setZeroPtz(cmd)); |
| | | return sdk.setZeroPtz(cmd); |
| | | } |
| | | |
| | | @ApiOperation("相机抓图") |
| | |
| | | String url = sdk.recordStopToMinio(cmd); |
| | | return AjaxResult.success(url); |
| | | } |
| | | } |
| | | } |