2022-05-03 17:44:13 +00:00
|
|
|
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
|
2021-10-19 16:37:01 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2020-12-21 13:38:34 +00:00
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use crate::schema::{
|
|
|
|
mod_add,
|
|
|
|
mod_add_community,
|
|
|
|
mod_ban,
|
|
|
|
mod_ban_from_community,
|
|
|
|
mod_hide_community,
|
|
|
|
mod_lock_post,
|
|
|
|
mod_remove_comment,
|
|
|
|
mod_remove_community,
|
|
|
|
mod_remove_post,
|
|
|
|
mod_sticky_post,
|
|
|
|
mod_transfer_community,
|
|
|
|
};
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_remove_post")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModRemovePost {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_remove_post")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModRemovePostForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_lock_post")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModLockPost {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub locked: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_lock_post")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModLockPostForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub locked: Option<bool>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_sticky_post")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModStickyPost {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub stickied: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_sticky_post")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModStickyPostForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub stickied: Option<bool>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_remove_comment")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModRemoveComment {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub comment_id: CommentId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_remove_comment")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModRemoveCommentForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub comment_id: CommentId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_remove_community")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModRemoveCommunity {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_remove_community")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModRemoveCommunityForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_ban_from_community")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModBanFromCommunity {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_ban_from_community")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModBanFromCommunityForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_ban")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModBan {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_hide_community")]
|
2022-02-18 02:30:47 +00:00
|
|
|
pub struct ModHideCommunityForm {
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub hidden: Option<bool>,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
}
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_hide_community")]
|
2022-02-18 02:30:47 +00:00
|
|
|
pub struct ModHideCommunity {
|
|
|
|
pub id: i32,
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
pub hidden: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_ban")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModBanForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_add_community")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModAddCommunity {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_add_community")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModAddCommunityForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub removed: Option<bool>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_transfer_community")]
|
2021-08-17 21:52:28 +00:00
|
|
|
pub struct ModTransferCommunity {
|
|
|
|
pub id: i32,
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_transfer_community")]
|
2021-08-17 21:52:28 +00:00
|
|
|
pub struct ModTransferCommunityForm {
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_add")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModAdd {
|
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub removed: Option<bool>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", table_name = "mod_add")]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct ModAddForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub other_person_id: PersonId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub removed: Option<bool>,
|
|
|
|
}
|