From 01725dc14e93a410ba7126911904f90e73984992 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 9 Dec 2021 19:14:36 +0800 Subject: [PATCH] 1 --- .gitmodules | 3 +++ server/analyseapi/proto/mt.proto | 1 + server/notifyserver/Cargo.toml | 4 ++++ server/notifyserver/src/main.rs | 27 +++++++++++++++++++++++++-- third_party/r9 | 1 + 5 files changed, 34 insertions(+), 2 deletions(-) create mode 160000 third_party/r9 diff --git a/.gitmodules b/.gitmodules index 404c4dc..b8031dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "third_party/q7"] path = third_party/q7 url = git@git.kingsome.cn:server_common/q7.git +[submodule "third_party/r9"] + path = third_party/r9 + url = git@git.kingsome.cn:server_common/r9.git diff --git a/server/analyseapi/proto/mt.proto b/server/analyseapi/proto/mt.proto index e6b49aa..30cc3d0 100644 --- a/server/analyseapi/proto/mt.proto +++ b/server/analyseapi/proto/mt.proto @@ -4,6 +4,7 @@ option go_package = ".;mt"; message AliKeyConf { + optional int32 value = 3; optional string access_keyid = 1; optional string access_secret = 2; } diff --git a/server/notifyserver/Cargo.toml b/server/notifyserver/Cargo.toml index a1165c7..0ae7870 100644 --- a/server/notifyserver/Cargo.toml +++ b/server/notifyserver/Cargo.toml @@ -6,3 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +protobuf = "2.25.2" + +[build-dependencies] +protobuf-codegen-pure = "2.25.2" \ No newline at end of file diff --git a/server/notifyserver/src/main.rs b/server/notifyserver/src/main.rs index e7a11a9..42e2806 100644 --- a/server/notifyserver/src/main.rs +++ b/server/notifyserver/src/main.rs @@ -1,3 +1,26 @@ -fn main() { - println!("Hello, world!"); +mod mt; + +use protobuf::Message; + +pub struct Test { + intVal: i64, +} + +pub struct XValue { + intVal: i64, + testVal: <'a> ::Test, +// pub data: &'static dyn std::any::Any, +} + +impl XValue { +} + +fn main() { + let mut msg = mt::AliKeyConf::new(); + let mut testVal = Test{intVal:100}; + let mut val = XValue{intVal: 0, + testVal: testVal}; + //let keyid = "abcf"; + msg.set_access_keyid("abcdf".to_string()); + println!("Hello, world!{}", msg.get_access_keyid()); } diff --git a/third_party/r9 b/third_party/r9 new file mode 160000 index 0000000..0da572a --- /dev/null +++ b/third_party/r9 @@ -0,0 +1 @@ +Subproject commit 0da572a5fa5e45f1343529f8e04b722182b0b01f