/** * * [[fileName]].cc * This file is generated by drogon_ctl * */ #include "[[fileName]].h" #include <%c++ auto tableInfo = @@.get("tableInfo"); auto modelName = tableInfo.get("className"); bool hasPrimaryKey = (tableInfo.get("hasPrimaryKey")==1); auto namespaceVector=@@.get>("namespaceVector"); std::string namespaceStr; for(auto &name:namespaceVector) { namespaceStr.append(name); namespaceStr.append("::"); } if(!namespaceStr.empty()) { namespaceStr.resize(namespaceStr.length()-2); $$<<"using namespace "<("className").length(), ' '); %> <%c++ if(hasPrimaryKey) {%> void [[className]]::getOne(const HttpRequestPtr &req, {%indentStr%} std::function &&callback, {%indentStr%} {%modelName%}::PrimaryKeyType &&id) { [[className]]Base::getOne(req, std::move(callback), std::move(id)); } void [[className]]::updateOne(const HttpRequestPtr &req, {%indentStr%} std::function &&callback, {%indentStr%} {%modelName%}::PrimaryKeyType &&id) { [[className]]Base::updateOne(req, std::move(callback), std::move(id)); } void [[className]]::deleteOne(const HttpRequestPtr &req, {%indentStr%} std::function &&callback, {%indentStr%} {%modelName%}::PrimaryKeyType &&id) { [[className]]Base::deleteOne(req, std::move(callback), std::move(id)); } <%c++}%> void [[className]]::get(const HttpRequestPtr &req, {%indentStr%} std::function &&callback) { [[className]]Base::get(req, std::move(callback)); } void [[className]]::create(const HttpRequestPtr &req, {%indentStr%} std::function &&callback) { [[className]]Base::create(req, std::move(callback)); }