2021与蓝度共同重构项目,服务端
LHN
2022-10-20 04598cd1d53ed99675f8142e632c71dc5fd87daa
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/ServVnnoxController.java
@@ -15,8 +15,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.CountDownLatch;
//诺瓦回调
@RestController
@RequestMapping("/serv/vnnox")
@@ -32,6 +30,7 @@
    @PostMapping("/screenshot")
    public ResponseVO<Object> screenshot(@RequestBody VnnoxScreenShotParam vnnoxScreenShot) {
        String url = vnnoxScreenShot.getScreenShotUrl().replace("&amp;", "&");
        System.out.println(vnnoxScreenShot);
        redisUtils.set(VnnoxConstant.REDIS_SCREEN_SHOT + vnnoxScreenShot.getPlayerId(), url);
        return ResponseUtil.success("ok");
    }
@@ -51,10 +50,32 @@
        System.out.println(asyncStatusParam.toString());
        if ("brightnessValue".equals(asyncStatusParam.getCommand())) {
            //亮度
            redisUtils.set(VnnoxConstant.REDIS_BRIGHTNESS + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getRatio());
            String ratio = asyncStatusParam.getData().getRatio();
            int i = Integer.parseInt(ratio);
            redisUtils.set(VnnoxConstant.REDIS_BRIGHTNESS + asyncStatusParam.getPlayerId(), i + "", VnnoxConstant.STATUS_TIME);
        } else if ("volumeValue".equals(asyncStatusParam.getCommand())) {
            //音量
            redisUtils.set(VnnoxConstant.REDIS_VOL + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getRatio());
            String ratio = asyncStatusParam.getData().getRatio();
            int i = Integer.parseInt(ratio);
            redisUtils.set(VnnoxConstant.REDIS_VOL + asyncStatusParam.getPlayerId(), i + "", VnnoxConstant.STATUS_TIME);
        } else if ("videoSourceValue".equals(asyncStatusParam.getCommand())) {
            //当前视频源
            redisUtils.set(VnnoxConstant.VIDEO_SOURCE_VALUE + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getVideoSource(), VnnoxConstant.STATUS_TIME);
        } else if ("timeValue".equals(asyncStatusParam.getCommand())) {
            //当前时区和时间
            redisUtils.set(VnnoxConstant.TIME_VALUE_TIME + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getCurrentTime(), VnnoxConstant.STATUS_TIME);
            redisUtils.set(VnnoxConstant.TIME_VALUE_TIMEZONE + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getTimeZone(), VnnoxConstant.STATUS_TIME);
        } else if ("screenPowerStatus".equals(asyncStatusParam.getCommand())) {
            //屏幕状态
            if ("OPEN".equals(asyncStatusParam.getData().getState())) {
                redisUtils.set(VnnoxConstant.REDIS_SCREEN_STATUS + asyncStatusParam.getPlayerId(), "1", VnnoxConstant.STATUS_TIME);
            } else {
                redisUtils.set(VnnoxConstant.REDIS_SCREEN_STATUS + asyncStatusParam.getPlayerId(), "0", VnnoxConstant.STATUS_TIME);
            }
            ;
        } else if ("syncPlayStatus".equals(asyncStatusParam.getCommand())) {
            //同步播放状态
            redisUtils.set(VnnoxConstant.SYNC_PLAY_STATUS + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getEnable(), VnnoxConstant.STATUS_TIME);
        }
        countDownLatchUtil.countDown(asyncStatusParam.getLogid());
        return ResponseUtil.success("ok");