2022-08-16 11:52:04 +00:00
|
|
|
use lemmy_db_schema::{
|
|
|
|
newtypes::{CommunityId, PersonId},
|
|
|
|
source::{
|
|
|
|
comment::Comment,
|
|
|
|
community::CommunitySafe,
|
|
|
|
moderator::{
|
|
|
|
AdminPurgeComment,
|
|
|
|
AdminPurgeCommunity,
|
|
|
|
AdminPurgePerson,
|
|
|
|
AdminPurgePost,
|
|
|
|
ModAdd,
|
|
|
|
ModAddCommunity,
|
|
|
|
ModBan,
|
|
|
|
ModBanFromCommunity,
|
2022-12-12 11:17:10 +00:00
|
|
|
ModFeaturePost,
|
2022-08-16 11:52:04 +00:00
|
|
|
ModHideCommunity,
|
|
|
|
ModLockPost,
|
|
|
|
ModRemoveComment,
|
|
|
|
ModRemoveCommunity,
|
|
|
|
ModRemovePost,
|
|
|
|
ModTransferCommunity,
|
|
|
|
},
|
2022-09-26 14:09:32 +00:00
|
|
|
person::PersonSafe,
|
2022-08-16 11:52:04 +00:00
|
|
|
post::Post,
|
2022-05-03 17:44:13 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModAddCommunityView {
|
|
|
|
pub mod_add_community: ModAddCommunity,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub community: CommunitySafe,
|
2022-09-26 14:09:32 +00:00
|
|
|
pub modded_person: PersonSafe,
|
2022-05-03 17:44:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModAddView {
|
|
|
|
pub mod_add: ModAdd,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-09-26 14:09:32 +00:00
|
|
|
pub modded_person: PersonSafe,
|
2022-05-03 17:44:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModBanFromCommunityView {
|
|
|
|
pub mod_ban_from_community: ModBanFromCommunity,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub community: CommunitySafe,
|
2022-09-26 14:09:32 +00:00
|
|
|
pub banned_person: PersonSafe,
|
2022-05-03 17:44:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModBanView {
|
|
|
|
pub mod_ban: ModBan,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-09-26 14:09:32 +00:00
|
|
|
pub banned_person: PersonSafe,
|
2022-05-03 17:44:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModHideCommunityView {
|
|
|
|
pub mod_hide_community: ModHideCommunity,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub admin: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModLockPostView {
|
|
|
|
pub mod_lock_post: ModLockPost,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub post: Post,
|
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModRemoveCommentView {
|
|
|
|
pub mod_remove_comment: ModRemoveComment,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub comment: Comment,
|
2022-09-26 14:09:32 +00:00
|
|
|
pub commenter: PersonSafe,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub post: Post,
|
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModRemoveCommunityView {
|
|
|
|
pub mod_remove_community: ModRemoveCommunity,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModRemovePostView {
|
|
|
|
pub mod_remove_post: ModRemovePost,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub post: Post,
|
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
2022-12-12 11:17:10 +00:00
|
|
|
pub struct ModFeaturePostView {
|
|
|
|
pub mod_feature_post: ModFeaturePost,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub post: Post,
|
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct ModTransferCommunityView {
|
|
|
|
pub mod_transfer_community: ModTransferCommunity,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub moderator: Option<PersonSafe>,
|
2022-05-03 17:44:13 +00:00
|
|
|
pub community: CommunitySafe,
|
2022-09-26 14:09:32 +00:00
|
|
|
pub modded_person: PersonSafe,
|
2022-05-03 17:44:13 +00:00
|
|
|
}
|
2022-06-13 19:15:04 +00:00
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct AdminPurgeCommentView {
|
|
|
|
pub admin_purge_comment: AdminPurgeComment,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub admin: Option<PersonSafe>,
|
2022-06-13 19:15:04 +00:00
|
|
|
pub post: Post,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct AdminPurgeCommunityView {
|
|
|
|
pub admin_purge_community: AdminPurgeCommunity,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub admin: Option<PersonSafe>,
|
2022-06-13 19:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct AdminPurgePersonView {
|
|
|
|
pub admin_purge_person: AdminPurgePerson,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub admin: Option<PersonSafe>,
|
2022-06-13 19:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct AdminPurgePostView {
|
|
|
|
pub admin_purge_post: AdminPurgePost,
|
2022-08-16 11:52:04 +00:00
|
|
|
pub admin: Option<PersonSafe>,
|
2022-06-13 19:15:04 +00:00
|
|
|
pub community: CommunitySafe,
|
|
|
|
}
|
2022-08-16 11:52:04 +00:00
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
|
|
|
|
pub struct ModlogListParams {
|
|
|
|
pub community_id: Option<CommunityId>,
|
|
|
|
pub mod_person_id: Option<PersonId>,
|
|
|
|
pub other_person_id: Option<PersonId>,
|
|
|
|
pub page: Option<i64>,
|
|
|
|
pub limit: Option<i64>,
|
|
|
|
pub hide_modlog_names: bool,
|
|
|
|
}
|