methods are modified
This commit is contained in:
parent
17e993955c
commit
ad97b8b550
|
@ -36,7 +36,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
|||
tokio-cron-scheduler = { version = "0" }
|
||||
uuid = { version = "0", features = ["serde", "v4", "v5"] }
|
||||
|
||||
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.95-snapshot" }
|
||||
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.81-snapshot" }
|
||||
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.96-snapshot" }
|
||||
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.82-snapshot" }
|
||||
|
||||
[build-dependencies]
|
||||
|
|
|
@ -47,7 +47,7 @@ impl Composition {
|
|||
}
|
||||
};
|
||||
|
||||
let ss_get_member_req = bpr::ss::member::GetMemberRequest {
|
||||
let ss_get_member_req = bpr::ss::member::GetMemberBRequest {
|
||||
client: Some(bpr::models::core::network::Client {
|
||||
client_ip: self
|
||||
.connection_broker
|
||||
|
@ -57,7 +57,7 @@ impl Composition {
|
|||
site_url: None,
|
||||
access_token: None,
|
||||
}),
|
||||
request: Some(bpr::ss::member::get_member_request::Request {
|
||||
request: Some(bpr::ss::member::get_member_b_request::Request {
|
||||
id: m.member_id.to_string(),
|
||||
}),
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ impl Composition {
|
|||
let ss_get_member_res_msg = self
|
||||
.connection_broker
|
||||
.request(
|
||||
bpr::ss::member::SUBJECT_GET_MEMBER,
|
||||
bpr::ss::member::SUBJECT_GET_MEMBER_B,
|
||||
ss_get_member_req.encode_to_vec(),
|
||||
)
|
||||
.await
|
||||
|
@ -77,8 +77,9 @@ impl Composition {
|
|||
})
|
||||
})?;
|
||||
|
||||
let ss_get_member_res =
|
||||
bpr::ss::member::GetMemberByUsernameResponse::decode(ss_get_member_res_msg.data.as_slice())
|
||||
let ss_get_member_res = bpr::ss::member::GetMemberBResponse::decode(
|
||||
ss_get_member_res_msg.data.as_slice(),
|
||||
)
|
||||
.map_err(|e| {
|
||||
bcr::error::rpc::Error::Server(bcr::error::rpc::Server {
|
||||
code: bpr::protobuf::rpc::Error::SERVER_00,
|
||||
|
@ -95,28 +96,24 @@ impl Composition {
|
|||
}));
|
||||
}
|
||||
|
||||
match ss_get_member_res.result {
|
||||
let mm = match ss_get_member_res.result {
|
||||
Some(r) => match r.member {
|
||||
Some(mm) => {
|
||||
return Ok(Some(models::MemberModel {
|
||||
Some(_m) => Some(models::MemberModel {
|
||||
id: m.id,
|
||||
balance: m.balance,
|
||||
balance_bota: m.balance_bota,
|
||||
balance_sum: m.balance_sum,
|
||||
companies: m.companies,
|
||||
oriental_play: m.oriental_play,
|
||||
member: mm,
|
||||
member: _m,
|
||||
created_at: m.created_at,
|
||||
updated_at: m.updated_at,
|
||||
}));
|
||||
}
|
||||
None => {
|
||||
return Ok(None);
|
||||
}
|
||||
}),
|
||||
None => None,
|
||||
},
|
||||
None => {
|
||||
return Ok(None);
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
Ok(mm)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ pub struct MemberModel {
|
|||
///
|
||||
pub oriental_play: String,
|
||||
///
|
||||
pub member: bpr::models::member::MemberModel,
|
||||
pub member: bpr::models::member::Member,
|
||||
///
|
||||
pub created_at: i64,
|
||||
///
|
||||
|
|
|
@ -96,7 +96,7 @@ impl Synchronizer {
|
|||
}
|
||||
.is_none()
|
||||
{
|
||||
let ss_get_member_by_username_req = bpr::ss::member::GetMemberByUsernameRequest {
|
||||
let ss_get_member_by_username_req = bpr::ss::member::GetMemberBByUsernameRequest {
|
||||
client: Some(bpr::models::core::network::Client {
|
||||
client_ip: self
|
||||
.connection_broker
|
||||
|
@ -106,7 +106,7 @@ impl Synchronizer {
|
|||
site_url: None,
|
||||
access_token: None,
|
||||
}),
|
||||
request: Some(bpr::ss::member::get_member_by_username_request::Request {
|
||||
request: Some(bpr::ss::member::get_member_b_by_username_request::Request {
|
||||
username: u.site_username.clone(),
|
||||
}),
|
||||
};
|
||||
|
@ -114,7 +114,7 @@ impl Synchronizer {
|
|||
let ss_get_member_by_username_res_msg = match self
|
||||
.connection_broker
|
||||
.request(
|
||||
bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME,
|
||||
bpr::ss::member::SUBJECT_GET_MEMBER_B_BY_USERNAME,
|
||||
ss_get_member_by_username_req.encode_to_vec(),
|
||||
)
|
||||
.await
|
||||
|
@ -124,7 +124,7 @@ impl Synchronizer {
|
|||
return Err(api::core::models::Error {
|
||||
code: -1,
|
||||
msg: Some(format!(
|
||||
"bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME: {}",
|
||||
"bpr::ss::member::SUBJECT_GET_MEMBER_B_BY_USERNAME: {}",
|
||||
e
|
||||
)),
|
||||
});
|
||||
|
@ -132,7 +132,7 @@ impl Synchronizer {
|
|||
};
|
||||
|
||||
let ss_get_member_by_username_res =
|
||||
match bpr::ss::member::GetMemberByUsernameResponse::decode(
|
||||
match bpr::ss::member::GetMemberBByUsernameResponse::decode(
|
||||
ss_get_member_by_username_res_msg.data.as_slice(),
|
||||
) {
|
||||
Ok(r) => r,
|
||||
|
@ -140,7 +140,7 @@ impl Synchronizer {
|
|||
return Err(api::core::models::Error {
|
||||
code: -1,
|
||||
msg: Some(format!(
|
||||
"bpr::ss::member::GetMemberByUsernameResponse: {}",
|
||||
"bpr::ss::member::GetMemberBByUsernameResponse: {}",
|
||||
e
|
||||
)),
|
||||
});
|
||||
|
@ -151,7 +151,7 @@ impl Synchronizer {
|
|||
return Err(api::core::models::Error {
|
||||
code: -1,
|
||||
msg: Some(format!(
|
||||
"bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME error: {}",
|
||||
"bpr::ss::member::SUBJECT_GET_MEMBER_B_BY_USERNAME error: {}",
|
||||
e
|
||||
)),
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user