From 8616b0b9b1741e80efd750575e86f901b2b3fe96 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Wed, 13 Jul 2022 08:44:58 +0000 Subject: [PATCH] ss-member-identity is added --- src/c2se/frontend/identity.rs | 24 +++-- src/lib.rs | 5 +- src/ss/event_message_attach_files.rs | 48 --------- src/ss/event_messages.rs | 65 ------------- src/ss/member/identity.rs | 22 +++++ src/ss/member/mod.rs | 1 + src/ss/message_attach_files.rs | 79 --------------- src/ss/messages.rs | 140 --------------------------- src/ss/mod.rs | 18 +--- 9 files changed, 36 insertions(+), 366 deletions(-) delete mode 100644 src/ss/event_message_attach_files.rs delete mode 100644 src/ss/event_messages.rs create mode 100644 src/ss/member/identity.rs create mode 100644 src/ss/member/mod.rs delete mode 100644 src/ss/message_attach_files.rs delete mode 100644 src/ss/messages.rs diff --git a/src/c2se/frontend/identity.rs b/src/c2se/frontend/identity.rs index f409ecc..9b8dc49 100644 --- a/src/c2se/frontend/identity.rs +++ b/src/c2se/frontend/identity.rs @@ -1,24 +1,22 @@ use crate::protobuf::rpc; - const SUBJECT: &str = "bet.beteran.c2se.frontend.identity"; -pub const SUBJECT_SIGNIN: &str = - const_format::concatcp!(SUBJECT, ".Signin"); +pub const SUBJECT_SIGNIN: &str = const_format::concatcp!(SUBJECT, ".Signin"); /// subject = bet.beteran.c2se.frontend.identity.Signin #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigninRequest { - #[prost(string, tag="1")] - pub username: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub password: ::prost::alloc::string::String, - #[prost(string, tag="3")] - pub security_code: ::prost::alloc::string::String, + #[prost(string, tag = "1")] + pub username: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub password: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub security_code: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigninResponse { - #[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(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(string, optional, tag = "2")] + pub token: ::core::option::Option<::prost::alloc::string::String>, } diff --git a/src/lib.rs b/src/lib.rs index 2d1ada5..71d926e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,11 +5,8 @@ #![deny(missing_debug_implementations)] #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] +pub mod c2se; pub mod models; pub mod protobuf; -pub mod c2se; pub mod se2c; pub mod ss; - - - diff --git a/src/ss/event_message_attach_files.rs b/src/ss/event_message_attach_files.rs deleted file mode 100644 index c5f88ea..0000000 --- a/src/ss/event_message_attach_files.rs +++ /dev/null @@ -1,48 +0,0 @@ -use bemily_commons_protobuf_rust::protobuf::bemily::protobuf as bcprpbp; - -pub const SUBJECT: &str = "bemily.messenger.chat.messages.ss.event.messages"; - -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MessageAttachFile { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub message_id: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub file_id: ::prost::alloc::string::String, - #[prost(enumeration = "MessageAttachFileType", tag = "5")] - pub attach_file_type: i32, - #[prost(uint64, tag = "6")] - pub created_at: u64, - #[prost(uint64, tag = "7")] - pub updated_at: u64, - #[prost(uint64, optional, tag = "8")] - pub deleted_at: ::core::option::Option, - #[prost(enumeration = "bcprpbp::event::change::ChangeEventType", tag = "9")] - pub change_type: i32, -} - -pub const SUBJECT_CHANGE: &str = const_format::concatcp!(SUBJECT, ".Change"); -/// subject = bemily.messenger.chat.messages.ss.event.message_attach_files.Change; -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeEvent { - #[prost(string, repeated, tag = "1")] - pub identity_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, tag = "2")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub message_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "4")] - pub message_attach_files: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum MessageAttachFileType { - None = 0, - Image = 1, - Video = 2, - Sound = 3, - File = 4, -} diff --git a/src/ss/event_messages.rs b/src/ss/event_messages.rs deleted file mode 100644 index 971ebc0..0000000 --- a/src/ss/event_messages.rs +++ /dev/null @@ -1,65 +0,0 @@ -use bemily_commons_protobuf_rust::protobuf::bemily::protobuf as bcprpbp; - -pub const SUBJECT: &str = "bemily.messenger.chat.messages.ss.event.messages"; - -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Message { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, optional, tag = "3")] - pub sender_id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "MessageType", tag = "4")] - pub message_type: i32, - #[prost(string, tag = "5")] - pub message: ::prost::alloc::string::String, - #[prost(uint64, tag = "6")] - pub seq: u64, - #[prost(uint64, tag = "7")] - pub created_at: u64, - #[prost(uint64, tag = "8")] - pub updated_at: u64, - #[prost(uint64, optional, tag = "9")] - pub deleted_at: ::core::option::Option, - #[prost(enumeration = "bcprpbp::event::change::ChangeEventType", tag = "10")] - pub change_type: i32, -} - -pub const SUBJECT_CHANGE: &str = const_format::concatcp!(SUBJECT, ".Change"); -/// subject = bemily.messenger.chat.messages.ss.event.messages.Change; -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeEvent { - #[prost(string, repeated, tag = "1")] - pub identity_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub message: ::core::option::Option, -} - -pub const SUBJECT_CHANGE_MESSAGE: &str = const_format::concatcp!(SUBJECT, ".ChangeMessage"); -/// subject = bemily.messenger.chat.messages.ss.event.messages.ChangeMessage; -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeMessageEvent { - #[prost(string, tag = "1")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub message_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub message: ::prost::alloc::string::String, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum MessageType { - None = 0, - Normal = 1, - Mass = 2, - Image = 3, - Video = 4, - Sound = 5, - File = 6, - Emoticon = 7, - Smileme = 8, - Plan = 9, - Combination = 10, - Information = 11, -} diff --git a/src/ss/member/identity.rs b/src/ss/member/identity.rs new file mode 100644 index 0000000..370ec70 --- /dev/null +++ b/src/ss/member/identity.rs @@ -0,0 +1,22 @@ +use crate::protobuf::rpc; + +const SUBJECT: &str = "bet.beteran.ss.member.identity"; + +pub const SUBJECT_SIGNIN: &str = const_format::concatcp!(SUBJECT, ".Signin"); +/// subject = bet.beteran.ss.member.identity.Signin +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SigninRequest { + #[prost(string, tag = "1")] + pub username: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub password: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub security_code: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SigninResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(string, optional, tag = "2")] + pub token: ::core::option::Option<::prost::alloc::string::String>, +} diff --git a/src/ss/member/mod.rs b/src/ss/member/mod.rs new file mode 100644 index 0000000..db53a0c --- /dev/null +++ b/src/ss/member/mod.rs @@ -0,0 +1 @@ +pub mod identity; diff --git a/src/ss/message_attach_files.rs b/src/ss/message_attach_files.rs deleted file mode 100644 index dd4e659..0000000 --- a/src/ss/message_attach_files.rs +++ /dev/null @@ -1,79 +0,0 @@ -use bemily_commons_protobuf_rust::protobuf::bemily::protobuf as bcprpbp; - -pub const SUBJECT: &str = "bemily.messenger.chat.messages.ss.message_attach_files"; - -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MessageAttachFile { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub message_id: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub file_id: ::prost::alloc::string::String, - #[prost(enumeration = "MessageAttachFileType", tag = "5")] - pub attach_file_type: i32, - #[prost(uint64, tag = "6")] - pub created_at: u64, - #[prost(uint64, tag = "7")] - pub updated_at: u64, - #[prost(uint64, optional, tag = "8")] - pub deleted_at: ::core::option::Option, -} - -pub const SUBJECT_LIST_BY_MESSAGE_ID: &str = const_format::concatcp!(SUBJECT, ".ListByMessageId"); -/// subject = bemily.messenger.chat.messages.ss.message_attach_files.ListByMessageId -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListByMessageIdRequest { - #[prost(string, tag = "1")] - pub message_id: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListByMessageIdResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub message_attach_files: ::prost::alloc::vec::Vec, -} - -pub const SUBJECT_DELETE: &str = const_format::concatcp!(SUBJECT, ".Delete"); -/// subject = bemily.messenger.chat.messages.ss.message_attach_files.Delete -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRequest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, -} - -pub const SUBJECT_SYNCHRONIZE: &str = const_format::concatcp!(SUBJECT, ".Synchronize"); -/// subject = bemily.messenger.chat.messages.ss.message_attach_files.Synchronize -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SynchronizeRequest { - #[prost(string, tag = "1")] - pub identity_id: ::prost::alloc::string::String, - #[prost(uint64, optional, tag = "2")] - pub synchronized_at: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SynchronizeResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(uint64, optional, tag = "2")] - pub synchronized_at: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub message_attach_files: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum MessageAttachFileType { - None = 0, - Image = 1, - Video = 2, - Sound = 3, - File = 4, -} diff --git a/src/ss/messages.rs b/src/ss/messages.rs deleted file mode 100644 index 3acb644..0000000 --- a/src/ss/messages.rs +++ /dev/null @@ -1,140 +0,0 @@ -use bemily_commons_protobuf_rust::protobuf::bemily::protobuf as bcprpbp; - -pub const SUBJECT: &str = "bemily.messenger.chat.messages.ss.messages"; - -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Message { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, optional, tag = "3")] - pub sender_id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "MessageType", tag = "4")] - pub message_type: i32, - #[prost(string, tag = "5")] - pub message: ::prost::alloc::string::String, - #[prost(uint64, tag = "6")] - pub seq: u64, - #[prost(uint64, tag = "7")] - pub created_at: u64, - #[prost(uint64, tag = "8")] - pub updated_at: u64, - #[prost(uint64, optional, tag = "9")] - pub deleted_at: ::core::option::Option, -} - -pub const SUBJECT_GET: &str = const_format::concatcp!(SUBJECT, ".Get"); -/// subject = bemily.messenger.chat.messages.ss.messages.Get -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetRequest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub message: ::core::option::Option, -} - -pub const SUBJECT_LIST_BY_IDS: &str = const_format::concatcp!(SUBJECT, ".ListByIds"); -/// subject = bemily.messenger.chat.messages.ss.messages.ListByIds -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListByIdsRequest { - #[prost(string, repeated, tag = "1")] - pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListByIdsResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub messages: ::prost::alloc::vec::Vec, -} - -pub const SUBJECT_CREATE: &str = const_format::concatcp!(SUBJECT, ".Create"); -/// subject = bemily.messenger.chat.messages.ss.messages.Create -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRequest { - #[prost(string, tag = "1")] - pub room_id: ::prost::alloc::string::String, - #[prost(string, optional, tag = "2")] - pub sender_id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "MessageType", tag = "3")] - pub message_type: i32, - #[prost(string, tag = "4")] - pub message: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub message: ::core::option::Option, -} - -pub const SUBJECT_CHANGE_MESSAGE: &str = const_format::concatcp!(SUBJECT, ".ChangeMessage"); -/// subject = bemily.messenger.chat.messages.ss.messages.ChangeMessage -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeMessageRequest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeMessageResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, -} - -pub const SUBJECT_DELETE: &str = const_format::concatcp!(SUBJECT, ".Delete"); -/// subject = bemily.messenger.chat.messages.ss.messages.Delete -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRequest { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, -} - -pub const SUBJECT_SYNCHRONIZE: &str = const_format::concatcp!(SUBJECT, ".Synchronize"); -/// subject = bemily.messenger.chat.messages.ss.messages.Synchronize -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SynchronizeRequest { - #[prost(string, tag = "1")] - pub identity_id: ::prost::alloc::string::String, - #[prost(uint64, optional, tag = "2")] - pub synchronized_at: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SynchronizeResponse { - #[prost(message, optional, tag = "1")] - pub error: ::core::option::Option, - #[prost(uint64, optional, tag = "2")] - pub synchronized_at: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub messages: ::prost::alloc::vec::Vec, -} - -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum MessageType { - None = 0, - Normal = 1, - Mass = 2, - Image = 3, - Video = 4, - Sound = 5, - File = 6, - Emoticon = 7, - Smileme = 8, - Plan = 9, - Combination = 10, - Information = 11, -} diff --git a/src/ss/mod.rs b/src/ss/mod.rs index 9f9b345..9652b86 100644 --- a/src/ss/mod.rs +++ b/src/ss/mod.rs @@ -3,20 +3,4 @@ /// /// -#[cfg(feature = "ss_messages")] -pub mod messages; - -/// -/// -#[cfg(feature = "ss_message_attach_files")] -pub mod message_attach_files; - -/// -/// -#[cfg(feature = "ss_event_messages")] -pub mod event_messages; - -/// -/// -#[cfg(feature = "ss_event_message_attach_files")] -pub mod event_message_attach_files; +pub mod member;