From 294959d76a3cb588ccddc6fe7606dc526b4ab572 Mon Sep 17 00:00:00 2001 From: lganzzzo Date: Sun, 17 May 2020 03:05:17 +0300 Subject: [PATCH] Update to the latest oatpp API. --- client/CMakeLists.txt | 4 ++-- server/CMakeLists.txt | 4 ++-- server/src/controller/MyController.hpp | 18 +++++++----------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 7855148..9f942d4 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -18,8 +18,8 @@ add_library(${project_name}-lib ## link libs -find_package(oatpp 1.0.0 REQUIRED) -find_package(oatpp-websocket 1.0.0 REQUIRED) +find_package(oatpp 1.1.0 REQUIRED) +find_package(oatpp-websocket 1.1.0 REQUIRED) target_link_libraries(${project_name}-lib PUBLIC oatpp::oatpp diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 2b55cf1..6bbd2eb 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -19,8 +19,8 @@ add_library(${project_name}-lib ## link libs -find_package(oatpp 1.0.0 REQUIRED) -find_package(oatpp-websocket 1.0.0 REQUIRED) +find_package(oatpp 1.1.0 REQUIRED) +find_package(oatpp-websocket 1.1.0 REQUIRED) target_link_libraries(${project_name}-lib PUBLIC oatpp::oatpp diff --git a/server/src/controller/MyController.hpp b/server/src/controller/MyController.hpp index 7910b61..a74afbf 100644 --- a/server/src/controller/MyController.hpp +++ b/server/src/controller/MyController.hpp @@ -17,6 +17,9 @@ #include "oatpp/core/macro/codegen.hpp" #include "oatpp/core/macro/component.hpp" + +#include OATPP_CODEGEN_BEGIN(ApiController) //<-- codegen begin + /** * Controller with WebSocket-connect endpoint. */ @@ -39,11 +42,7 @@ class MyController : public oatpp::web::server::api::ApiController { objectMapper)){ return std::shared_ptr(new MyController(objectMapper)); } - - /** - * Begin ENDPOINTs generation ('ApiController' codegen) - */ -#include OATPP_CODEGEN_BEGIN(ApiController) + ENDPOINT_ASYNC("GET", "/", Root) { @@ -80,12 +79,9 @@ class MyController : public oatpp::web::server::api::ApiController { }; // TODO Insert Your endpoints here !!! - - /** - * Finish ENDPOINTs generation ('ApiController' codegen) - */ -#include OATPP_CODEGEN_END(ApiController) - + }; +#include OATPP_CODEGEN_END(ApiController) //<-- codegen end + #endif /* MyController_hpp */