From 5255330d62f043d7ed2bcb9fd9f90311a2cca06a Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 20 Aug 2020 12:16:19 +0800 Subject: [PATCH] Add list person visit count API. --- CHANGELOG | 3 + VERSION | 2 +- vcs/CMakeLists.txt | 4 + vcs/include/alibabacloud/vcs/VcsClient.h | 8 ++ .../vcs/model/ListPersonVisitCountRequest.h | 69 +++++++++++ .../vcs/model/ListPersonVisitCountResult.h | 74 +++++++++++ vcs/src/VcsClient.cc | 36 ++++++ vcs/src/model/ListPersonVisitCountRequest.cc | 117 ++++++++++++++++++ vcs/src/model/ListPersonVisitCountResult.cc | 113 +++++++++++++++++ 9 files changed, 425 insertions(+), 1 deletion(-) create mode 100644 vcs/include/alibabacloud/vcs/model/ListPersonVisitCountRequest.h create mode 100644 vcs/include/alibabacloud/vcs/model/ListPersonVisitCountResult.h create mode 100644 vcs/src/model/ListPersonVisitCountRequest.cc create mode 100644 vcs/src/model/ListPersonVisitCountResult.cc diff --git a/CHANGELOG b/CHANGELOG index cc3f710e5..3d380dffd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-08-20 Version: 1.36.602 +- Add list person visit count API. + 2020-08-20 Version: 1.36.601 - Added Global Distribute Cache OpenAPIs. - Added direct connection OpenAPIs. diff --git a/VERSION b/VERSION index 47d7da75c..823fcf41f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.601 \ No newline at end of file +1.36.602 \ No newline at end of file diff --git a/vcs/CMakeLists.txt b/vcs/CMakeLists.txt index c261cc584..a531e8dca 100644 --- a/vcs/CMakeLists.txt +++ b/vcs/CMakeLists.txt @@ -93,6 +93,8 @@ set(vcs_public_header_model include/alibabacloud/vcs/model/ListMotorAlgorithmResultsResult.h include/alibabacloud/vcs/model/ListPersonTraceRequest.h include/alibabacloud/vcs/model/ListPersonTraceResult.h + include/alibabacloud/vcs/model/ListPersonVisitCountRequest.h + include/alibabacloud/vcs/model/ListPersonVisitCountResult.h include/alibabacloud/vcs/model/ListPersonsRequest.h include/alibabacloud/vcs/model/ListPersonsResult.h include/alibabacloud/vcs/model/RecognizeFaceQualityRequest.h @@ -196,6 +198,8 @@ set(vcs_src src/model/ListMotorAlgorithmResultsResult.cc src/model/ListPersonTraceRequest.cc src/model/ListPersonTraceResult.cc + src/model/ListPersonVisitCountRequest.cc + src/model/ListPersonVisitCountResult.cc src/model/ListPersonsRequest.cc src/model/ListPersonsResult.cc src/model/RecognizeFaceQualityRequest.cc diff --git a/vcs/include/alibabacloud/vcs/VcsClient.h b/vcs/include/alibabacloud/vcs/VcsClient.h index 77c67298e..7cf1bc4c5 100644 --- a/vcs/include/alibabacloud/vcs/VcsClient.h +++ b/vcs/include/alibabacloud/vcs/VcsClient.h @@ -94,6 +94,8 @@ #include "model/ListMotorAlgorithmResultsResult.h" #include "model/ListPersonTraceRequest.h" #include "model/ListPersonTraceResult.h" +#include "model/ListPersonVisitCountRequest.h" +#include "model/ListPersonVisitCountResult.h" #include "model/ListPersonsRequest.h" #include "model/ListPersonsResult.h" #include "model/RecognizeFaceQualityRequest.h" @@ -239,6 +241,9 @@ namespace AlibabaCloud typedef Outcome ListPersonTraceOutcome; typedef std::future ListPersonTraceOutcomeCallable; typedef std::function&)> ListPersonTraceAsyncHandler; + typedef Outcome ListPersonVisitCountOutcome; + typedef std::future ListPersonVisitCountOutcomeCallable; + typedef std::function&)> ListPersonVisitCountAsyncHandler; typedef Outcome ListPersonsOutcome; typedef std::future ListPersonsOutcomeCallable; typedef std::function&)> ListPersonsAsyncHandler; @@ -394,6 +399,9 @@ namespace AlibabaCloud ListPersonTraceOutcome listPersonTrace(const Model::ListPersonTraceRequest &request)const; void listPersonTraceAsync(const Model::ListPersonTraceRequest& request, const ListPersonTraceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListPersonTraceOutcomeCallable listPersonTraceCallable(const Model::ListPersonTraceRequest& request) const; + ListPersonVisitCountOutcome listPersonVisitCount(const Model::ListPersonVisitCountRequest &request)const; + void listPersonVisitCountAsync(const Model::ListPersonVisitCountRequest& request, const ListPersonVisitCountAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListPersonVisitCountOutcomeCallable listPersonVisitCountCallable(const Model::ListPersonVisitCountRequest& request) const; ListPersonsOutcome listPersons(const Model::ListPersonsRequest &request)const; void listPersonsAsync(const Model::ListPersonsRequest& request, const ListPersonsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListPersonsOutcomeCallable listPersonsCallable(const Model::ListPersonsRequest& request) const; diff --git a/vcs/include/alibabacloud/vcs/model/ListPersonVisitCountRequest.h b/vcs/include/alibabacloud/vcs/model/ListPersonVisitCountRequest.h new file mode 100644 index 000000000..8bb7912c7 --- /dev/null +++ b/vcs/include/alibabacloud/vcs/model/ListPersonVisitCountRequest.h @@ -0,0 +1,69 @@ +/* + * 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_LISTPERSONVISITCOUNTREQUEST_H_ +#define ALIBABACLOUD_VCS_MODEL_LISTPERSONVISITCOUNTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vcs + { + namespace Model + { + class ALIBABACLOUD_VCS_EXPORT ListPersonVisitCountRequest : public RpcServiceRequest + { + + public: + ListPersonVisitCountRequest(); + ~ListPersonVisitCountRequest(); + + std::string getCorpId()const; + void setCorpId(const std::string& corpId); + std::string getEndTime()const; + void setEndTime(const std::string& endTime); + std::string getStartTime()const; + void setStartTime(const std::string& startTime); + int getPageNumber()const; + void setPageNumber(int pageNumber); + std::string getTimeAggregateType()const; + void setTimeAggregateType(const std::string& timeAggregateType); + std::string getTagCode()const; + void setTagCode(const std::string& tagCode); + int getPageSize()const; + void setPageSize(int pageSize); + std::string getAggregateType()const; + void setAggregateType(const std::string& aggregateType); + + private: + std::string corpId_; + std::string endTime_; + std::string startTime_; + int pageNumber_; + std::string timeAggregateType_; + std::string tagCode_; + int pageSize_; + std::string aggregateType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VCS_MODEL_LISTPERSONVISITCOUNTREQUEST_H_ \ No newline at end of file diff --git a/vcs/include/alibabacloud/vcs/model/ListPersonVisitCountResult.h b/vcs/include/alibabacloud/vcs/model/ListPersonVisitCountResult.h new file mode 100644 index 000000000..589a9d6bb --- /dev/null +++ b/vcs/include/alibabacloud/vcs/model/ListPersonVisitCountResult.h @@ -0,0 +1,74 @@ +/* + * 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_LISTPERSONVISITCOUNTRESULT_H_ +#define ALIBABACLOUD_VCS_MODEL_LISTPERSONVISITCOUNTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vcs + { + namespace Model + { + class ALIBABACLOUD_VCS_EXPORT ListPersonVisitCountResult : public ServiceResult + { + public: + struct Datas + { + std::string corpId; + std::string personId; + std::string deviceId; + std::string tagMetrics; + std::string tagCode; + std::string dayId; + std::string groupId; + std::string hourId; + }; + + + ListPersonVisitCountResult(); + explicit ListPersonVisitCountResult(const std::string &payload); + ~ListPersonVisitCountResult(); + std::string getTotalCount()const; + std::string getMessage()const; + std::string getPageSize()const; + std::vector getData()const; + std::string getPageNo()const; + std::string getCode()const; + std::string getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string totalCount_; + std::string message_; + std::string pageSize_; + std::vector data_; + std::string pageNo_; + std::string code_; + std::string success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VCS_MODEL_LISTPERSONVISITCOUNTRESULT_H_ \ No newline at end of file diff --git a/vcs/src/VcsClient.cc b/vcs/src/VcsClient.cc index 2e752665e..6ee1d2ed7 100644 --- a/vcs/src/VcsClient.cc +++ b/vcs/src/VcsClient.cc @@ -1347,6 +1347,42 @@ VcsClient::ListPersonTraceOutcomeCallable VcsClient::listPersonTraceCallable(con return task->get_future(); } +VcsClient::ListPersonVisitCountOutcome VcsClient::listPersonVisitCount(const ListPersonVisitCountRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListPersonVisitCountOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListPersonVisitCountOutcome(ListPersonVisitCountResult(outcome.result())); + else + return ListPersonVisitCountOutcome(outcome.error()); +} + +void VcsClient::listPersonVisitCountAsync(const ListPersonVisitCountRequest& request, const ListPersonVisitCountAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listPersonVisitCount(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VcsClient::ListPersonVisitCountOutcomeCallable VcsClient::listPersonVisitCountCallable(const ListPersonVisitCountRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listPersonVisitCount(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VcsClient::ListPersonsOutcome VcsClient::listPersons(const ListPersonsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/vcs/src/model/ListPersonVisitCountRequest.cc b/vcs/src/model/ListPersonVisitCountRequest.cc new file mode 100644 index 000000000..5e3218d8f --- /dev/null +++ b/vcs/src/model/ListPersonVisitCountRequest.cc @@ -0,0 +1,117 @@ +/* + * 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 + +using AlibabaCloud::Vcs::Model::ListPersonVisitCountRequest; + +ListPersonVisitCountRequest::ListPersonVisitCountRequest() : + RpcServiceRequest("vcs", "2020-05-15", "ListPersonVisitCount") +{ + setMethod(HttpRequest::Method::Post); +} + +ListPersonVisitCountRequest::~ListPersonVisitCountRequest() +{} + +std::string ListPersonVisitCountRequest::getCorpId()const +{ + return corpId_; +} + +void ListPersonVisitCountRequest::setCorpId(const std::string& corpId) +{ + corpId_ = corpId; + setBodyParameter("CorpId", corpId); +} + +std::string ListPersonVisitCountRequest::getEndTime()const +{ + return endTime_; +} + +void ListPersonVisitCountRequest::setEndTime(const std::string& endTime) +{ + endTime_ = endTime; + setBodyParameter("EndTime", endTime); +} + +std::string ListPersonVisitCountRequest::getStartTime()const +{ + return startTime_; +} + +void ListPersonVisitCountRequest::setStartTime(const std::string& startTime) +{ + startTime_ = startTime; + setBodyParameter("StartTime", startTime); +} + +int ListPersonVisitCountRequest::getPageNumber()const +{ + return pageNumber_; +} + +void ListPersonVisitCountRequest::setPageNumber(int pageNumber) +{ + pageNumber_ = pageNumber; + setBodyParameter("PageNumber", std::to_string(pageNumber)); +} + +std::string ListPersonVisitCountRequest::getTimeAggregateType()const +{ + return timeAggregateType_; +} + +void ListPersonVisitCountRequest::setTimeAggregateType(const std::string& timeAggregateType) +{ + timeAggregateType_ = timeAggregateType; + setBodyParameter("TimeAggregateType", timeAggregateType); +} + +std::string ListPersonVisitCountRequest::getTagCode()const +{ + return tagCode_; +} + +void ListPersonVisitCountRequest::setTagCode(const std::string& tagCode) +{ + tagCode_ = tagCode; + setBodyParameter("TagCode", tagCode); +} + +int ListPersonVisitCountRequest::getPageSize()const +{ + return pageSize_; +} + +void ListPersonVisitCountRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setBodyParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListPersonVisitCountRequest::getAggregateType()const +{ + return aggregateType_; +} + +void ListPersonVisitCountRequest::setAggregateType(const std::string& aggregateType) +{ + aggregateType_ = aggregateType; + setBodyParameter("AggregateType", aggregateType); +} + diff --git a/vcs/src/model/ListPersonVisitCountResult.cc b/vcs/src/model/ListPersonVisitCountResult.cc new file mode 100644 index 000000000..0b8ca1109 --- /dev/null +++ b/vcs/src/model/ListPersonVisitCountResult.cc @@ -0,0 +1,113 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Vcs; +using namespace AlibabaCloud::Vcs::Model; + +ListPersonVisitCountResult::ListPersonVisitCountResult() : + ServiceResult() +{} + +ListPersonVisitCountResult::ListPersonVisitCountResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListPersonVisitCountResult::~ListPersonVisitCountResult() +{} + +void ListPersonVisitCountResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDataNode = value["Data"]["Datas"]; + for (auto valueDataDatas : allDataNode) + { + Datas dataObject; + if(!valueDataDatas["CorpId"].isNull()) + dataObject.corpId = valueDataDatas["CorpId"].asString(); + if(!valueDataDatas["DeviceId"].isNull()) + dataObject.deviceId = valueDataDatas["DeviceId"].asString(); + if(!valueDataDatas["GroupId"].isNull()) + dataObject.groupId = valueDataDatas["GroupId"].asString(); + if(!valueDataDatas["PersonId"].isNull()) + dataObject.personId = valueDataDatas["PersonId"].asString(); + if(!valueDataDatas["TagCode"].isNull()) + dataObject.tagCode = valueDataDatas["TagCode"].asString(); + if(!valueDataDatas["TagMetrics"].isNull()) + dataObject.tagMetrics = valueDataDatas["TagMetrics"].asString(); + if(!valueDataDatas["HourId"].isNull()) + dataObject.hourId = valueDataDatas["HourId"].asString(); + if(!valueDataDatas["DayId"].isNull()) + dataObject.dayId = valueDataDatas["DayId"].asString(); + data_.push_back(dataObject); + } + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["PageNo"].isNull()) + pageNo_ = value["PageNo"].asString(); + if(!value["PageSize"].isNull()) + pageSize_ = value["PageSize"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString(); + if(!value["TotalCount"].isNull()) + totalCount_ = value["TotalCount"].asString(); + +} + +std::string ListPersonVisitCountResult::getTotalCount()const +{ + return totalCount_; +} + +std::string ListPersonVisitCountResult::getMessage()const +{ + return message_; +} + +std::string ListPersonVisitCountResult::getPageSize()const +{ + return pageSize_; +} + +std::vector ListPersonVisitCountResult::getData()const +{ + return data_; +} + +std::string ListPersonVisitCountResult::getPageNo()const +{ + return pageNo_; +} + +std::string ListPersonVisitCountResult::getCode()const +{ + return code_; +} + +std::string ListPersonVisitCountResult::getSuccess()const +{ + return success_; +} +