Continue actions refactoring
This commit is contained in:
parent
8726a1c6bf
commit
eb53590049
10 changed files with 162 additions and 38 deletions
18
src/models/album.rs
Normal file
18
src/models/album.rs
Normal 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
16
src/models/asset.rs
Normal 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"),
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1,3 @@
|
|||
pub mod album;
|
||||
pub mod asset;
|
||||
pub mod person;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue