diff --git a/Cargo.toml b/Cargo.toml index 8f34009..4a4327d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ prost = { version = "0" } nats = { version = "0" } base64 = { version = "0" } -beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.20-snapshot" } -beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.0-snapshot" } +beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.23-snapshot" } +beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.3-snapshot" } [build-dependencies] diff --git a/src/identity/service.rs b/src/identity/service.rs index 7e74ae7..6b673ca 100644 --- a/src/identity/service.rs +++ b/src/identity/service.rs @@ -105,7 +105,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; @@ -115,13 +117,17 @@ impl Service { ) .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; if let Some(e) = ss_check_username_for_duplication_res.error { return Err(bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, })); } @@ -141,7 +147,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; } @@ -202,7 +210,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; @@ -212,13 +222,17 @@ impl Service { ) .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; if let Some(e) = ss_check_nickname_for_duplication_res.error { return Err(bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, })); } @@ -238,7 +252,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; } @@ -295,7 +311,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; @@ -303,13 +321,17 @@ impl Service { bpr::ss::member::identity::CaptchaResponse::decode(ss_captcha_res_msg.data.as_slice()) .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; if let Some(e) = ss_captcha_res.error { return Err(bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, })); } @@ -319,7 +341,7 @@ impl Service { bpr::c2se::common::identity::CaptchaResponse { error: None, result: Some(bpr::c2se::common::identity::captcha_response::Result { - token: r.token, + security_code_hash: r.security_code_hash, image: r.image, }), } @@ -328,7 +350,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; } @@ -374,7 +398,7 @@ impl Service { let ss_signin_req = bpr::ss::member::identity::SigninRequest { client: Some(client), - token: req.token, + security_code_hash: req.security_code_hash, security_code: req.security_code, username: req.username, password: req.password, @@ -389,7 +413,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; @@ -397,13 +423,17 @@ impl Service { bpr::ss::member::identity::SigninResponse::decode(ss_signin_res_msg.data.as_slice()) .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; if let Some(e) = ss_signin_res.error { return Err(bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, })); } @@ -421,7 +451,9 @@ impl Service { .await .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { - message: format!("server: {}", e), + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, }) })?; }