2022-05-03 17:44:13 +00:00
|
|
|
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use crate::schema::{
|
2022-06-13 19:15:04 +00:00
|
|
|
admin_purge_comment,
|
|
|
|
admin_purge_community,
|
|
|
|
admin_purge_person,
|
|
|
|
admin_purge_post,
|
2022-05-03 17:44:13 +00:00
|
|
|
mod_add,
|
|
|
|
mod_add_community,
|
|
|
|
mod_ban,
|
|
|
|
mod_ban_from_community,
|
2022-12-12 11:17:10 +00:00
|
|
|
mod_feature_post,
|
2022-05-03 17:44:13 +00:00
|
|
|
mod_hide_community,
|
|
|
|
mod_lock_post,
|
|
|
|
mod_remove_comment,
|
|
|
|
mod_remove_community,
|
|
|
|
mod_remove_post,
|
|
|
|
mod_transfer_community,
|
|
|
|
};
|
2022-11-02 19:18:22 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-04-26 04:26:10 +00:00
|
|
|
use serde_with::skip_serializing_none;
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use ts_rs::TS;
|
2022-05-03 17:44:13 +00:00
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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>,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub removed: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub locked: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-12-12 11:17:10 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_feature_post))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2022-12-12 11:17:10 +00:00
|
|
|
pub struct ModFeaturePost {
|
2020-12-21 13:38:34 +00:00
|
|
|
pub id: i32,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2022-12-12 11:17:10 +00:00
|
|
|
pub featured: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub when_: chrono::NaiveDateTime,
|
2022-12-12 11:17:10 +00:00
|
|
|
pub is_featured_community: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-12-12 11:17:10 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_feature_post))]
|
|
|
|
pub struct ModFeaturePostForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
2022-12-12 11:17:10 +00:00
|
|
|
pub featured: bool,
|
|
|
|
pub is_featured_community: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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>,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub removed: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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>,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub removed: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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>,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub banned: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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>,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub banned: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub expires: Option<chrono::NaiveDateTime>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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>,
|
|
|
|
}
|
2023-04-26 04:26:10 +00:00
|
|
|
|
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2022-02-18 02:30:47 +00:00
|
|
|
pub struct ModHideCommunity {
|
|
|
|
pub id: i32,
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub mod_person_id: PersonId,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
pub hidden: bool,
|
2022-02-18 02:30:47 +00:00
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub removed: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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 when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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,
|
|
|
|
}
|
|
|
|
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = mod_add))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
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,
|
2023-04-17 19:19:51 +00:00
|
|
|
pub removed: bool,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(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>,
|
|
|
|
}
|
2022-06-13 19:15:04 +00:00
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgePerson {
|
|
|
|
pub id: i32,
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgePersonForm {
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgeCommunity {
|
|
|
|
pub id: i32,
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgeCommunityForm {
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgePost {
|
|
|
|
pub id: i32,
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgePostForm {
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgeComment {
|
|
|
|
pub id: i32,
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
pub when_: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
|
2022-06-13 19:15:04 +00:00
|
|
|
pub struct AdminPurgeCommentForm {
|
|
|
|
pub admin_person_id: PersonId,
|
|
|
|
pub post_id: PostId,
|
|
|
|
pub reason: Option<String>,
|
|
|
|
}
|