| | |
| | | private PermissionConfig permissionConfig; |
| | | private final InterphoneHostSubService interphoneHostSubService; |
| | | |
| | | /** |
| | | * 主机绑定子机 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @PostMapping("/bind") |
| | | public ResponseVO<Object> bind(@RequestBody Map map) { |
| | | if (!permissionConfig.check(MenuEnum.INTER_PHONE_HOST_SUB_BINDING.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | |
| | | Integer hostId = (Integer) map.get("hostId"); |
| | | Integer subId = (Integer) map.get("subId"); |
| | | int hostId = Integer.parseInt(map.get("hostId").toString()); |
| | | int subId = Integer.parseInt(map.get("subId").toString()); |
| | | return ResponseUtil.success(interphoneHostSubService.bindHostSub(hostId, subId)); |
| | | } |
| | | |
| | | /** |
| | | * 主机解绑子机 |
| | | * @param subId |
| | | * @return |
| | | */ |
| | | @PostMapping("/unbind/{subId}") |
| | | public ResponseVO<Object> unbind(@PathVariable Integer subId) { |
| | | if (!permissionConfig.check(MenuEnum.INTER_PHONE_HOST_SUB_UNBIND.getCode())) { |