todo: exporter
This commit is contained in:
23
crates/application/src/use_cases/export_diary.rs
Normal file
23
crates/application/src/use_cases/export_diary.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::{
|
||||
errors::DomainError,
|
||||
ports::{DiaryExporter, MovieRepository},
|
||||
};
|
||||
|
||||
use crate::commands::ExportCommand;
|
||||
|
||||
pub struct ExportDiary {
|
||||
repository: Arc<dyn MovieRepository>,
|
||||
exporter: Arc<dyn DiaryExporter>,
|
||||
}
|
||||
|
||||
impl ExportDiary {
|
||||
pub async fn execute(&self, req: ExportCommand) -> Result<Vec<u8>, DomainError> {
|
||||
// 1. fetch all diary entries for the user
|
||||
// 2. delegate serialization to the port (exporter)
|
||||
|
||||
// Return bytes of the exported diary, which can be written to a file or returned in an HTTP response
|
||||
Ok(vec![])
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod delete_review;
|
||||
pub mod export_diary;
|
||||
pub mod get_activity_feed;
|
||||
pub mod get_diary;
|
||||
pub mod get_review_history;
|
||||
|
||||
Reference in New Issue
Block a user