Skip to content

Commit f9d62c7

Browse files
committed
Update to the latest oatpp API.
1 parent 5bd9c91 commit f9d62c7

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
@@ -82,10 +82,10 @@ class MyController : public oatpp::web::server::api::ApiController {
8282
ENDPOINT_ASYNC_INIT(EchoDtoBody)
8383

8484
Action act() override {
85-
return request->readBodyToDtoAsync<MessageDto>(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse);
85+
return request->readBodyToDtoAsync<oatpp::Object<MessageDto>>(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse);
8686
}
8787

88-
Action returnResponse(const MessageDto::ObjectWrapper& body){
88+
Action returnResponse(const oatpp::Object<MessageDto>& body){
8989
return _return(controller->createDtoResponse(Status::CODE_200, body));
9090
}
9191

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::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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy