mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
🎨 made vpass and admin/vpass POST
This commit is contained in:
parent
29044d697c
commit
ea35a04b66
2 changed files with 10 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
#include <drogon/HttpController.h>
|
||||
#include <drogon/lib/src/HttpResponseImpl.h>
|
||||
#include "json_filter.h"
|
||||
#include "admin_filter.h"
|
||||
#include "user_filter.h"
|
||||
|
|
@ -49,7 +48,7 @@ public:
|
|||
METHOD_ADD(api::GetLog, "/v1/user/log", Get, Options);
|
||||
#endif
|
||||
METHOD_ADD(api::SendFunds, "/v1/user/transfer", Post, Options, "JsonFilter", "UserFilter"); //expects ["to"](string) and ["amount"](32 bits)
|
||||
METHOD_ADD(api::VerifyPassword, "/v1/user/verify_password", Get, Options, "UserFilter");
|
||||
METHOD_ADD(api::VerifyPassword, "/v1/user/verify_password", Post, Options, "UserFilter");
|
||||
|
||||
//Meta Usage
|
||||
METHOD_ADD(api::ChangePassword, "/v1/user/change_password", Patch, Options, "JsonFilter", "UserFilter"); //expects ["new_pass"](string)
|
||||
|
|
@ -61,7 +60,7 @@ public:
|
|||
METHOD_ADD(api::Ping, "/v1/ping", Get, Options);
|
||||
METHOD_ADD(api::Close, "/v1/admin/shutdown", Post, Options, "AdminFilter");
|
||||
METHOD_ADD(api::Contains, "/v1/user/exists?name={name}", Get, Options);
|
||||
METHOD_ADD(api::AdminVerifyAccount, "/v1/admin/verify_account", Get, Options, "AdminFilter");
|
||||
METHOD_ADD(api::AdminVerifyAccount, "/v1/admin/verify_account", Post, Options, "AdminFilter");
|
||||
|
||||
//User Managment
|
||||
METHOD_ADD(api::AddUser, "/v1/user/register", Post, Options, "JsonFilter"); //expects ["name"](string) ["pass"](string)
|
||||
|
|
@ -69,7 +68,7 @@ public:
|
|||
METHOD_ADD(api::DelUser, "/v1/delete", Delete, Options, "UserFilter");
|
||||
METHOD_ADD(api::AdminDelUser, "/v1/admin/delete", Delete, Options, "JsonFilter", "AdminFilter"); //expects ["name"](string)
|
||||
#endif
|
||||
METHOD_ADD(api::ApiVersion, "/version");
|
||||
METHOD_ADD(api::ApiVersion, "/version", Get, Options);
|
||||
|
||||
METHOD_LIST_END
|
||||
};
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
#include "bank_api.h"
|
||||
|
||||
// const auto data(R); \
|
||||
// auto res = std::make_shared<HttpResponseImpl>(data.first, CT_APPLICATION_JSON); \
|
||||
// res->setJsonObject(JsonCast(std::move(data.second))); \
|
||||
// doResponseCreateAdvices(res); \
|
||||
// callback(res);
|
||||
|
||||
#define CACHE_FOREVER resp->setExpiredTime(0);
|
||||
#define GEN_BODY \
|
||||
const auto temp_req = req->getJsonObject(); \
|
||||
|
|
@ -21,6 +27,7 @@
|
|||
template <typename T>
|
||||
constexpr Json::Value JsonCast(T &&val)
|
||||
{
|
||||
|
||||
if constexpr (std::is_same_v<T, int_fast8_t>)
|
||||
{
|
||||
return (int)val; //becuase of json lib interpreting 67 as 'A' for example
|
||||
|
|
|
|||
Loading…
Reference in a new issue