#pragma once #include using namespace drogon; namespace api { namespace v1 { class CoroTest : public drogon::HttpController { public: METHOD_LIST_BEGIN METHOD_ADD(CoroTest::get, "/get", Get); METHOD_ADD(CoroTest::get_with_param, "/get_with_param/{name}", Get); METHOD_ADD(CoroTest::get_with_param2, "/get_with_param2/{name}", Get); METHOD_ADD(CoroTest::get2, "/get2", Get); METHOD_ADD(CoroTest::get2, "/delay", Get, "CoroFilter"); METHOD_ADD(CoroTest::this_will_fail, "/this_will_fail", Get); METHOD_ADD(CoroTest::this_will_fail2, "/this_will_fail2", Get); METHOD_LIST_END Task<> get(HttpRequestPtr req, std::function callback); Task<> get_with_param(HttpRequestPtr req, std::function callback, std::string name); Task get_with_param2(HttpRequestPtr req, std::string name); Task get2(HttpRequestPtr req); Task<> this_will_fail( HttpRequestPtr req, std::function callback); Task this_will_fail2(HttpRequestPtr req); }; } // namespace v1 } // namespace api