Comments (7)
产品方定义的 Iot 2018-01-20 GetThingTopo 接口的回调数据结构中,Data 内没有 ProductInfo 和 PropertyStatusInfo。在 Data.List 中有 deviceInfo 与生成结果相符。
您可以提交工单,将问题反馈给 Iot 产品方,让他们改下相关文档。
<ResultMapping>
<Member tagName="RequestId" type="String" visibility="Public" name="requestId"/>
<Member tagName="Success" type="Boolean" visibility="Public" name="success"/>
<Member tagName="Code" type="String" visibility="Public" name="code"/>
<Member tagName="ErrorMessage" type="String" visibility="Public" name="errorMessage"/>
<Struct tagName="Data" visibility="Public" name="data">
<Member tagName="Total" type="Long" visibility="Public" name="total"/>
<Member tagName="CurrentPage" type="Integer" visibility="Public" name="currentPage"/>
<Member tagName="PageSize" type="Integer" visibility="Public" name="pageSize"/>
<Member tagName="PageCount" type="Long" visibility="Public" name="pageCount"/>
<Array tagName="List" itemName="deviceInfo" visibility="Public" name="list" nullToEmpty="true">
<Member tagName="IotId" type="String" visibility="Public" name="iotId"/>
<Member tagName="ProductKey" type="String" visibility="Public" name="productKey"/>
<Member tagName="DeviceName" type="String" visibility="Public" name="deviceName"/>
</Array>
</Struct>
</ResultMapping>
from aliyun-openapi-cpp-sdk.
您好,请关注 #69 是否可以解决您的问题。
from aliyun-openapi-cpp-sdk.
在您提供的文档页面中,未找到 dataNode 定义。
from aliyun-openapi-cpp-sdk.
@AxiosCros
dataNode 是你们的代码中的局部变量啊亲,
from aliyun-openapi-cpp-sdk.
@AxiosCros
您就不能能仔细看看代码后再回复我吗?
void GetThingTopoResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["Total"].isNull())
data_.total = std::stol(dataNode["Total"].asString());
if(!dataNode["CurrentPage"].isNull())
data_.currentPage = std::stoi(dataNode["CurrentPage"].asString());
if(!dataNode["PageSize"].isNull())
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
if(!dataNode["PageCount"].isNull())
data_.pageCount = std::stol(dataNode["PageCount"].asString());
auto allList = value["List"]["deviceInfo"];
for (auto value : allList)
{
Data::DeviceInfo deviceInfoObject;
if(!value["IotId"].isNull())
deviceInfoObject.iotId = value["IotId"].asString();
if(!value["ProductKey"].isNull())
deviceInfoObject.productKey = value["ProductKey"].asString();
if(!value["DeviceName"].isNull())
deviceInfoObject.deviceName = value["DeviceName"].asString();
data_.list.push_back(deviceInfoObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
}
value["List"]
是不存在的,dataNode (也就是 value["Data"]
) 下面才有 List
。
不是文档的问题,是代码写错了!
from aliyun-openapi-cpp-sdk.
抱歉,我看一下。
代码是自动生成的不是编写的,如果有问题的话,要去修改下生成器。
感谢反馈。
from aliyun-openapi-cpp-sdk.
@AxiosCros
解决了。
from aliyun-openapi-cpp-sdk.
Related Issues (20)
- Win生成sdk失败 HOT 7
- 关于BUILD_PRODUCT HOT 1
- 在vs2019(win32),iot_sdk中RRpcResult::parse解析MessageId错误 HOT 1
- rds模板读取json返回数据出错 HOT 2
- Getting build error while building in debug mode HOT 2
- centos7下编译失败 HOT 2
- CurlHttpClient内存泄露 HOT 1
- 自然语言C++无法编译 HOT 1
- 虚拟机环境:CentOS Linux release 7.5.1804 (Core),nlp-automl运行报错。 HOT 1
- wincrypt.h 出现大量重复错误信息 error C2146: 语法错误 : 缺少“;”(在标识符“HCRYPTPROV”的前面) error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int HOT 3
- 函数定义不存在 HOT 1
- SDK版本号 1.36.1335 SegmentFurnitureResult::parse 会导致崩溃的问题 HOT 4
- 编译时出现 wincrypt.h(380,29): error C4430: 缺少类型说明符
- ecs\src\model\InvokeCommandRequest.cc(197,3): error
- ecs\src\model\RunCommandRequest.cc(236,3): error C2664 HOT 1
- sts 模块无法在MacOS上编译
- 项目中引用core,编译报错../src/EcsMetadataFetcher.h找不到
- readme中Fedora安装jsoncpp依赖描述不准确
- 无法编译64位版本 HOT 6
- Quick Example in README.md cannot run successfully HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-openapi-cpp-sdk.