From cc13112acc2eb0ea775c3e2ed85997b6ab0da924 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Thu, 11 Aug 2022 01:04:13 +0000 Subject: [PATCH] refactoring --- src/c2se/backend/member.rs | 27 ++++++++- src/c2se/backend/site.rs | 12 ++++ src/models/member.rs | 109 ++++++++++++++++++++++++------------- src/ss/domain/site.rs | 12 ++++ src/ss/member/member.rs | 27 ++++++++- 5 files changed, 143 insertions(+), 44 deletions(-) diff --git a/src/c2se/backend/member.rs b/src/c2se/backend/member.rs index 45f78d4..285c07b 100644 --- a/src/c2se/backend/member.rs +++ b/src/c2se/backend/member.rs @@ -1,5 +1,6 @@ use crate::protobuf::pagination; use crate::protobuf::rpc; +use crate::models::member; const SUBJECT: &str = "bet.beteran.c2se.backend.member"; @@ -13,6 +14,26 @@ pub struct ListMembersRequest { pub searches: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] pub sorts: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag="4")] + pub site_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="5")] + pub member_class_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="6")] + pub member_level_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="7")] + pub referrer_member_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="8")] + pub username_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="9")] + pub nickname_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="10")] + pub mobile_phone_number_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="11")] + pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration="member::MemberState", optional, tag="12")] + pub state: ::core::option::Option, + #[prost(uint64, optional, tag="13")] + pub deleted_at: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListMembersResponse { @@ -28,7 +49,7 @@ pub mod list_members_response { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, repeated, tag = "1")] - pub members: ::prost::alloc::vec::Vec, + pub members: ::prost::alloc::vec::Vec, } } pub const SUBJECT_GET_MEMBER: &str = const_format::concatcp!(SUBJECT, ".GetMember"); @@ -51,7 +72,7 @@ pub mod get_member_response { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, optional, tag = "1")] - pub member: ::core::option::Option, + pub member: ::core::option::Option, } } pub const SUBJECT_GET_MEMBER_BY_USERNAME: &str = @@ -75,6 +96,6 @@ pub mod get_member_by_username_response { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, optional, tag = "1")] - pub member: ::core::option::Option, + pub member: ::core::option::Option, } } diff --git a/src/c2se/backend/site.rs b/src/c2se/backend/site.rs index 716b17a..f01847e 100644 --- a/src/c2se/backend/site.rs +++ b/src/c2se/backend/site.rs @@ -13,6 +13,18 @@ pub struct ListSitesRequest { pub searches: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] pub sorts: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag="4")] + pub url_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="5")] + pub name_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="6")] + pub path_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(bool, optional, tag="7")] + pub show: ::core::option::Option, + #[prost(bool, optional, tag="8")] + pub can_use: ::core::option::Option, + #[prost(string, optional, tag="9")] + pub memo_like: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListSitesResponse { diff --git a/src/models/member.rs b/src/models/member.rs index dcf8a69..a40a368 100644 --- a/src/models/member.rs +++ b/src/models/member.rs @@ -1,11 +1,9 @@ -use crate::models::domain; - #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemberClass { #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, - #[prost(message, optional, boxed, tag = "2")] - pub parent: ::core::option::Option<::prost::alloc::boxed::Box>, + #[prost(string, optional, tag="2")] + pub parent_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(string, tag = "3")] pub name: ::prost::alloc::string::String, #[prost(uint64, tag = "4")] @@ -21,8 +19,8 @@ pub struct MemberLevel { pub id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, - #[prost(uint32, tag = "3")] - pub order: u32, + #[prost(uint32, tag="3")] + pub sort_order: u32, #[prost(uint64, tag = "4")] pub created_at: u64, #[prost(uint64, tag = "5")] @@ -32,38 +30,73 @@ pub struct MemberLevel { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Member { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub site: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub member_class: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub member_level: ::core::option::Option, - #[prost(message, optional, boxed, tag = "5")] - pub referrer_member: ::core::option::Option<::prost::alloc::boxed::Box>, - #[prost(uint64, tag = "6")] - pub referred_count: u64, - #[prost(string, tag = "7")] - pub username: ::prost::alloc::string::String, - #[prost(string, tag = "8")] - pub nickname: ::prost::alloc::string::String, - #[prost(string, optional, tag = "9")] - pub mobile_phone_number: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "MemberState", tag = "10")] - pub state: i32, - #[prost(uint64, optional, tag = "11")] - pub state_changed_at: ::core::option::Option, - #[prost(string, optional, tag = "12")] - pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, - #[prost(uint64, optional, tag = "13")] - pub last_signined_at: ::core::option::Option, - #[prost(uint64, tag = "14")] - pub created_at: u64, - #[prost(uint64, tag = "15")] - pub updated_at: u64, - #[prost(uint64, optional, tag = "16")] - pub deleted_at: ::core::option::Option, + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub site_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub member_class_id: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub member_level_id: ::prost::alloc::string::String, + #[prost(string, optional, tag="5")] + pub referrer_member_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(uint64, tag="6")] + pub referred_count: u64, + #[prost(string, tag="7")] + pub username: ::prost::alloc::string::String, + #[prost(string, tag="8")] + pub nickname: ::prost::alloc::string::String, + #[prost(string, optional, tag="9")] + pub mobile_phone_number: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration="MemberState", tag="10")] + pub state: i32, + #[prost(uint64, optional, tag="11")] + pub state_changed_at: ::core::option::Option, + #[prost(string, optional, tag="12")] + pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, + #[prost(uint64, optional, tag="13")] + pub last_signined_at: ::core::option::Option, + #[prost(uint64, tag="14")] + pub created_at: u64, + #[prost(uint64, tag="15")] + pub updated_at: u64, + #[prost(uint64, optional, tag="16")] + pub deleted_at: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MemberModel { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(message, optional, tag="2")] + pub site: ::core::option::Option, + #[prost(message, optional, tag="3")] + pub member_class: ::core::option::Option, + #[prost(message, optional, tag="4")] + pub member_level: ::core::option::Option, + #[prost(message, optional, tag="5")] + pub referrer_member: ::core::option::Option, + #[prost(uint64, tag="6")] + pub referred_count: u64, + #[prost(string, tag="7")] + pub username: ::prost::alloc::string::String, + #[prost(string, tag="8")] + pub nickname: ::prost::alloc::string::String, + #[prost(string, optional, tag="9")] + pub mobile_phone_number: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration="MemberState", tag="10")] + pub state: i32, + #[prost(uint64, optional, tag="11")] + pub state_changed_at: ::core::option::Option, + #[prost(string, optional, tag="12")] + pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, + #[prost(uint64, optional, tag="13")] + pub last_signined_at: ::core::option::Option, + #[prost(uint64, tag="14")] + pub created_at: u64, + #[prost(uint64, tag="15")] + pub updated_at: u64, + #[prost(uint64, optional, tag="16")] + pub deleted_at: ::core::option::Option, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] diff --git a/src/ss/domain/site.rs b/src/ss/domain/site.rs index d672ebf..e2b24f7 100644 --- a/src/ss/domain/site.rs +++ b/src/ss/domain/site.rs @@ -16,6 +16,18 @@ pub struct ListSitesRequest { pub searches: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="4")] pub sorts: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag="5")] + pub url_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="6")] + pub name_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="7")] + pub path_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(bool, optional, tag="8")] + pub show: ::core::option::Option, + #[prost(bool, optional, tag="9")] + pub can_use: ::core::option::Option, + #[prost(string, optional, tag="10")] + pub memo_like: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListSitesResponse { diff --git a/src/ss/member/member.rs b/src/ss/member/member.rs index 006f494..9f68b35 100644 --- a/src/ss/member/member.rs +++ b/src/ss/member/member.rs @@ -1,6 +1,7 @@ use crate::models::core; use crate::protobuf::rpc; use crate::protobuf::pagination; +use crate::models::member; const SUBJECT: &str = "bet.beteran.ss.member"; @@ -17,6 +18,26 @@ pub struct ListMembersRequest { pub searches: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="4")] pub sorts: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag="5")] + pub site_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="6")] + pub member_class_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="7")] + pub member_level_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="8")] + pub referrer_member_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="9")] + pub username_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="10")] + pub nickname_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="11")] + pub mobile_phone_number_like: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="12")] + pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration="member::MemberState", optional, tag="13")] + pub state: ::core::option::Option, + #[prost(uint64, optional, tag="14")] + pub deleted_at: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListMembersResponse { @@ -32,7 +53,7 @@ pub mod list_members_response { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, repeated, tag="1")] - pub members: ::prost::alloc::vec::Vec, + pub members: ::prost::alloc::vec::Vec, } } @@ -59,7 +80,7 @@ pub mod get_member_response { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, optional, tag="1")] - pub member: ::core::option::Option, + pub member: ::core::option::Option, } } @@ -87,6 +108,6 @@ pub mod get_member_by_username_response { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, optional, tag="1")] - pub member: ::core::option::Option, + pub member: ::core::option::Option, } }