Format code

This commit is contained in:
antao 2018-08-27 18:19:04 +08:00
parent 8788d0359d
commit a314404e89
4 changed files with 9 additions and 9 deletions

View File

@ -7,12 +7,12 @@ namespace example{
public: public:
virtual void asyncHandleHttpRequest(const HttpRequestPtr& req,const std::function<void (const HttpResponsePtr &)>&callback)override; virtual void asyncHandleHttpRequest(const HttpRequestPtr& req,const std::function<void (const HttpResponsePtr &)>&callback)override;
PATH_LIST_BEGIN PATH_LIST_BEGIN
//list path definations here; //list path definations here;
//PATH_ADD("/path","filter1","filter2",...); //PATH_ADD("/path","filter1","filter2",...);
PATH_ADD("/"); PATH_ADD("/");
PATH_ADD("/Test","nonFilter"); PATH_ADD("/Test","nonFilter");
PATH_ADD("/tpost","drogon::PostFilter"); PATH_ADD("/tpost","drogon::PostFilter");
PATH_ADD("/slow","TimeFilter"); PATH_ADD("/slow","TimeFilter");
PATH_LIST_END PATH_LIST_END
}; };
} }

View File

@ -10,7 +10,7 @@ namespace example
std::string &&)override; std::string &&)override;
virtual void handleConnectionClosed(const WebSocketConnectionPtr&)override; virtual void handleConnectionClosed(const WebSocketConnectionPtr&)override;
virtual void handleNewConnection(const HttpRequestPtr &,const WebSocketConnectionPtr&)override; virtual void handleNewConnection(const HttpRequestPtr &,const WebSocketConnectionPtr&)override;
WS_PATH_LIST_BEGIN WS_PATH_LIST_BEGIN
//list path definations here; //list path definations here;
WS_PATH_ADD("/chat"); WS_PATH_ADD("/chat");
WS_PATH_LIST_END WS_PATH_LIST_END

View File

@ -20,7 +20,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#define PATH_LIST_BEGIN public:\ #define PATH_LIST_BEGIN \
static std::vector<std::pair<std::string,std::vector<std::string>>> paths() \ static std::vector<std::pair<std::string,std::vector<std::string>>> paths() \
{\ {\
std::vector<std::pair<std::string,std::vector<std::string>>> vet; std::vector<std::pair<std::string,std::vector<std::string>>> vet;

View File

@ -23,7 +23,7 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#define WS_PATH_LIST_BEGIN public:\ #define WS_PATH_LIST_BEGIN \
static std::vector<std::pair<std::string,std::vector<std::string>>> paths() \ static std::vector<std::pair<std::string,std::vector<std::string>>> paths() \
{\ {\
std::vector<std::pair<std::string,std::vector<std::string>>> vet; std::vector<std::pair<std::string,std::vector<std::string>>> vet;