mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 12:37:08 +11:00
✨ API Version Endpoint
This commit is contained in:
parent
5fe22d8635
commit
f3c3c47e73
2 changed files with 9 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ public:
|
|||
void Close(req_args) const;
|
||||
void Contains(req_args, const std::string &name) const;
|
||||
void AdminVerifyAccount(req_args);
|
||||
void ApiVersion(req_args) const;
|
||||
|
||||
void AddUser(req_args) const;
|
||||
void AdminAddUser(req_args) const;
|
||||
|
|
@ -66,6 +67,7 @@ public:
|
|||
METHOD_ADD(api::DelUser, "/v1/delete", Delete, Options, "UserFilter");
|
||||
METHOD_ADD(api::AdminDelUser, "/v1/admin/delete", Delete, Options, "AdminFilter"); //expects ["name"](string)
|
||||
#endif
|
||||
METHOD_ADD(api::ApiVersion, "/version");
|
||||
|
||||
METHOD_LIST_END
|
||||
};
|
||||
|
|
@ -124,6 +124,13 @@ void api::AdminVerifyAccount(req_args)
|
|||
{
|
||||
RESPOND_TRUE //filter handles admin creds
|
||||
}
|
||||
void api::ApiVersion(req_args) const
|
||||
{
|
||||
auto resp = HttpResponse::newHttpJsonResponse(API_VERSION);
|
||||
resp->setStatusCode(k200OK);
|
||||
resp->setExpiredTime(0); //cached forever
|
||||
callback(resp);
|
||||
}
|
||||
|
||||
void api::AddUser(req_args) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue