|
|
|
@ -1,13 +1,19 @@
|
|
|
|
|
use crate::schema::{
|
|
|
|
|
mod_add,
|
|
|
|
|
mod_add_community,
|
|
|
|
|
mod_ban,
|
|
|
|
|
mod_ban_from_community,
|
|
|
|
|
mod_lock_post,
|
|
|
|
|
mod_remove_comment,
|
|
|
|
|
mod_remove_community,
|
|
|
|
|
mod_remove_post,
|
|
|
|
|
mod_sticky_post,
|
|
|
|
|
use crate::{
|
|
|
|
|
schema::{
|
|
|
|
|
mod_add,
|
|
|
|
|
mod_add_community,
|
|
|
|
|
mod_ban,
|
|
|
|
|
mod_ban_from_community,
|
|
|
|
|
mod_lock_post,
|
|
|
|
|
mod_remove_comment,
|
|
|
|
|
mod_remove_community,
|
|
|
|
|
mod_remove_post,
|
|
|
|
|
mod_sticky_post,
|
|
|
|
|
},
|
|
|
|
|
CommentId,
|
|
|
|
|
CommunityId,
|
|
|
|
|
PersonId,
|
|
|
|
|
PostId,
|
|
|
|
|
};
|
|
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
|
@ -15,8 +21,8 @@ use serde::Serialize;
|
|
|
|
|
#[table_name = "mod_remove_post"]
|
|
|
|
|
pub struct ModRemovePost {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub post_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub post_id: PostId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
@ -25,8 +31,8 @@ pub struct ModRemovePost {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_remove_post"]
|
|
|
|
|
pub struct ModRemovePostForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub post_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub post_id: PostId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
}
|
|
|
|
@ -35,8 +41,8 @@ pub struct ModRemovePostForm {
|
|
|
|
|
#[table_name = "mod_lock_post"]
|
|
|
|
|
pub struct ModLockPost {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub post_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub post_id: PostId,
|
|
|
|
|
pub locked: Option<bool>,
|
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
|
}
|
|
|
|
@ -44,8 +50,8 @@ pub struct ModLockPost {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_lock_post"]
|
|
|
|
|
pub struct ModLockPostForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub post_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub post_id: PostId,
|
|
|
|
|
pub locked: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -53,8 +59,8 @@ pub struct ModLockPostForm {
|
|
|
|
|
#[table_name = "mod_sticky_post"]
|
|
|
|
|
pub struct ModStickyPost {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub post_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub post_id: PostId,
|
|
|
|
|
pub stickied: Option<bool>,
|
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
|
}
|
|
|
|
@ -62,8 +68,8 @@ pub struct ModStickyPost {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_sticky_post"]
|
|
|
|
|
pub struct ModStickyPostForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub post_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub post_id: PostId,
|
|
|
|
|
pub stickied: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -71,8 +77,8 @@ pub struct ModStickyPostForm {
|
|
|
|
|
#[table_name = "mod_remove_comment"]
|
|
|
|
|
pub struct ModRemoveComment {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub comment_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub comment_id: CommentId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
@ -81,8 +87,8 @@ pub struct ModRemoveComment {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_remove_comment"]
|
|
|
|
|
pub struct ModRemoveCommentForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub comment_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub comment_id: CommentId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
}
|
|
|
|
@ -91,8 +97,8 @@ pub struct ModRemoveCommentForm {
|
|
|
|
|
#[table_name = "mod_remove_community"]
|
|
|
|
|
pub struct ModRemoveCommunity {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub community_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
@ -102,8 +108,8 @@ pub struct ModRemoveCommunity {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_remove_community"]
|
|
|
|
|
pub struct ModRemoveCommunityForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub community_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
@ -113,9 +119,9 @@ pub struct ModRemoveCommunityForm {
|
|
|
|
|
#[table_name = "mod_ban_from_community"]
|
|
|
|
|
pub struct ModBanFromCommunity {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub community_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
@ -125,9 +131,9 @@ pub struct ModBanFromCommunity {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_ban_from_community"]
|
|
|
|
|
pub struct ModBanFromCommunityForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub community_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
@ -137,8 +143,8 @@ pub struct ModBanFromCommunityForm {
|
|
|
|
|
#[table_name = "mod_ban"]
|
|
|
|
|
pub struct ModBan {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
@ -148,8 +154,8 @@ pub struct ModBan {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_ban"]
|
|
|
|
|
pub struct ModBanForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub reason: Option<String>,
|
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
@ -159,9 +165,9 @@ pub struct ModBanForm {
|
|
|
|
|
#[table_name = "mod_add_community"]
|
|
|
|
|
pub struct ModAddCommunity {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub community_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
|
}
|
|
|
|
@ -169,9 +175,9 @@ pub struct ModAddCommunity {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_add_community"]
|
|
|
|
|
pub struct ModAddCommunityForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub community_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -179,8 +185,8 @@ pub struct ModAddCommunityForm {
|
|
|
|
|
#[table_name = "mod_add"]
|
|
|
|
|
pub struct ModAdd {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
|
}
|
|
|
|
@ -188,7 +194,7 @@ pub struct ModAdd {
|
|
|
|
|
#[derive(Insertable, AsChangeset)]
|
|
|
|
|
#[table_name = "mod_add"]
|
|
|
|
|
pub struct ModAddForm {
|
|
|
|
|
pub mod_person_id: i32,
|
|
|
|
|
pub other_person_id: i32,
|
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
|
pub other_person_id: PersonId,
|
|
|
|
|
pub removed: Option<bool>,
|
|
|
|
|
}
|
|
|
|
|