update trantor

This commit is contained in:
an-tao 2018-05-11 17:39:52 +08:00
parent 72b2a60b53
commit cb08150d87
3 changed files with 12 additions and 10 deletions

View File

@ -47,7 +47,7 @@ int main()
//drogon::DrObjectBase *p=drogon::DrClassMap::newObject("HHH");
//TestController haha;
//std::cout<<haha.good()<<std::endl;
HHH hh;
std::cout<<banner<<std::endl;
drogon::HttpAppFramework::instance().setListening("0.0.0.0",12345);
trantor::Logger::setLogLevel(trantor::Logger::TRACE);

View File

@ -27,25 +27,27 @@ namespace drogon
class HttpSimpleController:public DrObject<T>,public HttpSimpleControllerBase
{
public:
HttpSimpleController(){}
virtual ~HttpSimpleController(){}
protected:
HttpSimpleController(){}
private:
//virtual std::vector<std::string> paths()=0;
class pathRegister {
public:
pathRegister(){
std::cout<<"pathRegister!!"<<HttpSimpleController<T>::classTypeName()<<std::endl;
// _register("hahaha",{std::string((char *)PATH)...});
// auto ctl= static_cast<HttpSimpleController<T>*>(new T);
pathRegister()
{
auto vPaths=T::paths();
//delete ctl;
for(auto path:vPaths)
{
LOG_DEBUG<<"register simple controller("<<HttpSimpleController<T>::classTypeName()<<") on path:"<<path;
HttpAppFramework::instance().registerHttpSimpleController(path,HttpSimpleController<T>::classTypeName());
}
}
protected:

@ -1 +1 @@
Subproject commit caf2c2b989961560dbd8fa75f09d34009c1319b3
Subproject commit 3dfefc817dc9c181ed68ced3f4eafbf7df09b9fb