File tree Expand file tree Collapse file tree 6 files changed +14
-52
lines changed Expand file tree Collapse file tree 6 files changed +14
-52
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ target_include_directories(${project_name}-lib PUBLIC src)
18
18
19
19
## link libs
20
20
21
- find_package (oatpp 1.0 .0 REQUIRED)
22
- find_package (oatpp-libressl 1.0 .0 REQUIRED)
21
+ find_package (oatpp 1.1 .0 REQUIRED)
22
+ find_package (oatpp-libressl 1.1 .0 REQUIRED)
23
23
24
24
include (FindPkgConfig) # <-- include pkg-config needed by FindLibreSSL.cmake script
25
25
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} /cmake" ) # <-- use FindLibreSSL.cmake in /cmake folder
Original file line number Diff line number Diff line change 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
- //
8
1
9
2
#include " ./controller/MyController.hpp"
10
3
#include " ./AppComponent.hpp"
Original file line number Diff line number Diff line change 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
- //
8
1
9
2
#ifndef AppComponent_hpp
10
3
#define AppComponent_hpp
Original file line number Diff line number Diff line change 1
- //
2
- // MyApiClient.hpp
3
- // tls-libressl
4
- //
5
- // Created by Leonid on 6/23/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
1
9
2
#ifndef MyApiClient_hpp
10
3
#define MyApiClient_hpp
13
6
#include " oatpp/core/data/mapping/type/Object.hpp"
14
7
#include " oatpp/core/macro/codegen.hpp"
15
8
16
- class MyApiClient : public oatpp ::web::client::ApiClient {
17
9
#include OATPP_CODEGEN_BEGIN(ApiClient)
10
+
11
+ class MyApiClient : public oatpp ::web::client::ApiClient {
18
12
19
13
API_CLIENT_INIT (MyApiClient)
20
14
21
15
API_CALL (" GET" , " /get" , apiGet)
22
16
23
17
API_CALL_ASYNC (" GET" , " /get" , apiGetAsync)
24
-
25
- #include OATPP_CODEGEN_END(ApiClient)
18
+
26
19
};
27
20
21
+ #include OATPP_CODEGEN_END(ApiClient)
22
+
28
23
#endif /* MyApiClient_hpp */
Original file line number Diff line number Diff line change 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
- //
8
1
9
2
#ifndef MyController_hpp
10
3
#define MyController_hpp
17
10
#include " oatpp/core/macro/codegen.hpp"
18
11
#include " oatpp/core/macro/component.hpp"
19
12
13
+
14
+ #include OATPP_CODEGEN_BEGIN(ApiController) // <--- Begin codegen
15
+
20
16
/* *
21
17
* EXAMPLE ApiController
22
18
* Basic examples of howto create ENDPOINTs
@@ -42,11 +38,6 @@ class MyController : public oatpp::web::server::api::ApiController {
42
38
return std::shared_ptr<MyController>(new MyController (objectMapper));
43
39
}
44
40
45
- /* *
46
- * Begin ENDPOINTs generation ('ApiController' codegen)
47
- */
48
- #include OATPP_CODEGEN_BEGIN(ApiController)
49
-
50
41
/* *
51
42
* Hello World endpoint Coroutine mapped to the "/" (root)
52
43
*/
@@ -125,11 +116,8 @@ class MyController : public oatpp::web::server::api::ApiController {
125
116
126
117
};
127
118
128
- /* *
129
- * Finish ENDPOINTs generation ('ApiController' codegen)
130
- */
131
- #include OATPP_CODEGEN_END(ApiController)
132
-
133
119
};
134
120
121
+ #include OATPP_CODEGEN_END(ApiController) // <--- End codegen
122
+
135
123
#endif /* MyController_hpp */
Original file line number Diff line number Diff line change 1
- //
2
- // UserDto.hpp
3
- // crud
4
- //
5
- // Created by Leonid on 3/13/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
1
9
2
#ifndef MyDTOs_hpp
10
3
#define MyDTOs_hpp
11
4
12
- #include " oatpp/core/data/mapping/type/Object.hpp"
13
5
#include " oatpp/core/macro/codegen.hpp"
6
+ #include " oatpp/core/Types.hpp"
14
7
15
8
#include OATPP_CODEGEN_BEGIN(DTO)
16
9
17
10
/* *
18
11
* Data Transfer Object. Object containing fields only.
19
12
* Used in API for serialization/deserialization and validation
20
13
*/
21
- class HelloDto : public oatpp ::data::mapping::type:: Object {
14
+ class HelloDto : public oatpp ::Object {
22
15
23
16
DTO_INIT (HelloDto, Object)
24
17
You can’t perform that action at this time.
0 commit comments