@@ -51,20 +51,36 @@ void ListPlansResult::parse(const std::string &payload)
51
51
plansObject.diskSize = std::stoi (valuePlansPlan[" DiskSize" ].asString ());
52
52
if (!valuePlansPlan[" Flow" ].isNull ())
53
53
plansObject.flow = std::stoi (valuePlansPlan[" Flow" ].asString ());
54
- if (!valuePlansPlan[" Memory" ].isNull ())
55
- plansObject.memory = std::stoi (valuePlansPlan[" Memory" ].asString ());
56
54
if (!valuePlansPlan[" PlanId" ].isNull ())
57
55
plansObject.planId = valuePlansPlan[" PlanId" ].asString ();
58
56
if (!valuePlansPlan[" DiskType" ].isNull ())
59
57
plansObject.diskType = valuePlansPlan[" DiskType" ].asString ();
60
- if (!valuePlansPlan[" OriginPrice" ].isNull ())
61
- plansObject.originPrice = valuePlansPlan[" OriginPrice" ].asString ();
62
58
if (!valuePlansPlan[" Currency" ].isNull ())
63
59
plansObject.currency = valuePlansPlan[" Currency" ].asString ();
64
60
if (!valuePlansPlan[" SupportPlatform" ].isNull ())
65
61
plansObject.supportPlatform = valuePlansPlan[" SupportPlatform" ].asString ();
66
62
if (!valuePlansPlan[" PlanType" ].isNull ())
67
63
plansObject.planType = valuePlansPlan[" PlanType" ].asString ();
64
+ if (!valuePlansPlan[" PublicIpNum" ].isNull ())
65
+ plansObject.publicIpNum = valuePlansPlan[" PublicIpNum" ].asString ();
66
+ if (!valuePlansPlan[" IspType" ].isNull ())
67
+ plansObject.ispType = valuePlansPlan[" IspType" ].asString ();
68
+ if (!valuePlansPlan[" Memory" ].isNull ())
69
+ plansObject.memory = std::stof (valuePlansPlan[" Memory" ].asString ());
70
+ if (!valuePlansPlan[" OriginPrice" ].isNull ())
71
+ plansObject.originPrice = valuePlansPlan[" OriginPrice" ].asString ();
72
+ auto allTagsNode = valuePlansPlan[" Tags" ][" Tag" ];
73
+ for (auto valuePlansPlanTagsTag : allTagsNode)
74
+ {
75
+ Plan::Tag tagsObject;
76
+ if (!valuePlansPlanTagsTag[" CnTitle" ].isNull ())
77
+ tagsObject.cnTitle = valuePlansPlanTagsTag[" CnTitle" ].asString ();
78
+ if (!valuePlansPlanTagsTag[" EnTitle" ].isNull ())
79
+ tagsObject.enTitle = valuePlansPlanTagsTag[" EnTitle" ].asString ();
80
+ if (!valuePlansPlanTagsTag[" Color" ].isNull ())
81
+ tagsObject.color = valuePlansPlanTagsTag[" Color" ].asString ();
82
+ plansObject.tags .push_back (tagsObject);
83
+ }
68
84
plans_.push_back (plansObject);
69
85
}
70
86
0 commit comments