2021-01-27 16:42:23 +00:00
|
|
|
use crate::{schema::private_message, Url};
|
2020-12-21 13:38:34 +00:00
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
|
|
|
#[table_name = "private_message"]
|
|
|
|
pub struct PrivateMessage {
|
|
|
|
pub id: i32,
|
|
|
|
pub creator_id: i32,
|
|
|
|
pub recipient_id: i32,
|
|
|
|
pub content: String,
|
|
|
|
pub deleted: bool,
|
|
|
|
pub read: bool,
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
2021-01-27 16:42:23 +00:00
|
|
|
pub ap_id: Url,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub local: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
#[table_name = "private_message"]
|
|
|
|
pub struct PrivateMessageForm {
|
|
|
|
pub creator_id: i32,
|
|
|
|
pub recipient_id: i32,
|
|
|
|
pub content: String,
|
|
|
|
pub deleted: Option<bool>,
|
|
|
|
pub read: Option<bool>,
|
|
|
|
pub published: Option<chrono::NaiveDateTime>,
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
2021-01-27 16:42:23 +00:00
|
|
|
pub ap_id: Option<Url>,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub local: bool,
|
|
|
|
}
|