| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.log.Log; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | | import com.sandu.ximon.admin.utils.LogUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.request.VnnoxScreenStatusType; |
| | |
| | | import com.sandu.ximon.admin.utils.response.VnnoxPlayerResponse; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedPlayerInfoEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | LedPlayerEntity led = new LedPlayerEntity(); |
| | | led.setId(id); |
| | | led.setName(name); |
| | | led.setPlayerName(name); |
| | | return ledPlayerEntityService.updateById(led); |
| | | } |
| | | |
| | | /** |
| | | * 获取缓存数据 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<LedPlayerEntity> setCacheInfo(List<LedPlayerEntity> list) { |
| | | for(LedPlayerEntity playerEntity: list) { |
| | | String playerId = playerEntity.getPlayerId(); |
| | | LedPlayerInfoEntity cache = new LedPlayerInfoEntity(); |
| | | // 设置屏幕状态 |
| | | String result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_STATUS + playerId); |
| | | Integer screenStatus = 1; |
| | | if(null != result) { |
| | | screenStatus = Integer.parseInt(result); |
| | | } |
| | | cache.setScreenStatus(screenStatus); |
| | | // 设置屏幕音量 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_VOL + playerId); |
| | | Integer vol = 0; |
| | | if(null != result) { |
| | | vol = Integer.parseInt(result); |
| | | } |
| | | cache.setVol(vol); |
| | | // 设置屏幕亮度 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_BRIGHTNESS + playerId); |
| | | Integer brightness = 0; |
| | | if(null != result) { |
| | | brightness = Integer.parseInt(result); |
| | | } |
| | | cache.setBrightness(brightness); |
| | | |
| | | // 设置缩略图访问路径 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + playerId); |
| | | System.out.println(playerId+"的路径结果:-----------------------------"+result); |
| | | if(null != result) { |
| | | playerEntity.setScreenShotUrl(result); |
| | | } else { |
| | | playerEntity.setScreenShotUrl(""); |
| | | } |
| | | |
| | | playerEntity.setPlayerInfo(cache); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |