diff --git a/services/backup/src/service/handlers/add_attachments.rs b/services/backup/src/service/handlers/add_attachments.rs new file mode 100644 --- /dev/null +++ b/services/backup/src/service/handlers/add_attachments.rs @@ -0,0 +1,11 @@ +use tonic::Status; + +use super::proto; +use crate::database::DatabaseClient; + +pub async fn handle_add_attachments( + db: &DatabaseClient, + request: proto::AddAttachmentsRequest, +) -> Result<(), Status> { + unimplemented!() +} diff --git a/services/backup/src/service/mod.rs b/services/backup/src/service/mod.rs --- a/services/backup/src/service/mod.rs +++ b/services/backup/src/service/mod.rs @@ -18,6 +18,7 @@ /// submodule containing gRPC endpoint handler implementations mod handlers { + pub(super) mod add_attachments; pub(super) mod create_backup; // re-exports for convenient usage in handlers @@ -142,12 +143,27 @@ Err(Status::unimplemented("unimplemented")) } - #[instrument(skip(self))] + #[instrument(skip_all, + fields( + user_id = &request.get_ref().user_id, + backup_id = &request.get_ref().backup_id, + log_id = &request.get_ref().log_id, + holders = &request.get_ref().holders) + )] async fn add_attachments( &self, - _request: Request, + request: Request, ) -> Result, Status> { - Err(Status::unimplemented("unimplemented")) + info!("AddAttachment request: {:?}", request); + + handlers::add_attachments::handle_add_attachments( + &self.db, + request.into_inner(), + ) + .await?; + + info!("Request processed successfully"); + Ok(Response::new(())) } }