2019-03-29 15:34:14 +08:00
|
|
|
/**
|
|
|
|
*
|
2019-04-25 14:36:42 +08:00
|
|
|
* [[filename]].h
|
2019-03-29 15:34:14 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <drogon/plugins/Plugin.h>
|
|
|
|
<%c++
|
|
|
|
auto namespaceVector=@@.get<std::vector<std::string>>("namespaceVector");
|
|
|
|
if(namespaceVector.empty())
|
|
|
|
$$<<"\n";
|
|
|
|
for(auto &namespaceName:namespaceVector){%>
|
|
|
|
namespace {%namespaceName%}
|
|
|
|
|
|
|
|
{
|
|
|
|
<%c++}
|
|
|
|
$$<<"\n";%>
|
2019-05-05 15:43:17 +08:00
|
|
|
class [[className]] : public drogon::Plugin<[[className]]>
|
2019-03-29 15:34:14 +08:00
|
|
|
{
|
|
|
|
public:
|
2019-04-25 14:36:42 +08:00
|
|
|
[[className]]() {}
|
2019-03-29 15:34:14 +08:00
|
|
|
/// This method must be called by drogon to initialize and start the plugin.
|
|
|
|
/// It must be implemented by the user.
|
|
|
|
virtual void initAndStart(const Json::Value &config) override;
|
|
|
|
|
|
|
|
/// This method must be called by drogon to shutdown the plugin.
|
|
|
|
/// It must be implemented by the user.
|
|
|
|
virtual void shutdown() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
<%c++for(size_t i=0;i<namespaceVector.size();i++){%>
|
|
|
|
}
|
|
|
|
<%c++}%>
|