Update SearchFace.

This commit is contained in:
sdk-team
2020-11-24 11:07:13 +00:00
parent 42b2b25562
commit df2d0d89e1
5 changed files with 26 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
2020-11-24 Version: patch
- Update SearchFace.
2020-11-24 Version: patch 2020-11-24 Version: patch
- Generated 2020-01-01 for `ddoscoo`. - Generated 2020-01-01 for `ddoscoo`.

View File

@@ -35,6 +35,8 @@ namespace AlibabaCloud
SearchFaceRequest(); SearchFaceRequest();
~SearchFaceRequest(); ~SearchFaceRequest();
std::string getDbNames()const;
void setDbNames(const std::string& dbNames);
std::string getDbName()const; std::string getDbName()const;
void setDbName(const std::string& dbName); void setDbName(const std::string& dbName);
std::string getImageUrl()const; std::string getImageUrl()const;
@@ -43,6 +45,7 @@ namespace AlibabaCloud
void setLimit(int limit); void setLimit(int limit);
private: private:
std::string dbNames_;
std::string dbName_; std::string dbName_;
std::string imageUrl_; std::string imageUrl_;
int limit_; int limit_;

View File

@@ -48,6 +48,7 @@ namespace AlibabaCloud
std::string faceId; std::string faceId;
std::string entityId; std::string entityId;
float score; float score;
std::string dbName;
std::string extraData; std::string extraData;
}; };
std::vector<MatchListItem::FaceItemsItem> faceItems; std::vector<MatchListItem::FaceItemsItem> faceItems;

View File

@@ -27,6 +27,17 @@ SearchFaceRequest::SearchFaceRequest() :
SearchFaceRequest::~SearchFaceRequest() SearchFaceRequest::~SearchFaceRequest()
{} {}
std::string SearchFaceRequest::getDbNames()const
{
return dbNames_;
}
void SearchFaceRequest::setDbNames(const std::string& dbNames)
{
dbNames_ = dbNames;
setParameter("DbNames", dbNames);
}
std::string SearchFaceRequest::getDbName()const std::string SearchFaceRequest::getDbName()const
{ {
return dbName_; return dbName_;

View File

@@ -50,12 +50,14 @@ void SearchFaceResult::parse(const std::string &payload)
Data::MatchListItem::FaceItemsItem faceItemsObject; Data::MatchListItem::FaceItemsItem faceItemsObject;
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].isNull()) if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].isNull())
faceItemsObject.faceId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].asString(); faceItemsObject.faceId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].isNull())
faceItemsObject.score = std::stof(dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].asString());
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].isNull())
faceItemsObject.extraData = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].isNull()) if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].isNull())
faceItemsObject.entityId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].asString(); faceItemsObject.entityId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].isNull())
faceItemsObject.score = std::stof(dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].asString());
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].isNull())
faceItemsObject.dbName = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].isNull())
faceItemsObject.extraData = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].asString();
matchListItemObject.faceItems.push_back(faceItemsObject); matchListItemObject.faceItems.push_back(faceItemsObject);
} }
auto locationNode = value["Location"]; auto locationNode = value["Location"];
@@ -63,10 +65,10 @@ void SearchFaceResult::parse(const std::string &payload)
matchListItemObject.location.x = std::stoi(locationNode["X"].asString()); matchListItemObject.location.x = std::stoi(locationNode["X"].asString());
if(!locationNode["Y"].isNull()) if(!locationNode["Y"].isNull())
matchListItemObject.location.y = std::stoi(locationNode["Y"].asString()); matchListItemObject.location.y = std::stoi(locationNode["Y"].asString());
if(!locationNode["Width"].isNull())
matchListItemObject.location.width = std::stoi(locationNode["Width"].asString());
if(!locationNode["Height"].isNull()) if(!locationNode["Height"].isNull())
matchListItemObject.location.height = std::stoi(locationNode["Height"].asString()); matchListItemObject.location.height = std::stoi(locationNode["Height"].asString());
if(!locationNode["Width"].isNull())
matchListItemObject.location.width = std::stoi(locationNode["Width"].asString());
data_.matchList.push_back(matchListItemObject); data_.matchList.push_back(matchListItemObject);
} }