| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | | import com.sandu.ximon.admin.param.AsyncStatusParam; |
| | | import com.sandu.ximon.admin.param.VnnoxProgressParam; |
| | | import com.sandu.ximon.admin.param.VnnoxScreenShotParam; |
| | | import com.sandu.ximon.admin.utils.CountDownLatchUtil; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | @Autowired |
| | | private CountDownLatchUtil countDownLatchUtil; |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/screenshot") |
| | | public ResponseVO<Object> screenshot(@RequestBody VnnoxScreenShotParam vnnoxScreenShot) { |
| | | String url = vnnoxScreenShot.getScreenShotUrl().replace("&", "&"); |
| | | redisUtils.set(VnnoxConstant.REDIS_SCREEN_SHOT + vnnoxScreenShot.getPlayerId(), url, VnnoxConstant.SCREEN_SHOT_TIMEOUT); |
| | | System.out.println(vnnoxScreenShot); |
| | | redisUtils.set(VnnoxConstant.REDIS_SCREEN_SHOT + vnnoxScreenShot.getPlayerId(), url); |
| | | return ResponseUtil.success("ok"); |
| | | } |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/progress") |
| | | public ResponseVO<Object> progress(@RequestBody VnnoxProgressParam vnnoxProgress) { |
| | | redisUtils.set(VnnoxConstant.REDIS_PROGRESS + vnnoxProgress.getPlayerId(), vnnoxProgress.getPrecess()); |
| | | return ResponseUtil.success("ok"); |
| | | } |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/asyncStatus") |
| | | public ResponseVO<Object> asyncStatus(@RequestBody AsyncStatusParam asyncStatusParam) { |
| | | System.out.println(asyncStatusParam.toString()); |
| | | if ("brightnessValue".equals(asyncStatusParam.getCommand())) { |
| | | //亮度 |
| | | redisUtils.set(VnnoxConstant.REDIS_BRIGHTNESS + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getRatio(), VnnoxConstant.STATUS_TIME); |
| | | } else if ("volumeValue".equals(asyncStatusParam.getCommand())) { |
| | | //音量 |
| | | redisUtils.set(VnnoxConstant.REDIS_VOL + asyncStatusParam.getPlayerId(), asyncStatusParam.getData().getRatio(), VnnoxConstant.STATUS_TIME); |
| | | } |
| | | countDownLatchUtil.countDown(asyncStatusParam.getLogid()); |
| | | return ResponseUtil.success("ok"); |
| | | } |
| | | |
| | | } |