forked from HadesD/eCommerceWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDashboardCtrl.h
20 lines (16 loc) · 864 Bytes
/
DashboardCtrl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
#include <drogon/HttpController.h>
using namespace drogon;
class DashboardCtrl : public drogon::HttpController<DashboardCtrl>
{
public:
METHOD_LIST_BEGIN
// use METHOD_ADD to add your custom processing function here;
// METHOD_ADD(DashboardCtrl::get, "/{2}/{1}", Get); // path is /DashboardCtrl/{arg2}/{arg1}
// METHOD_ADD(DashboardCtrl::your_method_name, "/{1}/{2}/list", Get); // path is /DashboardCtrl/{arg1}/{arg2}/list
ADD_METHOD_TO(DashboardCtrl::statistics, "/statistics", Get, "AuthFilter");
METHOD_LIST_END
// your declaration of processing function maybe like this:
// void get(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, int p1, std::string p2);
void statistics(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback) const;
};