mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 11:47:56 +08:00
35 lines
800 B
Plaintext
35 lines
800 B
Plaintext
/**
|
|
*
|
|
* [[filename]].h
|
|
*
|
|
*/
|
|
|
|
#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";%>
|
|
class [[className]] : public drogon::Plugin<[[className]]>
|
|
{
|
|
public:
|
|
[[className]]() {}
|
|
/// 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++}%> |