2021-02-26 13:49:58 +00:00
|
|
|
use crate::{schema::person_mention, source::comment::Comment};
|
2020-12-21 13:38:34 +00:00
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
|
|
|
#[belongs_to(Comment)]
|
2021-02-26 13:49:58 +00:00
|
|
|
#[table_name = "person_mention"]
|
|
|
|
pub struct PersonMention {
|
2020-12-21 13:38:34 +00:00
|
|
|
pub id: i32,
|
|
|
|
pub recipient_id: i32,
|
|
|
|
pub comment_id: i32,
|
|
|
|
pub read: bool,
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
2021-02-26 13:49:58 +00:00
|
|
|
#[table_name = "person_mention"]
|
|
|
|
pub struct PersonMentionForm {
|
2020-12-21 13:38:34 +00:00
|
|
|
pub recipient_id: i32,
|
|
|
|
pub comment_id: i32,
|
|
|
|
pub read: Option<bool>,
|
|
|
|
}
|