/** * * httpHelper.h * */ #pragma once #include #include using namespace drogon; class httpHelper : public drogon::Plugin { public: httpHelper() {} /// 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; /** * @description: 构建错误回复 * @param {string} data * @return {*} */ HttpResponsePtr makeWrongReply(std::string data); /** * @description: 应答回复 * @param {pair} result * @return {*} */ HttpResponsePtr replyRequest(std::pair result, const HttpMethod method); };