diff --git a/springboot/src/main/java/com/sincre/springboot/controller/Yinshi/DeviceControl.java b/springboot/src/main/java/com/sincre/springboot/controller/Yinshi/DeviceControl.java index 710a36f..3b9784b 100644 --- a/springboot/src/main/java/com/sincre/springboot/controller/Yinshi/DeviceControl.java +++ b/springboot/src/main/java/com/sincre/springboot/controller/Yinshi/DeviceControl.java @@ -40,10 +40,38 @@ public class DeviceControl { return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); } + @ApiOperation(value = "该接口用于楼宇可视对讲设备远程开锁") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true), + @ApiImplicitParam(name = "type",value = "开锁类型,1-监视开锁;2-通话开锁",required = true), + @ApiImplicitParam(name = "channel",value = "监视通道,1-主门口机,2-1号从门口机,3-2号从门口机,不能为1-9之外的数字",required = true), + @ApiImplicitParam(name = "lockId",value = "锁ID,0本地锁,1外接锁") + }) + @GetMapping("deviceUnlock") + public ServerResponse deviceUnlock(@RequestParam String deviceSerial,@RequestParam Integer type,@RequestParam Integer channel,@RequestParam(defaultValue = "-1") Integer lockId) { + + String url = YinShiServiceConfig.HostUrl + "lapp/building/device/unlock"; + Map map = new HashMap<>(); + map.put("accessToken", YinShiServiceConfig.AccessToken); + map.put("deviceSerial", deviceSerial); + map.put("type",type); + map.put("channel",channel); + + System.out.println(lockId); + if(lockId==-1) { + map.put("lockId", lockId); + } + String result = ApiHelper.doPost(url, new HashMap(), map); + + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); + + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); + } + @ApiOperation(value = "该接口用于楼宇可视对讲设备通话操作") @ApiImplicitParams({ @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true), - @ApiImplicitParam(name = "type",value = "操作类型:2-接听,3-拒接, 4-响铃超时,5-挂断,6-被叫正在通话中",dataType = "Integer",required = true) + @ApiImplicitParam(name = "type",value = "操作类型:2-接听,3-拒接, 4-响铃超时,5-挂断,6-被叫正在通话中",required = true) }) @GetMapping("setDeviceCall") public ServerResponse setDeviceCall(@RequestParam String deviceSerial,@RequestParam Integer type) { @@ -59,4 +87,35 @@ public class DeviceControl { return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); } + + @ApiOperation(value = "该接口用于获取楼宇可视对讲设备主叫信息。") + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true) + @GetMapping("getDeviceCallInfo") + public ServerResponse getDeviceCallInfo(@RequestParam String deviceSerial) { + + String url = YinShiServiceConfig.HostUrl + "lapp/building/device/dialing/get"; + Map map = new HashMap<>(); + map.put("accessToken", YinShiServiceConfig.AccessToken); + map.put("deviceSerial", deviceSerial); + String result = ApiHelper.doPost(url, new HashMap(), map); + + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); + + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); + } + @ApiOperation(value = "该接口用于获取楼宇可视对讲设备门口机列表。") + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true) + @GetMapping("getDeviceCallList") + public ServerResponse getDeviceCallList(@RequestParam String deviceSerial) { + + String url = YinShiServiceConfig.HostUrl + "lapp/building/device/list"; + Map map = new HashMap<>(); + map.put("accessToken", YinShiServiceConfig.AccessToken); + map.put("deviceSerial", deviceSerial); + String result = ApiHelper.doPost(url, new HashMap(), map); + + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); + + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); + } } -- libgit2 0.21.0