diff --git a/include/bank_api.h b/include/bank_api.h index 3e2c968..e348902 100644 --- a/include/bank_api.h +++ b/include/bank_api.h @@ -7,13 +7,13 @@ using namespace drogon; #define req_args const HttpRequestPtr &req, std::function &&callback -#if API_VERSION == 1 class api : public HttpController { Bank &bank; public: api(Bank &b); +#if API_VERSION == 1 void GetBal(req_args, const std::string &name) const; void GetLog(req_args); void SendFunds(req_args) const; @@ -58,5 +58,5 @@ public: METHOD_ADD(api::AdminDelUser, "/admin/user/{name}", Delete, Options); METHOD_LIST_END -}; -#endif \ No newline at end of file +#endif +}; \ No newline at end of file diff --git a/src/bank_api.cpp b/src/bank_api.cpp index d2260db..364eeba 100644 --- a/src/bank_api.cpp +++ b/src/bank_api.cpp @@ -42,11 +42,12 @@ constexpr Json::Value JsonCast(T &&val) } } -#if API_VERSION == 1 api::api(Bank &b) : bank(b) { } +#if API_VERSION == 1 + void api::GetBal(req_args, const std::string &name) const { RESPONSE_PARSE(bank.GetBal(name));