mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🔥 removed ping ⚡ transformed api version into api properties
This commit is contained in:
parent
a37742193f
commit
f6a6c23fc3
2 changed files with 16 additions and 10 deletions
|
|
@ -27,11 +27,10 @@ public:
|
|||
void SubBal(req_args) const;
|
||||
|
||||
void Help(req_args) const;
|
||||
void Ping(req_args) const;
|
||||
void Close(req_args) const;
|
||||
void Contains(req_args, const std::string &name) const;
|
||||
void AdminVerifyAccount(req_args) const;
|
||||
void ApiVersion(req_args) const;
|
||||
void ApiProperties(req_args) const;
|
||||
|
||||
void AddUser(req_args) const;
|
||||
void AdminAddUser(req_args) const;
|
||||
|
|
@ -61,7 +60,6 @@ public:
|
|||
|
||||
//System Usage
|
||||
METHOD_ADD(api::Help, "/v1/help", Get, Options);
|
||||
METHOD_ADD(api::Ping, "/v1/ping", Get, Options, "JsonFilter<false>");
|
||||
METHOD_ADD(api::Close, "/v1/admin/shutdown", Post, Options, "AdminFilter", "JsonFilter<false>");
|
||||
METHOD_ADD(api::Contains, "/v1/user/exists?name={name}", Get, Options, "JsonFilter<false>");
|
||||
METHOD_ADD(api::AdminVerifyAccount, "/v1/admin/verify_account", Post, Options, "AdminFilter", "JsonFilter<false>");
|
||||
|
|
@ -72,7 +70,7 @@ public:
|
|||
METHOD_ADD(api::DelUser, "/v1/delete", Delete, Options, "UserFilter<true>", "JsonFilter<false>");
|
||||
METHOD_ADD(api::AdminDelUser, "/v1/admin/delete", Delete, Options, "JsonFilter<true>", "AdminFilter"); //expects ["name"](string)
|
||||
#endif
|
||||
METHOD_ADD(api::ApiVersion, "/version", Get, Options);
|
||||
METHOD_ADD(api::ApiProperties, "/properties", Get, Options);
|
||||
|
||||
METHOD_LIST_END
|
||||
};
|
||||
|
|
@ -113,10 +113,6 @@ void api::Help(req_args) const
|
|||
CACHE_FOREVER;
|
||||
callback(resp);
|
||||
}
|
||||
void api::Ping(req_args) const
|
||||
{
|
||||
RESPOND_TRUE
|
||||
}
|
||||
void api::Close(req_args) const
|
||||
{
|
||||
bank.Save();
|
||||
|
|
@ -132,9 +128,21 @@ void api::AdminVerifyAccount(req_args) const
|
|||
{
|
||||
RESPOND_TRUE //filter handles admin creds
|
||||
}
|
||||
void api::ApiVersion(req_args) const
|
||||
void api::ApiProperties(req_args) const
|
||||
{
|
||||
auto resp = HttpResponse::newHttpJsonResponse(API_VERSION);
|
||||
Json::Value temp;
|
||||
temp["version"] = API_VERSION;
|
||||
temp["max_log"] = MAX_LOG_SIZE;
|
||||
temp["pre_log"] = PRE_LOG_SIZE;
|
||||
temp["min_name"] = min_name_size;
|
||||
temp["max_name"] = max_name_size;
|
||||
temp["return_on_del"] = RETURN_ON_DEL;
|
||||
if constexpr (RETURN_ON_DEL)
|
||||
{
|
||||
temp["return_on_del_acc"] = return_account;
|
||||
}
|
||||
|
||||
auto resp = HttpResponse::newHttpJsonResponse(std::move(temp));
|
||||
CACHE_FOREVER;
|
||||
callback(resp);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue