drogon/examples/simple_example/api_Attachment.h

21 lines
720 B
C
Raw Normal View History

2018-09-07 09:53:37 +08:00
#pragma once
#include <drogon/HttpController.h>
2018-09-07 09:53:37 +08:00
using namespace drogon;
namespace api
{
class Attachment : public drogon::HttpController<Attachment>
2018-10-14 15:56:54 +08:00
{
2019-01-02 18:49:37 +08:00
public:
METHOD_LIST_BEGIN
//use METHOD_ADD to add your custom processing function here;
METHOD_ADD(Attachment::get, "", Get); //Path will be '/api/attachment'
METHOD_ADD(Attachment::upload, "/upload", Post);
METHOD_LIST_END
//your declaration of processing function maybe like this:
void get(const HttpRequestPtr &req,
const std::function<void(const HttpResponsePtr &)> &callback);
void upload(const HttpRequestPtr &req,
const std::function<void(const HttpResponsePtr &)> &callback);
2018-10-14 15:56:54 +08:00
};
} // namespace api