forked from spacebar/rust-nex
CompleteAttachFile method
This commit is contained in:
parent
aee67fd158
commit
7688a137e1
2 changed files with 20 additions and 0 deletions
|
|
@ -1177,4 +1177,19 @@ impl DataStore for User {
|
|||
root_ca_cert: vec![],
|
||||
})
|
||||
}
|
||||
|
||||
async fn complete_attach_file(&self, complete_attach_param: CompletePostParam) -> Result<String, ErrorCode> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,6 +270,11 @@ pub trait DataStore {
|
|||
&self,
|
||||
application_id: u32,
|
||||
) -> Result<Vec<String>, ErrorCode>;
|
||||
#[method_id(57)]
|
||||
async fn complete_attach_file(
|
||||
&self,
|
||||
complete_attach_param: CompletePostParam
|
||||
) -> Result<String, ErrorCode>;
|
||||
#[method_id(59)]
|
||||
async fn prepare_attach_file(
|
||||
&self,
|
||||
|
|
|
|||
Loading…
Reference in a new issue