Commit c8082499 by tyfanchz

设备订阅修改

1 parent 5af9d758
...@@ -179,10 +179,12 @@ public class SmartUserDeviceServiceImpl extends BaseService implements SmartUser ...@@ -179,10 +179,12 @@ public class SmartUserDeviceServiceImpl extends BaseService implements SmartUser
} }
// 通过用户手机号获取用户 token // 通过用户手机号获取用户 token
SmartUserRelation userRelation = userRelationMapper.selectByPrimaryKey(req.getUserId()); SmartUserRelation userRelation = userRelationMapper.selectByPrimaryKey(req.getUserId());
String phone = userRelation.getPhone(); String token = (String) redisService.get(userRelation.getPhone() + "_aqara");
String token = (String) redisService.get(phone + "_aqara");
// 查询支持的指令集 // 查询支持的指令集
List<String> commands = productMapper.getSupportedCommands(req.getPlatformProductId()); List<String> commands = productMapper.getSupportedCommands(req.getPlatformProductId());
log.info("$$$$ subscribeDevice commands = {}", JSON.toJSONString(commands));
if (!commands.isEmpty()) {
// 指令集不为空才订阅
// 请求 url 参数 // 请求 url 参数
Map<String, Object> reqParam = new HashMap<>(); Map<String, Object> reqParam = new HashMap<>();
reqParam.put("token", token); reqParam.put("token", token);
...@@ -204,4 +206,5 @@ public class SmartUserDeviceServiceImpl extends BaseService implements SmartUser ...@@ -204,4 +206,5 @@ public class SmartUserDeviceServiceImpl extends BaseService implements SmartUser
} }
} }
} }
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!