feat: add file serving endpoint GET /assets/:id/file

This commit is contained in:
2026-05-31 05:59:19 +02:00
parent 3a18fd1d3f
commit 0f003a3bd6
4 changed files with 52 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ use application::{
};
use std::sync::Arc;
use domain::ports::{StoragePort, TokenIssuer};
use domain::ports::{AssetRepository, FileStoragePort, StoragePort, TokenIssuer};
#[derive(Clone)]
pub struct AppState {
@@ -24,6 +24,8 @@ pub struct AppState {
pub update_metadata_handler: Arc<UpdateMetadataHandler>,
pub register_volume_handler: Arc<RegisterVolumeHandler>,
pub register_library_path_handler: Arc<RegisterLibraryPathHandler>,
pub file_storage: Arc<dyn FileStoragePort>,
pub asset_repo: Arc<dyn AssetRepository>,
}
impl AppState {
@@ -43,6 +45,8 @@ impl AppState {
update_metadata_handler: Arc<UpdateMetadataHandler>,
register_volume_handler: Arc<RegisterVolumeHandler>,
register_library_path_handler: Arc<RegisterLibraryPathHandler>,
file_storage: Arc<dyn FileStoragePort>,
asset_repo: Arc<dyn AssetRepository>,
) -> Self {
Self {
register_handler,
@@ -59,6 +63,8 @@ impl AppState {
update_metadata_handler,
register_volume_handler,
register_library_path_handler,
file_storage,
asset_repo,
}
}
}