mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 11:47:56 +08:00
21 lines
657 B
C++
21 lines
657 B
C++
#pragma once
|
|
#include <drogon/HttpApiController.h>
|
|
using namespace drogon;
|
|
namespace api
|
|
{
|
|
class Attachment : public drogon::HttpApiController<Attachment>
|
|
{
|
|
public:
|
|
METHOD_LIST_BEGIN
|
|
//use METHOD_ADD to add your custom processing function here;
|
|
METHOD_ADD(Attachment::get, "", Post); //Path will be '/api/attachment'
|
|
|
|
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);
|
|
};
|
|
} // namespace api
|