Continue actions refactoring

This commit is contained in:
Marc Plano-Lesay 2024-11-08 16:31:29 +01:00
parent 8726a1c6bf
commit eb53590049
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
10 changed files with 162 additions and 38 deletions

18
src/models/album.rs Normal file
View file

@ -0,0 +1,18 @@
use uuid::Uuid;
use crate::types::AlbumResponseDto;
#[derive(Debug, Clone)]
pub struct Album {
pub id: Uuid,
pub name: String,
}
impl From<AlbumResponseDto> for Album {
fn from(value: AlbumResponseDto) -> Self {
Self {
id: Uuid::parse_str(&value.id).expect("Unable to parse an album's UUID"),
name: value.album_name,
}
}
}

16
src/models/asset.rs Normal file
View file

@ -0,0 +1,16 @@
use uuid::Uuid;
use crate::types::AssetResponseDto;
#[derive(Debug, Clone)]
pub struct Asset {
pub id: Uuid,
}
impl From<AssetResponseDto> for Asset {
fn from(value: AssetResponseDto) -> Self {
Self {
id: Uuid::parse_str(&value.id).expect("Unable to parse an asset's UUID"),
}
}
}

View file

@ -1 +1,3 @@
pub mod album;
pub mod asset;
pub mod person;