Support corp name search.
This commit is contained in:
@@ -80,6 +80,34 @@ void GetFaceModelResultResult::parse(const std::string &payload)
|
||||
recordsItemObject.glassColor = std::stoi(dataNodeRecordsRecordsItem["GlassColor"].asString());
|
||||
if(!dataNodeRecordsRecordsItem["CapColor"].isNull())
|
||||
recordsItemObject.capColor = std::stoi(dataNodeRecordsRecordsItem["CapColor"].asString());
|
||||
if(!dataNodeRecordsRecordsItem["CapColorReliability"].isNull())
|
||||
recordsItemObject.capColorReliability = dataNodeRecordsRecordsItem["CapColorReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["RespiratorColorReliability"].isNull())
|
||||
recordsItemObject.respiratorColorReliability = dataNodeRecordsRecordsItem["RespiratorColorReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["EthicCodeReliability"].isNull())
|
||||
recordsItemObject.ethicCodeReliability = dataNodeRecordsRecordsItem["EthicCodeReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["GenderCodeReliability"].isNull())
|
||||
recordsItemObject.genderCodeReliability = dataNodeRecordsRecordsItem["GenderCodeReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["GlassColorReliability"].isNull())
|
||||
recordsItemObject.glassColorReliability = dataNodeRecordsRecordsItem["GlassColorReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["SkinColorReliability"].isNull())
|
||||
recordsItemObject.skinColorReliability = dataNodeRecordsRecordsItem["SkinColorReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["MustacheStyleReliability"].isNull())
|
||||
recordsItemObject.mustacheStyleReliability = dataNodeRecordsRecordsItem["MustacheStyleReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["CapStyleReliability"].isNull())
|
||||
recordsItemObject.capStyleReliability = dataNodeRecordsRecordsItem["CapStyleReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["FaceStyleReliability"].isNull())
|
||||
recordsItemObject.faceStyleReliability = dataNodeRecordsRecordsItem["FaceStyleReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["GlassStyleReliability"].isNull())
|
||||
recordsItemObject.glassStyleReliability = dataNodeRecordsRecordsItem["GlassStyleReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["AgeUpLimitReliability"].isNull())
|
||||
recordsItemObject.ageUpLimitReliability = dataNodeRecordsRecordsItem["AgeUpLimitReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["HairStyleReliability"].isNull())
|
||||
recordsItemObject.hairStyleReliability = dataNodeRecordsRecordsItem["HairStyleReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["AgeLowerLimitReliability"].isNull())
|
||||
recordsItemObject.ageLowerLimitReliability = dataNodeRecordsRecordsItem["AgeLowerLimitReliability"].asString();
|
||||
if(!dataNodeRecordsRecordsItem["HairColorReliability"].isNull())
|
||||
recordsItemObject.hairColorReliability = dataNodeRecordsRecordsItem["HairColorReliability"].asString();
|
||||
auto allFeatureData = value["FeatureData"]["FeatureData"];
|
||||
for (auto value : allFeatureData)
|
||||
recordsItemObject.featureData.push_back(value.asString());
|
||||
|
||||
@@ -49,3 +49,14 @@ void ListCorpsRequest::setPageSize(int pageSize)
|
||||
setBodyParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string ListCorpsRequest::getCorpName()const
|
||||
{
|
||||
return corpName_;
|
||||
}
|
||||
|
||||
void ListCorpsRequest::setCorpName(const std::string& corpName)
|
||||
{
|
||||
corpName_ = corpName;
|
||||
setBodyParameter("CorpName", corpName);
|
||||
}
|
||||
|
||||
|
||||
161
vcs/src/model/SearchObjectRequest.cc
Normal file
161
vcs/src/model/SearchObjectRequest.cc
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/vcs/model/SearchObjectRequest.h>
|
||||
|
||||
using AlibabaCloud::Vcs::Model::SearchObjectRequest;
|
||||
|
||||
SearchObjectRequest::SearchObjectRequest() :
|
||||
RpcServiceRequest("vcs", "2020-05-15", "SearchObject")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SearchObjectRequest::~SearchObjectRequest()
|
||||
{}
|
||||
|
||||
std::string SearchObjectRequest::getCorpId()const
|
||||
{
|
||||
return corpId_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setCorpId(const std::string& corpId)
|
||||
{
|
||||
corpId_ = corpId;
|
||||
setBodyParameter("CorpId", corpId);
|
||||
}
|
||||
|
||||
long SearchObjectRequest::getStartTime()const
|
||||
{
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setStartTime(long startTime)
|
||||
{
|
||||
startTime_ = startTime;
|
||||
setBodyParameter("StartTime", std::to_string(startTime));
|
||||
}
|
||||
|
||||
int SearchObjectRequest::getPageNumber()const
|
||||
{
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setPageNumber(int pageNumber)
|
||||
{
|
||||
pageNumber_ = pageNumber;
|
||||
setBodyParameter("PageNumber", std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
std::string SearchObjectRequest::getPicContent()const
|
||||
{
|
||||
return picContent_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setPicContent(const std::string& picContent)
|
||||
{
|
||||
picContent_ = picContent;
|
||||
setBodyParameter("PicContent", picContent);
|
||||
}
|
||||
|
||||
int SearchObjectRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setBodyParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string SearchObjectRequest::getObjectType()const
|
||||
{
|
||||
return objectType_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setObjectType(const std::string& objectType)
|
||||
{
|
||||
objectType_ = objectType;
|
||||
setBodyParameter("ObjectType", objectType);
|
||||
}
|
||||
|
||||
std::string SearchObjectRequest::getAlgorithmType()const
|
||||
{
|
||||
return algorithmType_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setAlgorithmType(const std::string& algorithmType)
|
||||
{
|
||||
algorithmType_ = algorithmType;
|
||||
setBodyParameter("AlgorithmType", algorithmType);
|
||||
}
|
||||
|
||||
long SearchObjectRequest::getEndTime()const
|
||||
{
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setEndTime(long endTime)
|
||||
{
|
||||
endTime_ = endTime;
|
||||
setBodyParameter("EndTime", std::to_string(endTime));
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> SearchObjectRequest::getDeviceList()const
|
||||
{
|
||||
return deviceList_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setDeviceList(const std::map<std::string, std::string>& deviceList)
|
||||
{
|
||||
deviceList_ = deviceList;
|
||||
setJsonParameters("DeviceList", deviceList);
|
||||
}
|
||||
|
||||
std::string SearchObjectRequest::getPicUrl()const
|
||||
{
|
||||
return picUrl_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setPicUrl(const std::string& picUrl)
|
||||
{
|
||||
picUrl_ = picUrl;
|
||||
setBodyParameter("PicUrl", picUrl);
|
||||
}
|
||||
|
||||
std::string SearchObjectRequest::getImagePath()const
|
||||
{
|
||||
return imagePath_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setImagePath(const std::string& imagePath)
|
||||
{
|
||||
imagePath_ = imagePath;
|
||||
setBodyParameter("ImagePath", imagePath);
|
||||
}
|
||||
|
||||
std::string SearchObjectRequest::getConditions()const
|
||||
{
|
||||
return conditions_;
|
||||
}
|
||||
|
||||
void SearchObjectRequest::setConditions(const std::string& conditions)
|
||||
{
|
||||
conditions_ = conditions;
|
||||
setBodyParameter("Conditions", conditions);
|
||||
}
|
||||
|
||||
115
vcs/src/model/SearchObjectResult.cc
Normal file
115
vcs/src/model/SearchObjectResult.cc
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/vcs/model/SearchObjectResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Vcs;
|
||||
using namespace AlibabaCloud::Vcs::Model;
|
||||
|
||||
SearchObjectResult::SearchObjectResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SearchObjectResult::SearchObjectResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SearchObjectResult::~SearchObjectResult()
|
||||
{}
|
||||
|
||||
void SearchObjectResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDataNode = value["Data"]["DataItem"];
|
||||
for (auto valueDataDataItem : allDataNode)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!valueDataDataItem["PageNumber"].isNull())
|
||||
dataObject.pageNumber = std::stoi(valueDataDataItem["PageNumber"].asString());
|
||||
if(!valueDataDataItem["PageSize"].isNull())
|
||||
dataObject.pageSize = std::stoi(valueDataDataItem["PageSize"].asString());
|
||||
if(!valueDataDataItem["TotalCount"].isNull())
|
||||
dataObject.totalCount = std::stoi(valueDataDataItem["TotalCount"].asString());
|
||||
if(!valueDataDataItem["TotalPage"].isNull())
|
||||
dataObject.totalPage = std::stoi(valueDataDataItem["TotalPage"].asString());
|
||||
auto allRecordsNode = allDataNode["Records"]["RecordsItem"];
|
||||
for (auto allDataNodeRecordsRecordsItem : allRecordsNode)
|
||||
{
|
||||
DataItem::RecordsItem recordsObject;
|
||||
if(!allDataNodeRecordsRecordsItem["BodyShotTime"].isNull())
|
||||
recordsObject.bodyShotTime = allDataNodeRecordsRecordsItem["BodyShotTime"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["CompareResult"].isNull())
|
||||
recordsObject.compareResult = allDataNodeRecordsRecordsItem["CompareResult"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["DeviceID"].isNull())
|
||||
recordsObject.deviceID = allDataNodeRecordsRecordsItem["DeviceID"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["FaceShotTime"].isNull())
|
||||
recordsObject.faceShotTime = std::stol(allDataNodeRecordsRecordsItem["FaceShotTime"].asString());
|
||||
if(!allDataNodeRecordsRecordsItem["LeftTopX"].isNull())
|
||||
recordsObject.leftTopX = std::stoi(allDataNodeRecordsRecordsItem["LeftTopX"].asString());
|
||||
if(!allDataNodeRecordsRecordsItem["LeftTopY"].isNull())
|
||||
recordsObject.leftTopY = std::stoi(allDataNodeRecordsRecordsItem["LeftTopY"].asString());
|
||||
if(!allDataNodeRecordsRecordsItem["MotorShotTime"].isNull())
|
||||
recordsObject.motorShotTime = allDataNodeRecordsRecordsItem["MotorShotTime"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["PassTime"].isNull())
|
||||
recordsObject.passTime = allDataNodeRecordsRecordsItem["PassTime"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["RightBtmX"].isNull())
|
||||
recordsObject.rightBtmX = std::stoi(allDataNodeRecordsRecordsItem["RightBtmX"].asString());
|
||||
if(!allDataNodeRecordsRecordsItem["RightBtmY"].isNull())
|
||||
recordsObject.rightBtmY = std::stoi(allDataNodeRecordsRecordsItem["RightBtmY"].asString());
|
||||
if(!allDataNodeRecordsRecordsItem["Score"].isNull())
|
||||
recordsObject.score = std::stof(allDataNodeRecordsRecordsItem["Score"].asString());
|
||||
if(!allDataNodeRecordsRecordsItem["SourceID"].isNull())
|
||||
recordsObject.sourceID = allDataNodeRecordsRecordsItem["SourceID"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["SourceImagePath"].isNull())
|
||||
recordsObject.sourceImagePath = allDataNodeRecordsRecordsItem["SourceImagePath"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["SourceImageUrl"].isNull())
|
||||
recordsObject.sourceImageUrl = allDataNodeRecordsRecordsItem["SourceImageUrl"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["TargetImagePath"].isNull())
|
||||
recordsObject.targetImagePath = allDataNodeRecordsRecordsItem["TargetImagePath"].asString();
|
||||
if(!allDataNodeRecordsRecordsItem["TargetImageUrl"].isNull())
|
||||
recordsObject.targetImageUrl = allDataNodeRecordsRecordsItem["TargetImageUrl"].asString();
|
||||
dataObject.records.push_back(recordsObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string SearchObjectResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<SearchObjectResult::DataItem> SearchObjectResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string SearchObjectResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user