30 lines
660 B
Rust
30 lines
660 B
Rust
use serde::{Deserialize, Serialize};
|
|
use uuid::Uuid;
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Favorite {
|
|
pub id: Uuid,
|
|
pub user_id: String,
|
|
pub image_id: Uuid,
|
|
pub album_id: Uuid,
|
|
pub created_at: String,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct CreateFavorite {
|
|
pub image_id: Uuid,
|
|
pub album_id: Uuid,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct FavoriteWithImage {
|
|
pub favorite: Favorite,
|
|
pub image: super::image::Image,
|
|
pub album_title: String,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct FavoriteStatus {
|
|
pub is_favorited: bool,
|
|
pub favorite_id: Option<Uuid>,
|
|
} |