Add repository commands for handling votes
This commit is contained in:
parent
4b16f39b4d
commit
40331451ca
9 changed files with 647 additions and 4 deletions
|
|
@ -1 +1,18 @@
|
|||
pub struct Vote {}
|
||||
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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue