Support corp name search.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2020-09-14 Version: patch
|
||||
- Support corp name search.
|
||||
|
||||
2020-09-11 Version: patch
|
||||
- Support execute database script via open api.
|
||||
|
||||
|
||||
@@ -149,6 +149,8 @@ set(vcs_public_header_model
|
||||
include/alibabacloud/vcs/model/SearchBodyResult.h
|
||||
include/alibabacloud/vcs/model/SearchFaceRequest.h
|
||||
include/alibabacloud/vcs/model/SearchFaceResult.h
|
||||
include/alibabacloud/vcs/model/SearchObjectRequest.h
|
||||
include/alibabacloud/vcs/model/SearchObjectResult.h
|
||||
include/alibabacloud/vcs/model/StopMonitorRequest.h
|
||||
include/alibabacloud/vcs/model/StopMonitorResult.h
|
||||
include/alibabacloud/vcs/model/SyncDeviceTimeRequest.h
|
||||
@@ -308,6 +310,8 @@ set(vcs_src
|
||||
src/model/SearchBodyResult.cc
|
||||
src/model/SearchFaceRequest.cc
|
||||
src/model/SearchFaceResult.cc
|
||||
src/model/SearchObjectRequest.cc
|
||||
src/model/SearchObjectResult.cc
|
||||
src/model/StopMonitorRequest.cc
|
||||
src/model/StopMonitorResult.cc
|
||||
src/model/SyncDeviceTimeRequest.cc
|
||||
|
||||
@@ -150,6 +150,8 @@
|
||||
#include "model/SearchBodyResult.h"
|
||||
#include "model/SearchFaceRequest.h"
|
||||
#include "model/SearchFaceResult.h"
|
||||
#include "model/SearchObjectRequest.h"
|
||||
#include "model/SearchObjectResult.h"
|
||||
#include "model/StopMonitorRequest.h"
|
||||
#include "model/StopMonitorResult.h"
|
||||
#include "model/SyncDeviceTimeRequest.h"
|
||||
@@ -379,6 +381,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::SearchFaceResult> SearchFaceOutcome;
|
||||
typedef std::future<SearchFaceOutcome> SearchFaceOutcomeCallable;
|
||||
typedef std::function<void(const VcsClient*, const Model::SearchFaceRequest&, const SearchFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchFaceAsyncHandler;
|
||||
typedef Outcome<Error, Model::SearchObjectResult> SearchObjectOutcome;
|
||||
typedef std::future<SearchObjectOutcome> SearchObjectOutcomeCallable;
|
||||
typedef std::function<void(const VcsClient*, const Model::SearchObjectRequest&, const SearchObjectOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchObjectAsyncHandler;
|
||||
typedef Outcome<Error, Model::StopMonitorResult> StopMonitorOutcome;
|
||||
typedef std::future<StopMonitorOutcome> StopMonitorOutcomeCallable;
|
||||
typedef std::function<void(const VcsClient*, const Model::StopMonitorRequest&, const StopMonitorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StopMonitorAsyncHandler;
|
||||
@@ -618,6 +623,9 @@ namespace AlibabaCloud
|
||||
SearchFaceOutcome searchFace(const Model::SearchFaceRequest &request)const;
|
||||
void searchFaceAsync(const Model::SearchFaceRequest& request, const SearchFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SearchFaceOutcomeCallable searchFaceCallable(const Model::SearchFaceRequest& request) const;
|
||||
SearchObjectOutcome searchObject(const Model::SearchObjectRequest &request)const;
|
||||
void searchObjectAsync(const Model::SearchObjectRequest& request, const SearchObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SearchObjectOutcomeCallable searchObjectCallable(const Model::SearchObjectRequest& request) const;
|
||||
StopMonitorOutcome stopMonitor(const Model::StopMonitorRequest &request)const;
|
||||
void stopMonitorAsync(const Model::StopMonitorRequest& request, const StopMonitorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
StopMonitorOutcomeCallable stopMonitorCallable(const Model::StopMonitorRequest& request) const;
|
||||
|
||||
@@ -37,23 +37,37 @@ namespace AlibabaCloud
|
||||
struct RecordsItem
|
||||
{
|
||||
std::string mustacheStyle;
|
||||
int genderCode;
|
||||
int respiratorColor;
|
||||
int ethicCode;
|
||||
float rightBottomX;
|
||||
int ageLowerLimit;
|
||||
std::string faceStyle;
|
||||
float rightBottomY;
|
||||
std::vector<std::string> featureData;
|
||||
float leftTopY;
|
||||
std::string capColorReliability;
|
||||
int capStyle;
|
||||
std::string respiratorColorReliability;
|
||||
int skinColor;
|
||||
std::string ethicCodeReliability;
|
||||
std::string genderCodeReliability;
|
||||
int hairStyle;
|
||||
std::string glassColorReliability;
|
||||
int genderCode;
|
||||
int respiratorColor;
|
||||
std::string skinColorReliability;
|
||||
int ethicCode;
|
||||
std::string mustacheStyleReliability;
|
||||
int ageLowerLimit;
|
||||
std::string capStyleReliability;
|
||||
std::string faceStyleReliability;
|
||||
float leftTopY;
|
||||
float leftTopX;
|
||||
int hairColor;
|
||||
int skinColor;
|
||||
std::string glassStyleReliability;
|
||||
int ageUpLimit;
|
||||
int glassStyle;
|
||||
std::string ageUpLimitReliability;
|
||||
std::string hairStyleReliability;
|
||||
std::string ageLowerLimitReliability;
|
||||
std::string hairColorReliability;
|
||||
int glassColor;
|
||||
int hairStyle;
|
||||
int capColor;
|
||||
};
|
||||
std::vector<RecordsItem> records;
|
||||
|
||||
@@ -39,10 +39,13 @@ namespace AlibabaCloud
|
||||
void setPageNumber(int pageNumber);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getCorpName()const;
|
||||
void setCorpName(const std::string& corpName);
|
||||
|
||||
private:
|
||||
int pageNumber_;
|
||||
int pageSize_;
|
||||
std::string corpName_;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
81
vcs/include/alibabacloud/vcs/model/SearchObjectRequest.h
Normal file
81
vcs/include/alibabacloud/vcs/model/SearchObjectRequest.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_VCS_MODEL_SEARCHOBJECTREQUEST_H_
|
||||
#define ALIBABACLOUD_VCS_MODEL_SEARCHOBJECTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/vcs/VcsExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Vcs
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_VCS_EXPORT SearchObjectRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
SearchObjectRequest();
|
||||
~SearchObjectRequest();
|
||||
|
||||
std::string getCorpId()const;
|
||||
void setCorpId(const std::string& corpId);
|
||||
long getStartTime()const;
|
||||
void setStartTime(long startTime);
|
||||
int getPageNumber()const;
|
||||
void setPageNumber(int pageNumber);
|
||||
std::string getPicContent()const;
|
||||
void setPicContent(const std::string& picContent);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getObjectType()const;
|
||||
void setObjectType(const std::string& objectType);
|
||||
std::string getAlgorithmType()const;
|
||||
void setAlgorithmType(const std::string& algorithmType);
|
||||
long getEndTime()const;
|
||||
void setEndTime(long endTime);
|
||||
std::map<std::string, std::string> getDeviceList()const;
|
||||
void setDeviceList(const std::map<std::string, std::string>& deviceList);
|
||||
std::string getPicUrl()const;
|
||||
void setPicUrl(const std::string& picUrl);
|
||||
std::string getImagePath()const;
|
||||
void setImagePath(const std::string& imagePath);
|
||||
std::string getConditions()const;
|
||||
void setConditions(const std::string& conditions);
|
||||
|
||||
private:
|
||||
std::string corpId_;
|
||||
long startTime_;
|
||||
int pageNumber_;
|
||||
std::string picContent_;
|
||||
int pageSize_;
|
||||
std::string objectType_;
|
||||
std::string algorithmType_;
|
||||
long endTime_;
|
||||
std::map<std::string, std::string> deviceList_;
|
||||
std::string picUrl_;
|
||||
std::string imagePath_;
|
||||
std::string conditions_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_VCS_MODEL_SEARCHOBJECTREQUEST_H_
|
||||
82
vcs/include/alibabacloud/vcs/model/SearchObjectResult.h
Normal file
82
vcs/include/alibabacloud/vcs/model/SearchObjectResult.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_VCS_MODEL_SEARCHOBJECTRESULT_H_
|
||||
#define ALIBABACLOUD_VCS_MODEL_SEARCHOBJECTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/vcs/VcsExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Vcs
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_VCS_EXPORT SearchObjectResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
struct RecordsItem
|
||||
{
|
||||
std::string targetImageUrl;
|
||||
std::string deviceID;
|
||||
std::string sourceID;
|
||||
std::string passTime;
|
||||
std::string sourceImagePath;
|
||||
std::string sourceImageUrl;
|
||||
int leftTopY;
|
||||
std::string compareResult;
|
||||
int leftTopX;
|
||||
float score;
|
||||
std::string bodyShotTime;
|
||||
int rightBtmY;
|
||||
int rightBtmX;
|
||||
long faceShotTime;
|
||||
std::string targetImagePath;
|
||||
std::string motorShotTime;
|
||||
};
|
||||
int totalCount;
|
||||
int pageSize;
|
||||
int totalPage;
|
||||
int pageNumber;
|
||||
std::vector<DataItem::RecordsItem> records;
|
||||
};
|
||||
|
||||
|
||||
SearchObjectResult();
|
||||
explicit SearchObjectResult(const std::string &payload);
|
||||
~SearchObjectResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<DataItem> getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<DataItem> data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_VCS_MODEL_SEARCHOBJECTRESULT_H_
|
||||
@@ -2355,6 +2355,42 @@ VcsClient::SearchFaceOutcomeCallable VcsClient::searchFaceCallable(const SearchF
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VcsClient::SearchObjectOutcome VcsClient::searchObject(const SearchObjectRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SearchObjectOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SearchObjectOutcome(SearchObjectResult(outcome.result()));
|
||||
else
|
||||
return SearchObjectOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void VcsClient::searchObjectAsync(const SearchObjectRequest& request, const SearchObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, searchObject(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
VcsClient::SearchObjectOutcomeCallable VcsClient::searchObjectCallable(const SearchObjectRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SearchObjectOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->searchObject(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VcsClient::StopMonitorOutcome VcsClient::stopMonitor(const StopMonitorRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -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