54 lines
1.2 KiB
Rust
54 lines
1.2 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Message {
|
|
pub sender_name: String,
|
|
pub timestamp: usize,
|
|
pub text_content: Option<String>,
|
|
pub photos: Vec<Photo>,
|
|
pub videos: Vec<Video>,
|
|
pub audio: Vec<Audio>,
|
|
pub service: Service,
|
|
pub reactions: Vec<Reaction>
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Reaction {
|
|
pub actor_name: String,
|
|
pub content: String,
|
|
pub timestamp: usize
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub enum Service {
|
|
Instagram,
|
|
WhatsApp,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Photo {
|
|
pub text_content: Option<String>,
|
|
pub img_path: String,
|
|
|
|
#[serde(skip)]
|
|
pub original_img_path: Option<String>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Video {
|
|
pub text_content: Option<String>,
|
|
pub vid_path: String,
|
|
|
|
#[serde(skip)]
|
|
pub original_vid_path: Option<String>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Audio {
|
|
pub text_content: Option<String>,
|
|
pub audio_path: String,
|
|
|
|
#[serde(skip)]
|
|
pub original_audio_path: Option<String>,
|
|
}
|