From 7688a137e1642927abcf52118121d1ac75aa5805 Mon Sep 17 00:00:00 2001 From: red binder Date: Thu, 18 Jun 2026 01:36:23 +0200 Subject: [PATCH] CompleteAttachFile method --- rnex-core/src/nex/datastore.rs | 15 +++++++++++++++ rnex-core/src/rmc/protocols/datastore.rs | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/rnex-core/src/nex/datastore.rs b/rnex-core/src/nex/datastore.rs index 24fbb7d..62c0355 100644 --- a/rnex-core/src/nex/datastore.rs +++ b/rnex-core/src/nex/datastore.rs @@ -1177,4 +1177,19 @@ impl DataStore for User { root_ca_cert: vec![], }) } + + async fn complete_attach_file(&self, complete_attach_param: CompletePostParam) -> Result { + log::info!("Data ID: {:?}", complete_attach_param.dataid); + log::info!("Success: {:?}", complete_attach_param.success); + + let presigner = S3Presigner::new( + &format!("https://{}", *RNEX_DATASTORE_S3_ENDPOINT), + format!("{}", *RNEX_DATASTORE_S3_BUCKET), + ).await; + + let key = format!("data/{}.jpg", complete_attach_param.dataid); + let download_url = presigner.generate_presigned_get(&key); + + Ok(download_url) + } } diff --git a/rnex-core/src/rmc/protocols/datastore.rs b/rnex-core/src/rmc/protocols/datastore.rs index 6bd2193..a4ba3dd 100644 --- a/rnex-core/src/rmc/protocols/datastore.rs +++ b/rnex-core/src/rmc/protocols/datastore.rs @@ -270,6 +270,11 @@ pub trait DataStore { &self, application_id: u32, ) -> Result, ErrorCode>; + #[method_id(57)] + async fn complete_attach_file( + &self, + complete_attach_param: CompletePostParam + ) -> Result; #[method_id(59)] async fn prepare_attach_file( &self,