#pragma once #include #include #include "gsd_InferPlugin.h" #include "httpHelper.hpp" #include "dataTypeList.h" #include using namespace drogon; namespace apis { namespace v1 { class classify : public drogon::HttpController { public: METHOD_LIST_BEGIN // use METHOD_ADD to add your custom processing function here; METHOD_ADD(classify::get, "", Get); // path is /apis/v1/classify METHOD_ADD(classify::PostAnimal, "/animal?result={1}", Post); // path is /apis/v1/classify/{arg1}/{arg2}/list METHOD_ADD(classify::PostPersion, "/persion?result={1}", Post); // ADD_METHOD_TO(classify::your_method_name, "/absolute/path/{1}/{2}/list", Get); // path is /absolute/path/{arg1}/{arg2}/list METHOD_LIST_END // your declaration of processing function maybe like this: void get(const HttpRequestPtr& req, std::function &&callback); /** * @description: PostAnimal * @param {const} HttpRequestPtr * @param {function} & * @param {int} result * @return {*} */ void PostAnimal(const HttpRequestPtr& req, std::function &&callback, int result); /** * @description: PostPersion * @param {const} HttpRequestPtr * @param {function} & * @param {int} result * @return {*} */ void PostPersion(const HttpRequestPtr& req, std::function &&callback, int result); // void your_method_name(const HttpRequestPtr& req, std::function &&callback, double p1, int p2) const; }; } }