From dde35b227c068615e06b8cdf6c47b4b1f60b5fdc Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Fri, 19 Aug 2022 00:16:58 +0000 Subject: [PATCH] event is added --- src/services/member/service.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/services/member/service.rs b/src/services/member/service.rs index 0e3f893..b9d5323 100644 --- a/src/services/member/service.rs +++ b/src/services/member/service.rs @@ -397,7 +397,28 @@ impl Service<'_> { bpr::ss::member::CreateMemberResponse { error: None, result: Some(bpr::ss::member::create_member_response::Result { - member: member.map(|d| bpr::models::member::MemberModel::from(&d)), + member: member.as_ref().map(bpr::models::member::MemberModel::from), + }), + } + .encode_to_vec(), + ) + .await + .map_err(|e| { + bcr::error::rpc::Error::Server(bcr::error::rpc::Server { + code: bpr::protobuf::rpc::Error::SERVER_00, + message: format!("server {}", e), + data: None, + }) + })?; + + self + .connection_broker + .publish( + bpr::ss::member::EVENT_SUBJECT_AFTER_CREATE_MEMBER, + bpr::ss::member::AfterCreateMemberEvent { + client: Some(client), + event: Some(bpr::ss::member::after_create_member_event::Event { + member: member.as_ref().map(bpr::models::member::MemberModel::from), }), } .encode_to_vec(),