Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
login_plugin.cpp File Reference
Include dependency graph for login_plugin.cpp:

Go to the source code of this file.

Classes

struct  sysio::login_request
 
struct  sysio::login_request_pub_key_index
 
struct  sysio::login_request_time_index
 
class  sysio::login_plugin_impl
 

Namespaces

namespace  sysio
 

Macros

#define CALL(call_name, http_response_code)
 

Typedefs

using sysio::login_request_container
 

Macro Definition Documentation

◆ CALL

#define CALL ( call_name,
http_response_code )
Value:
{ \
std::string("/v1/login/" #call_name), [this](string, string body, url_response_callback cb) mutable { \
try { \
if (body.empty()) \
body = "{}"; \
fc::variant result( call_name(fc::json::from_string(body).as<login_plugin::call_name##_params>()) ); \
cb(http_response_code, std::move(result)); \
} catch (...) { \
http_plugin::handle_exception("login", #call_name, body, cb); \
} \
} \
}
static variant from_string(const string &utf8_str, const parse_type ptype=parse_type::legacy_parser, uint32_t max_depth=DEFAULT_MAX_RECURSION_DEPTH)
Definition json.cpp:442
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191

Definition at line 61 of file login_plugin.cpp.

61#define CALL(call_name, http_response_code) \
62 { \
63 std::string("/v1/login/" #call_name), [this](string, string body, url_response_callback cb) mutable { \
64 try { \
65 if (body.empty()) \
66 body = "{}"; \
67 fc::variant result( call_name(fc::json::from_string(body).as<login_plugin::call_name##_params>()) ); \
68 cb(http_response_code, std::move(result)); \
69 } catch (...) { \
70 http_plugin::handle_exception("login", #call_name, body, cb); \
71 } \
72 } \
73 }