apis_v1_check.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include <drogon/HttpController.h>
  3. #include <drogon/drogon.h>
  4. #include "gsd_InferPlugin.h"
  5. #include "httpHelper.hpp"
  6. #include "dataTypeList.h"
  7. #include <utility>
  8. using namespace drogon;
  9. namespace apis
  10. {
  11. namespace v1
  12. {
  13. class check : public drogon::HttpController<check>
  14. {
  15. public:
  16. METHOD_LIST_BEGIN
  17. // use METHOD_ADD to add your custom processing function here;
  18. METHOD_ADD(check::getHelp, "/help", Get); // path is /apis/v1/check/{arg2}/{arg1}
  19. METHOD_ADD(check::postInfer, "/Infer", Post); // path is /apis/v1/check/{arg1}/{arg2}/list
  20. // ADD_METHOD_TO(check::your_method_name, "/absolute/path/{1}/{2}/list", Get); // path is /absolute/path/{arg1}/{arg2}/list
  21. METHOD_LIST_END
  22. // your declaration of processing function maybe like this:
  23. void getHelp(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback);
  24. void postInfer(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback);
  25. // void your_method_name(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, double p1, int p2) const;
  26. };
  27. }
  28. }