🎨 moved macros

This commit is contained in:
EntireTwix 2021-06-27 17:43:17 -07:00
parent 482e8709a7
commit a4964d2742
2 changed files with 5 additions and 4 deletions

View file

@ -7,13 +7,13 @@ using namespace drogon;
#define req_args const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback #define req_args const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback
#if API_VERSION == 1
class api : public HttpController<api, false> class api : public HttpController<api, false>
{ {
Bank &bank; Bank &bank;
public: public:
api(Bank &b); api(Bank &b);
#if API_VERSION == 1
void GetBal(req_args, const std::string &name) const; void GetBal(req_args, const std::string &name) const;
void GetLog(req_args); void GetLog(req_args);
void SendFunds(req_args) const; void SendFunds(req_args) const;
@ -58,5 +58,5 @@ public:
METHOD_ADD(api::AdminDelUser, "/admin/user/{name}", Delete, Options); METHOD_ADD(api::AdminDelUser, "/admin/user/{name}", Delete, Options);
METHOD_LIST_END METHOD_LIST_END
}; #endif
#endif };

View file

@ -42,11 +42,12 @@ constexpr Json::Value JsonCast(T &&val)
} }
} }
#if API_VERSION == 1
api::api(Bank &b) : bank(b) api::api(Bank &b) : bank(b)
{ {
} }
#if API_VERSION == 1
void api::GetBal(req_args, const std::string &name) const void api::GetBal(req_args, const std::string &name) const
{ {
RESPONSE_PARSE(bank.GetBal(name)); RESPONSE_PARSE(bank.GetBal(name));