lganzzzo on refactor_object_wrapper
Types: oatpp::Void now is a spe⦠(compare)
@/all ,
Update :bell:
Oat++ version was increased to 0.19.10
, and the new release tag is added.
Please find the release with changes made in October here 0.19.10
ApiController
. Add router prefix.LazyStringMap
to store headers and query parameters.ConnectionPool
. You may find usage example here. Used to increase performance and, in order to prevent ephemeral ports exhaustion on the client during high load. ADDCORS
--> ADD_CORS
macro.Cheers :tada:
Leonid
RequestExecutor
for ApiClient
.
oatpp-admin
like in django. But it is a good idea to have one in future
Hello @madkote ,
I don't have any direct recommendations, but there are some points to consider:
Simple API
- then it should be very easy to use any Redis client, and the process of integration should be straight forward.Async API
- then things become more complicated because, in oatpp-coroutines, you have to user oatpp-coroutines based API. It also depends on what kind of Redis API you are planning to use...Something like that...
Please let me know if you have more questions.
DTO_FIELD(Int64, time);
};
class ResponseDto : public oatpp::data::mapping::type::Object
{
DTO_INIT(ResponseDto, Object)
DTO_FIELD(HeaderDto::ObjectWrapper, header);
};
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include <iostream>
#include OATPP_CODEGEN_BEGIN(DTO)
class MyBaseDto : public oatpp::data::mapping::type::Object {
DTO_INIT(MyBaseDto, Object)
DTO_FIELD(String, myBaseDtoField);
};
class HeaderDto : public MyBaseDto /* Should also extend a class here */ {
DTO_INIT(HeaderDto, MyBaseDto)
DTO_FIELD(Int64, time);
};
class ResponseDto : public oatpp::data::mapping::type::Object {
DTO_INIT(ResponseDto, Object)
DTO_FIELD(HeaderDto::ObjectWrapper, header) = HeaderDto::createShared(); // Don't forger to initialize object
};
#include OATPP_CODEGEN_END(DTO)
void run() {
auto dto = ResponseDto::createShared();
dto->header->time = 0;
dto->header->myBaseDtoField = "Hello base class";
auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared();
auto json = objectMapper->writeToString(dto);
std::cout << json->c_str() << std::endl;
}
int main() {
oatpp::base::Environment::init();
run();
oatpp::base::Environment::destroy();
return 0;
}