@@ -16,7 +16,9 @@ pub struct ZChat {
16
16
pub struct ZGateway {
17
17
#[ prost( enumeration = "GatewayType" , tag = "1" ) ]
18
18
pub r#type : i32 ,
19
- #[ prost( bytes = "vec" , tag = "2" ) ]
19
+ #[ prost( enumeration = "QueryMethod" , tag = "2" ) ]
20
+ pub method : i32 ,
21
+ #[ prost( bytes = "vec" , tag = "3" ) ]
20
22
pub data : :: prost:: alloc:: vec:: Vec < u8 > ,
21
23
}
22
24
/// ZGateway.type = GATEWAY_TYPE_CLOCK_NODE
@@ -43,6 +45,30 @@ pub struct NodeInfo {
43
45
#[ prost( string, repeated, tag = "1" ) ]
44
46
pub node_ids : :: prost:: alloc:: vec:: Vec < :: prost:: alloc:: string:: String > ,
45
47
}
48
+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
49
+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
50
+ pub struct QueryResponse {
51
+ #[ prost( bool , tag = "1" ) ]
52
+ pub success : bool ,
53
+ #[ prost( string, tag = "2" ) ]
54
+ pub reason : :: prost:: alloc:: string:: String ,
55
+ #[ prost( bytes = "vec" , tag = "3" ) ]
56
+ pub data : :: prost:: alloc:: vec:: Vec < u8 > ,
57
+ }
58
+ /// ZGateway.method = QUERY_BY_MSGID
59
+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
60
+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
61
+ pub struct QueryByMsgId {
62
+ #[ prost( string, tag = "1" ) ]
63
+ pub msg_id : :: prost:: alloc:: string:: String ,
64
+ }
65
+ /// ZGateway.method = QUERY_BY_TABLE_KEYID
66
+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
67
+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
68
+ pub struct QueryByTableKeyId {
69
+ #[ prost( uint64, tag = "1" ) ]
70
+ pub last_pos : u64 ,
71
+ }
46
72
#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
47
73
#[ repr( i32 ) ]
48
74
pub enum GatewayType {
@@ -74,3 +100,29 @@ impl GatewayType {
74
100
}
75
101
}
76
102
}
103
+ #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
104
+ #[ repr( i32 ) ]
105
+ pub enum QueryMethod {
106
+ QueryByMsgid = 0 ,
107
+ QueryByTableKeyid = 1 ,
108
+ }
109
+ impl QueryMethod {
110
+ /// String value of the enum field names used in the ProtoBuf definition.
111
+ ///
112
+ /// The values are not transformed in any way and thus are considered stable
113
+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
114
+ pub fn as_str_name ( & self ) -> & ' static str {
115
+ match self {
116
+ QueryMethod :: QueryByMsgid => "QUERY_BY_MSGID" ,
117
+ QueryMethod :: QueryByTableKeyid => "QUERY_BY_TABLE_KEYID" ,
118
+ }
119
+ }
120
+ /// Creates an enum from field names used in the ProtoBuf definition.
121
+ pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
122
+ match value {
123
+ "QUERY_BY_MSGID" => Some ( Self :: QueryByMsgid ) ,
124
+ "QUERY_BY_TABLE_KEYID" => Some ( Self :: QueryByTableKeyid ) ,
125
+ _ => None ,
126
+ }
127
+ }
128
+ }
0 commit comments