mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
✨ AdminGetLogs
This commit is contained in:
parent
370107e3f9
commit
47649d6ccd
2 changed files with 21 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ public:
|
||||||
static void GetLogs(req_args);
|
static void GetLogs(req_args);
|
||||||
#endif
|
#endif
|
||||||
static void GetLogsV2(req_args);
|
static void GetLogsV2(req_args);
|
||||||
|
static void AdminGetLogs(req_args, const std::string& name);
|
||||||
static void SendFunds(req_args);
|
static void SendFunds(req_args);
|
||||||
static void VerifyPassword(req_args);
|
static void VerifyPassword(req_args);
|
||||||
|
|
||||||
|
|
@ -43,17 +44,25 @@ public:
|
||||||
|
|
||||||
//Usage
|
//Usage
|
||||||
METHOD_ADD(api::GetBal, "/v1/user/balance?name={name}", Get, Options, "JsonFilter<false>");
|
METHOD_ADD(api::GetBal, "/v1/user/balance?name={name}", Get, Options, "JsonFilter<false>");
|
||||||
|
|
||||||
#if MAX_LOG_SIZE > 0
|
#if MAX_LOG_SIZE > 0
|
||||||
|
|
||||||
#if USE_DEPRECATED_ENDPOINTS
|
#if USE_DEPRECATED_ENDPOINTS
|
||||||
METHOD_ADD(api::GetLogs, "/v1/user/log", Get, Options, "JsonFilter<false>", "UserFilter<true, false>");
|
METHOD_ADD(api::GetLogs, "/v1/user/log", Get, Options, "JsonFilter<false>", "UserFilter<true, false>");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
METHOD_ADD(api::GetLogsV2, "/v2/user/log", Get, Options, "JsonFilter<false>", "UserFilter<true, false>");
|
METHOD_ADD(api::GetLogsV2, "/v2/user/log", Get, Options, "JsonFilter<false>", "UserFilter<true, false>");
|
||||||
|
METHOD_ADD(api::AdminGetLogs, "/v1/admin/user/log?name={name}", Get, Options, "JsonFilter<false>", "UserFilter<false, true>");
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if USE_DEPRECATED_ENDPOINTS
|
#if USE_DEPRECATED_ENDPOINTS
|
||||||
METHOD_ADD(api::GetLogs, "/v1/user/log", Get, Options, "JsonFilter<false>");
|
METHOD_ADD(api::GetLogs, "/v1/user/log", Get, Options, "JsonFilter<false>");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
METHOD_ADD(api::GetLogsV2, "/v2/user/log", Get, Options, "JsonFilter<false>");
|
METHOD_ADD(api::GetLogsV2, "/v2/user/log", Get, Options, "JsonFilter<false>");
|
||||||
|
METHOD_ADD(api::AdminGetLogs, "/v1/admin/user/log?name={name}", Get, Options, "JsonFilter<false>");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
METHOD_ADD(api::SendFunds, "/v1/user/transfer", Post, Options, "JsonFilter<true>", "UserFilter<true, false>"); //expects ["name"](string) and ["amount"](uint32)
|
METHOD_ADD(api::SendFunds, "/v1/user/transfer", Post, Options, "JsonFilter<true>", "UserFilter<true, false>"); //expects ["name"](string) and ["amount"](uint32)
|
||||||
METHOD_ADD(api::VerifyPassword, "/v1/user/verify_password", Post, Options, "UserFilter<false, false>", "JsonFilter<false>");
|
METHOD_ADD(api::VerifyPassword, "/v1/user/verify_password", Post, Options, "UserFilter<false, false>", "JsonFilter<false>");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,18 @@ void api::GetLogsV2(req_args)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void api::AdminGetLogs(req_args, const std::string& name)
|
||||||
|
{
|
||||||
|
#if MAX_LOG_SIZE > 0
|
||||||
|
RESPONSE_PARSE(Bank::GetLogsV2(name));
|
||||||
|
#else
|
||||||
|
auto resp = HttpResponse::newCustomHttpResponse(BankResponse{k404NotFound, "\"Logs are Disabled\""});
|
||||||
|
CORS;
|
||||||
|
CACHE_FOREVER;
|
||||||
|
callback(resp);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void api::SendFunds(req_args)
|
void api::SendFunds(req_args)
|
||||||
{
|
{
|
||||||
SIMD_JSON_GEN;
|
SIMD_JSON_GEN;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue