apis_v1_version.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * @Author: lishengyin lishengyin@sz-sunwin.com
  3. * @Date: 2022-09-04 20:38:06
  4. * @LastEditors: lishengyin lishengyin@sz-sunwin.com
  5. * @LastEditTime: 2022-09-04 20:39:17
  6. * @FilePath: /gsd_check/controllers/apis_v1_version.h
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. #pragma once
  10. #include <drogon/HttpController.h>
  11. #include "config.hpp"
  12. using namespace drogon;
  13. namespace apis
  14. {
  15. namespace v1
  16. {
  17. class version : public drogon::HttpController<version>
  18. {
  19. public:
  20. METHOD_LIST_BEGIN
  21. // use METHOD_ADD to add your custom processing function here;
  22. METHOD_ADD(version::getVersion, "", Get); // path is /apis/v1/version/{arg2}/{arg1}
  23. // METHOD_ADD(version::your_method_name, "/{1}/{2}/list", Get); // path is /apis/v1/version/{arg1}/{arg2}/list
  24. // ADD_METHOD_TO(version::your_method_name, "/absolute/path/{1}/{2}/list", Get); // path is /absolute/path/{arg1}/{arg2}/list
  25. METHOD_LIST_END
  26. // your declaration of processing function maybe like this:
  27. void getVersion(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback);
  28. // void your_method_name(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, double p1, int p2) const;
  29. };
  30. }
  31. }