From b5e667c1d720ff875d9a0b4022d0bc4f3f94a39b Mon Sep 17 00:00:00 2001 From: sdk-team Date: Mon, 16 Nov 2020 02:36:26 +0000 Subject: [PATCH] Update goodstech. --- CHANGELOG | 3 + goodstech/CMakeLists.txt | 94 ++++++++++ .../alibabacloud/goodstech/GoodstechClient.h | 70 ++++++++ .../alibabacloud/goodstech/GoodstechExport.h | 32 ++++ .../model/ClassifyCommodityRequest.h | 48 ++++++ .../goodstech/model/ClassifyCommodityResult.h | 61 +++++++ .../RecognizeFurnitureAttributeRequest.h | 48 ++++++ .../model/RecognizeFurnitureAttributeResult.h | 57 +++++++ .../model/RecognizeFurnitureSpuRequest.h | 57 +++++++ .../model/RecognizeFurnitureSpuResult.h | 57 +++++++ goodstech/src/GoodstechClient.cc | 161 ++++++++++++++++++ .../src/model/ClassifyCommodityRequest.cc | 40 +++++ .../src/model/ClassifyCommodityResult.cc | 62 +++++++ .../RecognizeFurnitureAttributeRequest.cc | 40 +++++ .../RecognizeFurnitureAttributeResult.cc | 56 ++++++ .../src/model/RecognizeFurnitureSpuRequest.cc | 73 ++++++++ .../src/model/RecognizeFurnitureSpuResult.cc | 56 ++++++ 17 files changed, 1015 insertions(+) create mode 100644 goodstech/CMakeLists.txt create mode 100644 goodstech/include/alibabacloud/goodstech/GoodstechClient.h create mode 100644 goodstech/include/alibabacloud/goodstech/GoodstechExport.h create mode 100644 goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityRequest.h create mode 100644 goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityResult.h create mode 100644 goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeRequest.h create mode 100644 goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeResult.h create mode 100644 goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuRequest.h create mode 100644 goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuResult.h create mode 100644 goodstech/src/GoodstechClient.cc create mode 100644 goodstech/src/model/ClassifyCommodityRequest.cc create mode 100644 goodstech/src/model/ClassifyCommodityResult.cc create mode 100644 goodstech/src/model/RecognizeFurnitureAttributeRequest.cc create mode 100644 goodstech/src/model/RecognizeFurnitureAttributeResult.cc create mode 100644 goodstech/src/model/RecognizeFurnitureSpuRequest.cc create mode 100644 goodstech/src/model/RecognizeFurnitureSpuResult.cc diff --git a/CHANGELOG b/CHANGELOG index 7c865d503..c24a97240 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-11-16 Version: patch +- Update goodstech. + 2020-11-13 Version: patch - Update Imageaudit. diff --git a/goodstech/CMakeLists.txt b/goodstech/CMakeLists.txt new file mode 100644 index 000000000..91f97d8d5 --- /dev/null +++ b/goodstech/CMakeLists.txt @@ -0,0 +1,94 @@ +# +# 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. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(goodstech_public_header + include/alibabacloud/goodstech/GoodstechClient.h + include/alibabacloud/goodstech/GoodstechExport.h ) + +set(goodstech_public_header_model + include/alibabacloud/goodstech/model/ClassifyCommodityRequest.h + include/alibabacloud/goodstech/model/ClassifyCommodityResult.h + include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeRequest.h + include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeResult.h + include/alibabacloud/goodstech/model/RecognizeFurnitureSpuRequest.h + include/alibabacloud/goodstech/model/RecognizeFurnitureSpuResult.h ) + +set(goodstech_src + src/GoodstechClient.cc + src/model/ClassifyCommodityRequest.cc + src/model/ClassifyCommodityResult.cc + src/model/RecognizeFurnitureAttributeRequest.cc + src/model/RecognizeFurnitureAttributeResult.cc + src/model/RecognizeFurnitureSpuRequest.cc + src/model/RecognizeFurnitureSpuResult.cc ) + +add_library(goodstech ${LIB_TYPE} + ${goodstech_public_header} + ${goodstech_public_header_model} + ${goodstech_src}) + +set_target_properties(goodstech + PROPERTIES + LINKER_LANGUAGE CXX + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}goodstech + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(goodstech + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_GOODSTECH_LIBRARY) +endif() + +target_include_directories(goodstech + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(goodstech + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(goodstech + jsoncpp) + target_include_directories(goodstech + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(goodstech + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(goodstech + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(goodstech + PRIVATE /usr/include/jsoncpp) + target_link_libraries(goodstech + jsoncpp) +endif() + +install(FILES ${goodstech_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/goodstech) +install(FILES ${goodstech_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/goodstech/model) +install(TARGETS goodstech + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/GoodstechClient.h b/goodstech/include/alibabacloud/goodstech/GoodstechClient.h new file mode 100644 index 000000000..f3a219d31 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/GoodstechClient.h @@ -0,0 +1,70 @@ +/* + * 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_GOODSTECH_GOODSTECHCLIENT_H_ +#define ALIBABACLOUD_GOODSTECH_GOODSTECHCLIENT_H_ + +#include +#include +#include +#include +#include "GoodstechExport.h" +#include "model/ClassifyCommodityRequest.h" +#include "model/ClassifyCommodityResult.h" +#include "model/RecognizeFurnitureAttributeRequest.h" +#include "model/RecognizeFurnitureAttributeResult.h" +#include "model/RecognizeFurnitureSpuRequest.h" +#include "model/RecognizeFurnitureSpuResult.h" + + +namespace AlibabaCloud +{ + namespace Goodstech + { + class ALIBABACLOUD_GOODSTECH_EXPORT GoodstechClient : public RpcServiceClient + { + public: + typedef Outcome ClassifyCommodityOutcome; + typedef std::future ClassifyCommodityOutcomeCallable; + typedef std::function&)> ClassifyCommodityAsyncHandler; + typedef Outcome RecognizeFurnitureAttributeOutcome; + typedef std::future RecognizeFurnitureAttributeOutcomeCallable; + typedef std::function&)> RecognizeFurnitureAttributeAsyncHandler; + typedef Outcome RecognizeFurnitureSpuOutcome; + typedef std::future RecognizeFurnitureSpuOutcomeCallable; + typedef std::function&)> RecognizeFurnitureSpuAsyncHandler; + + GoodstechClient(const Credentials &credentials, const ClientConfiguration &configuration); + GoodstechClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + GoodstechClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~GoodstechClient(); + ClassifyCommodityOutcome classifyCommodity(const Model::ClassifyCommodityRequest &request)const; + void classifyCommodityAsync(const Model::ClassifyCommodityRequest& request, const ClassifyCommodityAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ClassifyCommodityOutcomeCallable classifyCommodityCallable(const Model::ClassifyCommodityRequest& request) const; + RecognizeFurnitureAttributeOutcome recognizeFurnitureAttribute(const Model::RecognizeFurnitureAttributeRequest &request)const; + void recognizeFurnitureAttributeAsync(const Model::RecognizeFurnitureAttributeRequest& request, const RecognizeFurnitureAttributeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeFurnitureAttributeOutcomeCallable recognizeFurnitureAttributeCallable(const Model::RecognizeFurnitureAttributeRequest& request) const; + RecognizeFurnitureSpuOutcome recognizeFurnitureSpu(const Model::RecognizeFurnitureSpuRequest &request)const; + void recognizeFurnitureSpuAsync(const Model::RecognizeFurnitureSpuRequest& request, const RecognizeFurnitureSpuAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeFurnitureSpuOutcomeCallable recognizeFurnitureSpuCallable(const Model::RecognizeFurnitureSpuRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_GOODSTECH_GOODSTECHCLIENT_H_ diff --git a/goodstech/include/alibabacloud/goodstech/GoodstechExport.h b/goodstech/include/alibabacloud/goodstech/GoodstechExport.h new file mode 100644 index 000000000..2618d7f1f --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/GoodstechExport.h @@ -0,0 +1,32 @@ +/* + * 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_GOODSTECH_GOODSTECHEXPORT_H_ +#define ALIBABACLOUD_GOODSTECH_GOODSTECHEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_GOODSTECH_LIBRARY) +# define ALIBABACLOUD_GOODSTECH_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_GOODSTECH_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_GOODSTECH_EXPORT +#endif + +#endif // !ALIBABACLOUD_GOODSTECH_GOODSTECHEXPORT_H_ \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityRequest.h b/goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityRequest.h new file mode 100644 index 000000000..fa1119bc3 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityRequest.h @@ -0,0 +1,48 @@ +/* + * 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_GOODSTECH_MODEL_CLASSIFYCOMMODITYREQUEST_H_ +#define ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Goodstech + { + namespace Model + { + class ALIBABACLOUD_GOODSTECH_EXPORT ClassifyCommodityRequest : public RpcServiceRequest + { + + public: + ClassifyCommodityRequest(); + ~ClassifyCommodityRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYREQUEST_H_ \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityResult.h b/goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityResult.h new file mode 100644 index 000000000..81f504c88 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/model/ClassifyCommodityResult.h @@ -0,0 +1,61 @@ +/* + * 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_GOODSTECH_MODEL_CLASSIFYCOMMODITYRESULT_H_ +#define ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Goodstech + { + namespace Model + { + class ALIBABACLOUD_GOODSTECH_EXPORT ClassifyCommodityResult : public ServiceResult + { + public: + struct Data + { + struct Category + { + std::string categoryId; + float score; + std::string categoryName; + }; + std::vector categories; + }; + + + ClassifyCommodityResult(); + explicit ClassifyCommodityResult(const std::string &payload); + ~ClassifyCommodityResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYRESULT_H_ \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeRequest.h b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeRequest.h new file mode 100644 index 000000000..5b3ec7d73 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeRequest.h @@ -0,0 +1,48 @@ +/* + * 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_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTEREQUEST_H_ +#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Goodstech + { + namespace Model + { + class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureAttributeRequest : public RpcServiceRequest + { + + public: + RecognizeFurnitureAttributeRequest(); + ~RecognizeFurnitureAttributeRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTEREQUEST_H_ \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeResult.h b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeResult.h new file mode 100644 index 000000000..19334fa86 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeResult.h @@ -0,0 +1,57 @@ +/* + * 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_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTERESULT_H_ +#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Goodstech + { + namespace Model + { + class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureAttributeResult : public ServiceResult + { + public: + struct Data + { + std::string predStyle; + float predProbability; + std::string predStyleId; + }; + + + RecognizeFurnitureAttributeResult(); + explicit RecognizeFurnitureAttributeResult(const std::string &payload); + ~RecognizeFurnitureAttributeResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTERESULT_H_ \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuRequest.h b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuRequest.h new file mode 100644 index 000000000..d745a1eb7 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuRequest.h @@ -0,0 +1,57 @@ +/* + * 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_GOODSTECH_MODEL_RECOGNIZEFURNITURESPUREQUEST_H_ +#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPUREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Goodstech + { + namespace Model + { + class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureSpuRequest : public RpcServiceRequest + { + + public: + RecognizeFurnitureSpuRequest(); + ~RecognizeFurnitureSpuRequest(); + + float getXLength()const; + void setXLength(float xLength); + float getZLength()const; + void setZLength(float zLength); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + float getYLength()const; + void setYLength(float yLength); + + private: + float xLength_; + float zLength_; + std::string imageURL_; + float yLength_; + + }; + } + } +} +#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPUREQUEST_H_ \ No newline at end of file diff --git a/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuResult.h b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuResult.h new file mode 100644 index 000000000..e2ae6c062 --- /dev/null +++ b/goodstech/include/alibabacloud/goodstech/model/RecognizeFurnitureSpuResult.h @@ -0,0 +1,57 @@ +/* + * 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_GOODSTECH_MODEL_RECOGNIZEFURNITURESPURESULT_H_ +#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPURESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Goodstech + { + namespace Model + { + class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureSpuResult : public ServiceResult + { + public: + struct Data + { + float predProbability; + std::string predCate; + std::string predCateId; + }; + + + RecognizeFurnitureSpuResult(); + explicit RecognizeFurnitureSpuResult(const std::string &payload); + ~RecognizeFurnitureSpuResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPURESULT_H_ \ No newline at end of file diff --git a/goodstech/src/GoodstechClient.cc b/goodstech/src/GoodstechClient.cc new file mode 100644 index 000000000..cba6b8249 --- /dev/null +++ b/goodstech/src/GoodstechClient.cc @@ -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 +#include + +using namespace AlibabaCloud; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::Goodstech; +using namespace AlibabaCloud::Goodstech::Model; + +namespace +{ + const std::string SERVICE_NAME = "goodstech"; +} + +GoodstechClient::GoodstechClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "goodstech"); +} + +GoodstechClient::GoodstechClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "goodstech"); +} + +GoodstechClient::GoodstechClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "goodstech"); +} + +GoodstechClient::~GoodstechClient() +{} + +GoodstechClient::ClassifyCommodityOutcome GoodstechClient::classifyCommodity(const ClassifyCommodityRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ClassifyCommodityOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ClassifyCommodityOutcome(ClassifyCommodityResult(outcome.result())); + else + return ClassifyCommodityOutcome(outcome.error()); +} + +void GoodstechClient::classifyCommodityAsync(const ClassifyCommodityRequest& request, const ClassifyCommodityAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, classifyCommodity(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +GoodstechClient::ClassifyCommodityOutcomeCallable GoodstechClient::classifyCommodityCallable(const ClassifyCommodityRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->classifyCommodity(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +GoodstechClient::RecognizeFurnitureAttributeOutcome GoodstechClient::recognizeFurnitureAttribute(const RecognizeFurnitureAttributeRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeFurnitureAttributeOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeFurnitureAttributeOutcome(RecognizeFurnitureAttributeResult(outcome.result())); + else + return RecognizeFurnitureAttributeOutcome(outcome.error()); +} + +void GoodstechClient::recognizeFurnitureAttributeAsync(const RecognizeFurnitureAttributeRequest& request, const RecognizeFurnitureAttributeAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeFurnitureAttribute(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +GoodstechClient::RecognizeFurnitureAttributeOutcomeCallable GoodstechClient::recognizeFurnitureAttributeCallable(const RecognizeFurnitureAttributeRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeFurnitureAttribute(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +GoodstechClient::RecognizeFurnitureSpuOutcome GoodstechClient::recognizeFurnitureSpu(const RecognizeFurnitureSpuRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeFurnitureSpuOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeFurnitureSpuOutcome(RecognizeFurnitureSpuResult(outcome.result())); + else + return RecognizeFurnitureSpuOutcome(outcome.error()); +} + +void GoodstechClient::recognizeFurnitureSpuAsync(const RecognizeFurnitureSpuRequest& request, const RecognizeFurnitureSpuAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeFurnitureSpu(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +GoodstechClient::RecognizeFurnitureSpuOutcomeCallable GoodstechClient::recognizeFurnitureSpuCallable(const RecognizeFurnitureSpuRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeFurnitureSpu(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/goodstech/src/model/ClassifyCommodityRequest.cc b/goodstech/src/model/ClassifyCommodityRequest.cc new file mode 100644 index 000000000..130113418 --- /dev/null +++ b/goodstech/src/model/ClassifyCommodityRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Goodstech::Model::ClassifyCommodityRequest; + +ClassifyCommodityRequest::ClassifyCommodityRequest() : + RpcServiceRequest("goodstech", "2019-12-30", "ClassifyCommodity") +{ + setMethod(HttpRequest::Method::Post); +} + +ClassifyCommodityRequest::~ClassifyCommodityRequest() +{} + +std::string ClassifyCommodityRequest::getImageURL()const +{ + return imageURL_; +} + +void ClassifyCommodityRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setParameter("ImageURL", imageURL); +} + diff --git a/goodstech/src/model/ClassifyCommodityResult.cc b/goodstech/src/model/ClassifyCommodityResult.cc new file mode 100644 index 000000000..d3686987d --- /dev/null +++ b/goodstech/src/model/ClassifyCommodityResult.cc @@ -0,0 +1,62 @@ +/* + * 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::Goodstech; +using namespace AlibabaCloud::Goodstech::Model; + +ClassifyCommodityResult::ClassifyCommodityResult() : + ServiceResult() +{} + +ClassifyCommodityResult::ClassifyCommodityResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ClassifyCommodityResult::~ClassifyCommodityResult() +{} + +void ClassifyCommodityResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allCategoriesNode = dataNode["Categories"]["Category"]; + for (auto dataNodeCategoriesCategory : allCategoriesNode) + { + Data::Category categoryObject; + if(!dataNodeCategoriesCategory["Score"].isNull()) + categoryObject.score = std::stof(dataNodeCategoriesCategory["Score"].asString()); + if(!dataNodeCategoriesCategory["CategoryName"].isNull()) + categoryObject.categoryName = dataNodeCategoriesCategory["CategoryName"].asString(); + if(!dataNodeCategoriesCategory["CategoryId"].isNull()) + categoryObject.categoryId = dataNodeCategoriesCategory["CategoryId"].asString(); + data_.categories.push_back(categoryObject); + } + +} + +ClassifyCommodityResult::Data ClassifyCommodityResult::getData()const +{ + return data_; +} + diff --git a/goodstech/src/model/RecognizeFurnitureAttributeRequest.cc b/goodstech/src/model/RecognizeFurnitureAttributeRequest.cc new file mode 100644 index 000000000..f5404f9f4 --- /dev/null +++ b/goodstech/src/model/RecognizeFurnitureAttributeRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Goodstech::Model::RecognizeFurnitureAttributeRequest; + +RecognizeFurnitureAttributeRequest::RecognizeFurnitureAttributeRequest() : + RpcServiceRequest("goodstech", "2019-12-30", "RecognizeFurnitureAttribute") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeFurnitureAttributeRequest::~RecognizeFurnitureAttributeRequest() +{} + +std::string RecognizeFurnitureAttributeRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeFurnitureAttributeRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/goodstech/src/model/RecognizeFurnitureAttributeResult.cc b/goodstech/src/model/RecognizeFurnitureAttributeResult.cc new file mode 100644 index 000000000..b5db21290 --- /dev/null +++ b/goodstech/src/model/RecognizeFurnitureAttributeResult.cc @@ -0,0 +1,56 @@ +/* + * 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::Goodstech; +using namespace AlibabaCloud::Goodstech::Model; + +RecognizeFurnitureAttributeResult::RecognizeFurnitureAttributeResult() : + ServiceResult() +{} + +RecognizeFurnitureAttributeResult::RecognizeFurnitureAttributeResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeFurnitureAttributeResult::~RecognizeFurnitureAttributeResult() +{} + +void RecognizeFurnitureAttributeResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["PredStyleId"].isNull()) + data_.predStyleId = dataNode["PredStyleId"].asString(); + if(!dataNode["PredStyle"].isNull()) + data_.predStyle = dataNode["PredStyle"].asString(); + if(!dataNode["PredProbability"].isNull()) + data_.predProbability = std::stof(dataNode["PredProbability"].asString()); + +} + +RecognizeFurnitureAttributeResult::Data RecognizeFurnitureAttributeResult::getData()const +{ + return data_; +} + diff --git a/goodstech/src/model/RecognizeFurnitureSpuRequest.cc b/goodstech/src/model/RecognizeFurnitureSpuRequest.cc new file mode 100644 index 000000000..94fdaabd0 --- /dev/null +++ b/goodstech/src/model/RecognizeFurnitureSpuRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::Goodstech::Model::RecognizeFurnitureSpuRequest; + +RecognizeFurnitureSpuRequest::RecognizeFurnitureSpuRequest() : + RpcServiceRequest("goodstech", "2019-12-30", "RecognizeFurnitureSpu") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeFurnitureSpuRequest::~RecognizeFurnitureSpuRequest() +{} + +float RecognizeFurnitureSpuRequest::getXLength()const +{ + return xLength_; +} + +void RecognizeFurnitureSpuRequest::setXLength(float xLength) +{ + xLength_ = xLength; + setBodyParameter("XLength", std::to_string(xLength)); +} + +float RecognizeFurnitureSpuRequest::getZLength()const +{ + return zLength_; +} + +void RecognizeFurnitureSpuRequest::setZLength(float zLength) +{ + zLength_ = zLength; + setBodyParameter("ZLength", std::to_string(zLength)); +} + +std::string RecognizeFurnitureSpuRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeFurnitureSpuRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + +float RecognizeFurnitureSpuRequest::getYLength()const +{ + return yLength_; +} + +void RecognizeFurnitureSpuRequest::setYLength(float yLength) +{ + yLength_ = yLength; + setBodyParameter("YLength", std::to_string(yLength)); +} + diff --git a/goodstech/src/model/RecognizeFurnitureSpuResult.cc b/goodstech/src/model/RecognizeFurnitureSpuResult.cc new file mode 100644 index 000000000..3904793e4 --- /dev/null +++ b/goodstech/src/model/RecognizeFurnitureSpuResult.cc @@ -0,0 +1,56 @@ +/* + * 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::Goodstech; +using namespace AlibabaCloud::Goodstech::Model; + +RecognizeFurnitureSpuResult::RecognizeFurnitureSpuResult() : + ServiceResult() +{} + +RecognizeFurnitureSpuResult::RecognizeFurnitureSpuResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeFurnitureSpuResult::~RecognizeFurnitureSpuResult() +{} + +void RecognizeFurnitureSpuResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["PredCateId"].isNull()) + data_.predCateId = dataNode["PredCateId"].asString(); + if(!dataNode["PredCate"].isNull()) + data_.predCate = dataNode["PredCate"].asString(); + if(!dataNode["PredProbability"].isNull()) + data_.predProbability = std::stof(dataNode["PredProbability"].asString()); + +} + +RecognizeFurnitureSpuResult::Data RecognizeFurnitureSpuResult::getData()const +{ + return data_; +} +