Skip to content

Commit 5bd9c91

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

File tree

6 files changed

+7
-44
lines changed

6 files changed

+7
-44
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ add_library(${project_name}-lib
1515

1616
## link libs
1717

18-
find_package(oatpp 1.0.0 REQUIRED)
18+
find_package(oatpp 1.1.0 REQUIRED)
1919

2020
target_link_libraries(${project_name}-lib
2121
PUBLIC oatpp::oatpp

src/App.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// main.cpp
3-
// web-starter-project
4-
//
5-
// Created by Leonid on 2/12/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#include "./controller/MyController.hpp"
103
#include "./AppComponent.hpp"

src/AppComponent.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// AppComponent.hpp
3-
// oatpp-web-starter
4-
//
5-
// Created by Leonid on 3/2/18.
6-
// Copyright © 2018 lganzzzo. All rights reserved.
7-
//
81

92
#ifndef AppComponent_hpp
103
#define AppComponent_hpp

src/controller/MyController.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//
2-
// Created by Leonid on 2019-05-27.
3-
//
41

52
#include "MyController.hpp"
63

src/controller/MyController.hpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// MyController.hpp
3-
// web-starter-project
4-
//
5-
// Created by Leonid on 2/12/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#ifndef MyController_hpp
103
#define MyController_hpp
@@ -15,6 +8,8 @@
158
#include "oatpp/core/macro/codegen.hpp"
169
#include "oatpp/core/macro/component.hpp"
1710

11+
#include OATPP_CODEGEN_BEGIN(ApiController) //<-- Begin codegen
12+
1813
/**
1914
* EXAMPLE ApiController
2015
* Basic examples of howto create ENDPOINTs
@@ -36,11 +31,6 @@ class MyController : public oatpp::web::server::api::ApiController {
3631
return std::shared_ptr<MyController>(new MyController(objectMapper));
3732
}
3833

39-
/**
40-
* Begin ENDPOINTs generation ('ApiController' codegen)
41-
*/
42-
#include OATPP_CODEGEN_BEGIN(ApiController)
43-
4434
/**
4535
* Hello World endpoint Coroutine mapped to the "/" (root)
4636
*/
@@ -101,11 +91,8 @@ class MyController : public oatpp::web::server::api::ApiController {
10191

10292
};
10393

104-
/**
105-
* Finish ENDPOINTs generation ('ApiController' codegen)
106-
*/
107-
#include OATPP_CODEGEN_END(ApiController)
108-
10994
};
11095

96+
#include OATPP_CODEGEN_BEGIN(ApiController) //<-- End codegen
97+
11198
#endif /* MyController_hpp */

src/dto/MyDTOs.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// UserDto.hpp
3-
// crud
4-
//
5-
// Created by Leonid on 3/13/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#ifndef MyDTOs_hpp
103
#define MyDTOs_hpp
@@ -18,7 +11,7 @@
1811
* Data Transfer Object. Object containing fields only.
1912
* Used in API for serialization/deserialization and validation
2013
*/
21-
class HelloDto : public oatpp::data::mapping::type::Object {
14+
class HelloDto : public oatpp::Object {
2215

2316
DTO_INIT(HelloDto, Object)
2417

@@ -28,7 +21,7 @@ class HelloDto : public oatpp::data::mapping::type::Object {
2821

2922
};
3023

31-
class MessageDto : public oatpp::data::mapping::type::Object {
24+
class MessageDto : public oatpp::Object {
3225

3326
DTO_INIT(MessageDto, Object)
3427

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