diff --git a/src/c2se/backend/identity.rs b/src/c2se/backend/identity.rs index 8f27cf6..c8b3a15 100644 --- a/src/c2se/backend/identity.rs +++ b/src/c2se/backend/identity.rs @@ -28,8 +28,6 @@ pub struct SigninRequest { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigninResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(string, optional, tag = "2")] - pub session_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "1")] + pub session_id: ::prost::alloc::string::String, } diff --git a/src/c2se/backend/member.rs b/src/c2se/backend/member.rs index 8f99d63..466bf76 100644 --- a/src/c2se/backend/member.rs +++ b/src/c2se/backend/member.rs @@ -1,43 +1,36 @@ -use crate::protobuf::rpc; -use crate::protobuf::pagination; use crate::models::member; +use crate::protobuf::pagination; const SUBJECT: &str = "bet.beteran.c2se.backend.member"; -pub const SUBJECT_LIST_MEMBERS: &str = - const_format::concatcp!(SUBJECT, ".ListMembers"); +pub const SUBJECT_LIST_MEMBERS: &str = const_format::concatcp!(SUBJECT, ".ListMembers"); /// subject = bet.beteran.c2se.backend.member.ListMembers #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListMembersRequest { - #[prost(message, optional, tag="1")] - pub pagination: ::core::option::Option, - #[prost(message, repeated, tag="2")] - pub searches: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="3")] - pub sorts: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub searches: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub sorts: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListMembersResponse { - #[prost(message, optional, tag="1")] - pub error: ::core::option::Option, - #[prost(message, repeated, tag="2")] - pub members: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "1")] + pub members: ::prost::alloc::vec::Vec, } -pub const SUBJECT_GET_MEMBER: &str = - const_format::concatcp!(SUBJECT, ".GetMember"); +pub const SUBJECT_GET_MEMBER: &str = const_format::concatcp!(SUBJECT, ".GetMember"); /// subject = bet.beteran.c2se.backend.member.GetMember #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetMemberRequest { - #[prost(string, tag="1")] - pub id: ::prost::alloc::string::String, + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetMemberResponse { - #[prost(message, optional, tag="1")] - pub error: ::core::option::Option, - #[prost(message, optional, tag="2")] - pub member: ::core::option::Option, + #[prost(message, optional, tag = "1")] + pub member: ::core::option::Option, } pub const SUBJECT_GET_MEMBER_BY_USERNAME: &str = @@ -45,13 +38,11 @@ pub const SUBJECT_GET_MEMBER_BY_USERNAME: &str = /// subject = bet.beteran.c2se.backend.member.GetMemberByUsername #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetMemberByUsernameRequest { - #[prost(string, tag="1")] - pub username: ::prost::alloc::string::String, + #[prost(string, tag = "1")] + pub username: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetMemberByUsernameResponse { - #[prost(message, optional, tag="1")] - pub error: ::core::option::Option, - #[prost(message, optional, tag="2")] - pub member: ::core::option::Option, + #[prost(message, optional, tag = "1")] + pub member: ::core::option::Option, } diff --git a/src/c2se/common/identity.rs b/src/c2se/common/identity.rs index d38c4d0..0b74cfe 100644 --- a/src/c2se/common/identity.rs +++ b/src/c2se/common/identity.rs @@ -10,10 +10,8 @@ pub struct CheckUsernameForDuplicationRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckUsernameForDuplicationResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(bool, optional, tag = "2")] - pub duplicated: ::core::option::Option, + #[prost(bool, tag = "1")] + pub duplicated: bool, } #[derive(Clone, PartialEq, ::prost::Message)] @@ -24,10 +22,8 @@ pub struct CheckNicknameForDuplicationRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckNicknameForDuplicationResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(bool, optional, tag = "2")] - pub duplicated: ::core::option::Option, + #[prost(bool, tag = "1")] + pub duplicated: bool, } #[derive(Clone, PartialEq, ::prost::Message)] @@ -35,10 +31,8 @@ pub struct CaptchaRequest {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptchaResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(string, optional, tag = "2")] - pub token: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "3")] - pub image: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "1")] + pub token: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub image: ::prost::alloc::string::String, } diff --git a/src/c2se/frontend/identity.rs b/src/c2se/frontend/identity.rs index 5401339..9a8e2fd 100644 --- a/src/c2se/frontend/identity.rs +++ b/src/c2se/frontend/identity.rs @@ -29,8 +29,6 @@ pub struct SigninRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigninResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(string, optional, tag = "2")] - pub session_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "1")] + pub session_id: ::prost::alloc::string::String, } diff --git a/src/protobuf/rpc.rs b/src/protobuf/rpc.rs index 2150e09..0809c09 100644 --- a/src/protobuf/rpc.rs +++ b/src/protobuf/rpc.rs @@ -15,6 +15,6 @@ impl fmt::Display for Error { f, "Error code: {}, message: {:?}, data: {:?}", self.code, self.message, self.data - ) // user-facing output + ) } } diff --git a/src/ss/member/identity.rs b/src/ss/member/identity.rs index b96624e..1dfb9b2 100644 --- a/src/ss/member/identity.rs +++ b/src/ss/member/identity.rs @@ -15,10 +15,8 @@ pub struct CheckUsernameForDuplicationRequest { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckUsernameForDuplicationResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(bool, optional, tag = "2")] - pub duplicated: ::core::option::Option, + #[prost(bool, tag = "1")] + pub duplicated: bool, } pub const SUBJECT_CHECK_NICKNAME_FOR_DUPLICATION: &str = @@ -33,10 +31,8 @@ pub struct CheckNicknameForDuplicationRequest { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckNicknameForDuplicationResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(bool, optional, tag = "2")] - pub duplicated: ::core::option::Option, + #[prost(bool, tag = "1")] + pub duplicated: bool, } pub const SUBJECT_CAPTCHA: &str = const_format::concatcp!(SUBJECT, ".Captcha"); @@ -48,12 +44,10 @@ pub struct CaptchaRequest { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptchaResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(string, optional, tag = "2")] - pub token: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "3")] - pub image: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "1")] + pub token: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub image: ::prost::alloc::string::String, } pub const SUBJECT_SIGNIN: &str = const_format::concatcp!(SUBJECT, ".Signin"); @@ -73,8 +67,6 @@ pub struct SigninRequest { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigninResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(string, optional, tag = "2")] - pub session_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "1")] + pub session_id: ::prost::alloc::string::String, }