forked from skyfireitdiy/sflib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsf_rpc_utils.h
44 lines (36 loc) · 926 Bytes
/
sf_rpc_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @version 1.0.0
* @author skyfire
* @mail [email protected]
* @see http://github.com/skyfireitdiy/sflib
* @file sf_rpc_utils.h
* sflib第一版本发布
* 版本号1.0.0
* 发布日期:2018-10-22
*/
#pragma once
#include "sf_serialize_binary.hpp"
#include "sf_type.h"
#include <string>
namespace skyfire
{
/**
* @brief rpc请求上下文
*/
struct sf_rpc_req_context_t
{
int call_id; // 调用id
std::string func_id; // 函数id
byte_array params; // 参数
};
SF_MAKE_SERIALIZABLE_BINARY(sf_rpc_req_context_t, call_id, func_id, params)
/**
* @brief rpc响应上下文
*/
struct sf_rpc_res_context_t
{
int call_id; // 调用id
byte_array ret; // 返回值
};
SF_MAKE_SERIALIZABLE_BINARY(sf_rpc_res_context_t, call_id, ret)
}