upvoters/src/votes/model.rs

19 lines
407 B
Rust
Raw Normal View History

use chrono::{DateTime, Utc};
use sqlx::prelude::FromRow;
use uuid::Uuid;
/// Struct representing a single vote (row) in the votes table
#[derive(Debug, FromRow)]
pub struct Vote {
pub slug: String,
pub voter_id: Uuid,
pub created_at: DateTime<Utc>,
}
/// Struct representing the best slug posts
#[derive(Debug, FromRow)]
pub struct BestSlugs {
pub slug: String,
pub vote_count: i64,
}