| 1 |
|
| 2 |
|
| 3 |
use chrono::{DateTime, Utc}; |
| 4 |
use sqlx::FromRow; |
| 5 |
|
| 6 |
use super::super::id_types::*; |
| 7 |
use super::super::validated_types::*; |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#[derive(Debug, Clone, FromRow)] |
| 13 |
#[allow(dead_code)] |
| 14 |
pub struct DbCategory { |
| 15 |
pub id: CategoryId, |
| 16 |
pub name: String, |
| 17 |
pub slug: Slug, |
| 18 |
pub created_at: DateTime<Utc>, |
| 19 |
} |
| 20 |
|
| 21 |
|
| 22 |
#[derive(Debug, Clone, FromRow)] |
| 23 |
#[allow(dead_code)] |
| 24 |
pub struct DbCategoryCount { |
| 25 |
pub name: String, |
| 26 |
pub slug: Slug, |
| 27 |
pub count: i64, |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
#[derive(Debug, Clone, FromRow)] |
| 37 |
#[allow(dead_code)] |
| 38 |
pub struct DbTag { |
| 39 |
pub id: TagId, |
| 40 |
pub name: String, |
| 41 |
pub slug: String, |
| 42 |
pub parent_id: Option<TagId>, |
| 43 |
pub sort_order: i32, |
| 44 |
pub created_at: DateTime<Utc>, |
| 45 |
pub path: String, |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
#[derive(Debug, Clone, FromRow)] |
| 50 |
#[allow(dead_code)] |
| 51 |
pub struct DbItemTag { |
| 52 |
pub item_id: ItemId, |
| 53 |
pub tag_id: TagId, |
| 54 |
pub is_primary: bool, |
| 55 |
pub tag_name: String, |
| 56 |
pub tag_slug: String, |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
#[derive(Debug, Clone, FromRow)] |
| 61 |
#[allow(dead_code)] |
| 62 |
pub struct DbTagCount { |
| 63 |
pub tag_id: TagId, |
| 64 |
pub tag_name: String, |
| 65 |
pub tag_slug: String, |
| 66 |
pub count: i64, |
| 67 |
} |
| 68 |
|