1234567891011121314151617181920212223242526272829303132333435 |
- /*
- * @Author: lishengyin lishengyin@sz-sunwin.com
- * @Date: 2022-09-04 20:38:06
- * @LastEditors: lishengyin lishengyin@sz-sunwin.com
- * @LastEditTime: 2022-09-04 20:39:17
- * @FilePath: /gsd_check/controllers/apis_v1_version.h
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
- #pragma once
- #include <drogon/HttpController.h>
- #include "config.hpp"
- using namespace drogon;
- namespace apis
- {
- namespace v1
- {
- class version : public drogon::HttpController<version>
- {
- public:
- METHOD_LIST_BEGIN
- // use METHOD_ADD to add your custom processing function here;
- METHOD_ADD(version::getVersion, "", Get); // path is /apis/v1/version/{arg2}/{arg1}
- // METHOD_ADD(version::your_method_name, "/{1}/{2}/list", Get); // path is /apis/v1/version/{arg1}/{arg2}/list
- // ADD_METHOD_TO(version::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 getVersion(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;
- };
- }
- }
|