Commit 7130c016 by 111-PC\111

[+]aqara代码提交

1 parent 5df88c06
......@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -90,9 +91,11 @@ public class AqaraDeviceService extends BaseDeviceService {
if(StringUtils.isEmpty(token)){
R.error(ResultEnum.PARAM_ERROR.getCode(),ResultEnum.PARAM_ERROR.getMessage());
}
JSONObject jsonObject = JSONObject.parseObject(data);
List<ResourceSubscribeInfo> resourceSubscribeInfos = JSONObject.parseArray(jsonObject.getString("data"), ResourceSubscribeInfo.class);
ResponseMsg responseMsg = ResourceManager.subscriber(new AiotConfig(clientId, null, token, null, domain), resourceSubscribeInfos);
String result = JSONObject.parseObject(data).getString("data");
ResourceSubscribeInfo resourceSubscribeInfo = JSONObject.parseObject(result, ResourceSubscribeInfo.class);
List<ResourceSubscribeInfo> resourceSubscribeInfoList=new ArrayList<>();
resourceSubscribeInfoList.add(resourceSubscribeInfo);
ResponseMsg responseMsg = ResourceManager.subscriber(new AiotConfig(clientId, null, token, null, domain), resourceSubscribeInfoList);
if (responseMsg != null && Constants.AQARA_RETURN_SUCCESS_CODE == responseMsg.getCode()) {
return R.ok(JSONObject.toJSONString(responseMsg));
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!