| | |
| | | @AllArgsConstructor |
| | | public class VnnoxService { |
| | | |
| | | // @Autowired |
| | | // @Autowired |
| | | private VnnoxAPIUtil vnnoxAPIUtil; |
| | | // @Autowired |
| | | // @Autowired |
| | | private RedisUtils redisUtils; |
| | | // @Autowired |
| | | // @Autowired |
| | | private LedPlayerEntityService ledPlayerEntityService; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public LedV2RegisterResultEntity validateSN(String name,String sn) throws URISyntaxException { |
| | | public LedV2RegisterResultEntity validateSN(String name, String sn) throws URISyntaxException { |
| | | LedV2RegisterResultEntity ledV2RegisterResultEntity = new LedV2RegisterResultEntity(); |
| | | |
| | | // 判断数据库是否存在,若不存在,判断是否已经注册到Vnnox服务器 |
| | |
| | | Integer limit = 100; |
| | | List<VnnoxPlayerResponse> playerList; |
| | | // 获取Vnnox服务器列表 |
| | | VnnoxPlayerListResponse response = vnnoxAPIUtil.getPlayerList(limit, page,name); |
| | | VnnoxPlayerListResponse response = vnnoxAPIUtil.getPlayerList(limit, page, name); |
| | | playerList = response.getRows(); |
| | | Integer total = response.getTotal() - limit; |
| | | while (total > 0) { |
| | | page = page + 1; |
| | | total = total - limit; |
| | | response = vnnoxAPIUtil.getPlayerList(limit, page,name); |
| | | response = vnnoxAPIUtil.getPlayerList(limit, page, name); |
| | | playerList.addAll(response.getRows()); |
| | | } |
| | | ledPlayerEntity = new LedPlayerEntity(); |
| | |
| | | |
| | | } |
| | | |
| | | //截屏 |
| | | public Map<String, String> getScreenShotUrl(Integer id) { |
| | | Map<String, String> map = new HashMap(); |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | //重启 |
| | | public VnnoxResult reboot(List<LedPlayerEntity> playerList) { |
| | | return vnnoxAPIUtil.reboot( |
| | | playerList.stream().map( |
| | |
| | | ); |
| | | } |
| | | |
| | | public boolean updateDataName(Long id, String name){ |
| | | public boolean updateDataName(Long id, String name) { |
| | | LedPlayerEntity byId = ledPlayerEntityService.getById(id); |
| | | if(byId==null){ |
| | | if (byId == null) { |
| | | throw new BusinessException("未找到该设备"); |
| | | } |
| | | LedPlayerEntity led=new LedPlayerEntity(); |
| | | LedPlayerEntity led = new LedPlayerEntity(); |
| | | led.setId(id); |
| | | led.setName(name); |
| | | return ledPlayerEntityService.updateById(led); |