| 1 |
|
| 2 |
|
| 3 |
use chrono::{DateTime, Utc}; |
| 4 |
use serde::Serialize; |
| 5 |
use sqlx::FromRow; |
| 6 |
|
| 7 |
use super::super::id_types::*; |
| 8 |
|
| 9 |
|
| 10 |
#[derive(Debug, Clone, FromRow, Serialize)] |
| 11 |
pub struct DbContentInsertion { |
| 12 |
pub id: ContentInsertionId, |
| 13 |
pub user_id: UserId, |
| 14 |
pub title: String, |
| 15 |
pub media_type: String, |
| 16 |
pub storage_key: String, |
| 17 |
pub duration_ms: i32, |
| 18 |
pub file_size: i64, |
| 19 |
pub mime_type: String, |
| 20 |
pub created_at: DateTime<Utc>, |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
#[derive(Debug, Clone, FromRow)] |
| 25 |
pub struct DbInsertionPlacement { |
| 26 |
pub id: ContentInsertionPlacementId, |
| 27 |
pub item_id: ItemId, |
| 28 |
pub insertion_id: ContentInsertionId, |
| 29 |
pub position: super::super::InsertionPosition, |
| 30 |
pub offset_ms: Option<i32>, |
| 31 |
pub sort_order: i32, |
| 32 |
pub created_at: DateTime<Utc>, |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
#[derive(Debug, Clone, FromRow)] |
| 37 |
pub struct DbPlacementWithInsertion { |
| 38 |
pub id: ContentInsertionPlacementId, |
| 39 |
pub item_id: ItemId, |
| 40 |
pub insertion_id: ContentInsertionId, |
| 41 |
pub position: super::super::InsertionPosition, |
| 42 |
pub offset_ms: Option<i32>, |
| 43 |
pub sort_order: i32, |
| 44 |
pub created_at: DateTime<Utc>, |
| 45 |
|
| 46 |
pub insertion_title: String, |
| 47 |
|
| 48 |
pub insertion_duration_ms: i32, |
| 49 |
|
| 50 |
pub insertion_storage_key: String, |
| 51 |
} |
| 52 |
|