diff --git a/src/controller/MyController.hpp b/src/controller/MyController.hpp index 4b4c1a6..458e93c 100644 --- a/src/controller/MyController.hpp +++ b/src/controller/MyController.hpp @@ -82,10 +82,10 @@ class MyController : public oatpp::web::server::api::ApiController { ENDPOINT_ASYNC_INIT(EchoDtoBody) Action act() override { - return request->readBodyToDtoAsync(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse); + return request->readBodyToDtoAsync>(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse); } - Action returnResponse(const MessageDto::ObjectWrapper& body){ + Action returnResponse(const oatpp::Object& body){ return _return(controller->createDtoResponse(Status::CODE_200, body)); } diff --git a/src/dto/MyDTOs.hpp b/src/dto/MyDTOs.hpp index d50c432..39700b0 100644 --- a/src/dto/MyDTOs.hpp +++ b/src/dto/MyDTOs.hpp @@ -11,9 +11,9 @@ * Data Transfer Object. Object containing fields only. * Used in API for serialization/deserialization and validation */ -class HelloDto : public oatpp::Object { +class HelloDto : public oatpp::DTO { - DTO_INIT(HelloDto, Object) + DTO_INIT(HelloDto, DTO) DTO_FIELD(String, userAgent, "user-agent"); DTO_FIELD(String, message); @@ -21,9 +21,9 @@ class HelloDto : public oatpp::Object { }; -class MessageDto : public oatpp::Object { +class MessageDto : public oatpp::DTO { - DTO_INIT(MessageDto, Object) + DTO_INIT(MessageDto, DTO) DTO_FIELD(String, message);