Skip to content

Commit 016ab6e

Browse files
committed
Update to the latest oatpp API.
1 parent 8839c0d commit 016ab6e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/controller/MyController.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ class MyController : public oatpp::web::server::api::ApiController {
8989
ENDPOINT_ASYNC_INIT(EchoDtoBody)
9090

9191
Action act() override {
92-
return request->readBodyToDtoAsync<MessageDto>(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse);
92+
return request->readBodyToDtoAsync<oatpp::Object<MessageDto>>(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse);
9393
}
9494

95-
Action returnResponse(const MessageDto::ObjectWrapper& body){
95+
Action returnResponse(const oatpp::Object<MessageDto>& body){
9696
return _return(controller->createDtoResponse(Status::CODE_200, body));
9797
}
9898

src/dto/MyDTOs.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
* Data Transfer Object. Object containing fields only.
1212
* Used in API for serialization/deserialization and validation
1313
*/
14-
class HelloDto : public oatpp::Object {
14+
class HelloDto : public oatpp::DTO {
1515

16-
DTO_INIT(HelloDto, Object)
16+
DTO_INIT(HelloDto, DTO)
1717

1818
DTO_FIELD(String, userAgent, "user-agent");
1919
DTO_FIELD(String, message);
2020
DTO_FIELD(String, server);
2121

2222
};
2323

24-
class MessageDto : public oatpp::data::mapping::type::Object {
24+
class MessageDto : public oatpp::DTO {
2525

26-
DTO_INIT(MessageDto, Object)
26+
DTO_INIT(MessageDto, DTO)
2727

2828
DTO_FIELD(String, message);
2929

0 commit comments

Comments
 (0)