2021-11-21 04:09:34 +00:00
|
|
|
#pragma once
|
|
|
|
#include <drogon/HttpController.h>
|
|
|
|
using namespace drogon;
|
2023-08-23 03:33:30 +00:00
|
|
|
|
2021-11-21 04:09:34 +00:00
|
|
|
class SlowCtrl : public drogon::HttpController<SlowCtrl>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
METHOD_LIST_BEGIN
|
|
|
|
ADD_METHOD_TO(SlowCtrl::hello, "/slow?userid={userid}", Get, "TimeFilter");
|
|
|
|
ADD_METHOD_TO(SlowCtrl::observe, "/observe?userid={userid}", Get);
|
|
|
|
METHOD_LIST_END
|
|
|
|
|
|
|
|
void hello(const HttpRequestPtr &req,
|
|
|
|
std::function<void(const HttpResponsePtr &)> &&callback,
|
|
|
|
std::string &&userid);
|
|
|
|
drogon::AsyncTask observe(
|
|
|
|
HttpRequestPtr req,
|
|
|
|
std::function<void(const HttpResponsePtr &)> callback,
|
|
|
|
std::string userid);
|
|
|
|
};
|