| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.VnnoxParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.LedPlayerEntityService; |
| | | import com.sandu.ximon.admin.service.VnnoxService; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.admin.vo.NovaPushResultVO; |
| | | import com.sandu.ximon.admin.vo.NovaResultParam; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | |
| | | return ResponseUtil.success(map.get("url")); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/allScreenShot") |
| | | public ResponseVO<Object> allScreenShot(@RequestBody List<NovaPushResultVO> vnnoxWebRequest) { |
| | | return ResponseUtil.success(vnnoxService.getScreenShotUrl(vnnoxWebRequest)); |
| | | } |
| | | |
| | | /** |
| | | * 重启 |
| | | * |
| | | * @param vnnoxWebRequest |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/reboot") |
| | | public ResponseVO<Object> reboot(@RequestBody List<String> vnnoxWebRequest) { |
| | | public ResponseVO<Object> reboot(@RequestBody List<NovaPushResultVO> nova) { |
| | | if (!permissionConfig.check(MenuEnum.VNNOX_RESTART.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | VnnoxResult vnnoxResult = vnnoxService.reboot(vnnoxWebRequest); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | return ResponseUtil.success(vnnoxService.reboot(nova)); |
| | | } |
| | | |
| | | /** |
| | | * 同步播放 |
| | | */ |
| | | @PostMapping("/syncPlay") |
| | | public ResponseVO<Object> syncPlay(@RequestBody Map map) { |
| | | public ResponseVO<Object> syncPlay(@RequestBody NovaResultParam vo) { |
| | | if (!permissionConfig.check(MenuEnum.VNNOX_SYNC_PLAY.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List playIdlist = (List) map.get("playIdlist"); |
| | | Integer option = (Integer) map.get("option"); |
| | | VnnoxResult vnnoxResult = vnnoxService.syncPlay(playIdlist, option); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | List<NovaPushResultVO> playIdlist = vo.getPlayIdlist(); |
| | | Integer option = vo.getOption(); |
| | | if (option == null || vo.getOption() == null) { |
| | | throw new BusinessException("option不能为空"); |
| | | } |
| | | return ResponseUtil.success(vnnoxService.syncPlay(playIdlist, option)); |
| | | } |
| | | |
| | | /** |
| | | * ntp对时 |
| | | */ |
| | | @PostMapping("/ntp") |
| | | public ResponseVO<Object> ntp(@RequestBody Map map) { |
| | | public ResponseVO<Object> ntp(@RequestBody NovaResultParam vo) { |
| | | if (!permissionConfig.check(MenuEnum.VNNOX_NTP.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean enable = (boolean) map.get("enable"); |
| | | List playIdlist = (List) map.get("playIdlist"); |
| | | VnnoxResult vnnoxResult = vnnoxService.ntpSync(playIdlist, enable); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | boolean enable = vo.isEnable(); |
| | | List<NovaPushResultVO> playIdlist = vo.getPlayIdlist(); |
| | | return ResponseUtil.success(vnnoxService.ntpSync(playIdlist, enable)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!permissionConfig.check(MenuEnum.VNNOX_ON_OFF.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | VnnoxResult vnnoxResult = vnnoxService.screenStatusChange(vnnoxWebRequest.getPlayerList(), vnnoxWebRequest.getScreenStatus()); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | return ResponseUtil.success(vnnoxService.screenStatusChange(vnnoxWebRequest.getPlayerList(), vnnoxWebRequest.getScreenStatus())); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!permissionConfig.check(MenuEnum.VNNOX_VOL_CHANGE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | VnnoxResult vnnoxResult = vnnoxService.volChange(vnnoxWebRequest.getPlayerList(), vnnoxWebRequest.getVol()); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | return ResponseUtil.success(vnnoxService.volChange(vnnoxWebRequest.getPlayerList(), vnnoxWebRequest.getVol())); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!permissionConfig.check(MenuEnum.VNNOX_BRIGHTNESS_CHANGE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | VnnoxResult vnnoxResult = vnnoxService.brightnessChange(vnnoxWebRequest.getPlayerList(), vnnoxWebRequest.getBrightness()); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | return ResponseUtil.success(vnnoxService.brightnessChange(vnnoxWebRequest.getPlayerList(), vnnoxWebRequest.getBrightness())); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | /** |
| | | * 屏幕详情 //前端未发现调用 |
| | | * |
| | | * @param sn |
| | | * @return |
| | | */ |
| | |
| | | public ResponseVO<Object> getBySnAndPlayerId(@PathVariable String sn) { |
| | | return ResponseUtil.success(ledPlayerEntityService.getBySnAndPlayerSn(sn)); |
| | | } |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/saveInfo") |
| | | public ResponseVO<Object> saveInfo() { |
| | | vnnoxService.saveInfo(); |
| | | return ResponseUtil.success("执行完毕"); |
| | | } |
| | | } |