1234567891011121314151617181920212223242526272829303132 |
- #pragma once
- #include <drogon/HttpController.h>
- #include <drogon/drogon.h>
- #include "gsd_InferPlugin.h"
- #include "httpHelper.hpp"
- #include "dataTypeList.h"
- #include <utility>
- using namespace drogon;
- namespace apis
- {
- namespace v1
- {
- class check : public drogon::HttpController<check>
- {
- public:
- METHOD_LIST_BEGIN
- // use METHOD_ADD to add your custom processing function here;
- METHOD_ADD(check::getHelp, "/help", Get); // path is /apis/v1/check/{arg2}/{arg1}
- METHOD_ADD(check::postInfer, "/Infer", Post); // path is /apis/v1/check/{arg1}/{arg2}/list
- // ADD_METHOD_TO(check::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 getHelp(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback);
- void postInfer(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback);
- // void your_method_name(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, double p1, int p2) const;
- };
- }
- }
|