]> Untitled Git - lemmy.git/blob - crates/db_views_moderator/src/structs.rs
Adding admin purging of DB items and pictures. #904 #1331 (#1809)
[lemmy.git] / crates / db_views_moderator / src / structs.rs
1 use lemmy_db_schema::source::{
2   comment::Comment,
3   community::CommunitySafe,
4   moderator::{
5     AdminPurgeComment,
6     AdminPurgeCommunity,
7     AdminPurgePerson,
8     AdminPurgePost,
9     ModAdd,
10     ModAddCommunity,
11     ModBan,
12     ModBanFromCommunity,
13     ModHideCommunity,
14     ModLockPost,
15     ModRemoveComment,
16     ModRemoveCommunity,
17     ModRemovePost,
18     ModStickyPost,
19     ModTransferCommunity,
20   },
21   person::{PersonSafe, PersonSafeAlias1},
22   post::Post,
23 };
24 use serde::{Deserialize, Serialize};
25
26 #[derive(Debug, Serialize, Deserialize, Clone)]
27 pub struct ModAddCommunityView {
28   pub mod_add_community: ModAddCommunity,
29   pub moderator: PersonSafe,
30   pub community: CommunitySafe,
31   pub modded_person: PersonSafeAlias1,
32 }
33
34 #[derive(Debug, Serialize, Deserialize, Clone)]
35 pub struct ModAddView {
36   pub mod_add: ModAdd,
37   pub moderator: PersonSafe,
38   pub modded_person: PersonSafeAlias1,
39 }
40
41 #[derive(Debug, Serialize, Deserialize, Clone)]
42 pub struct ModBanFromCommunityView {
43   pub mod_ban_from_community: ModBanFromCommunity,
44   pub moderator: PersonSafe,
45   pub community: CommunitySafe,
46   pub banned_person: PersonSafeAlias1,
47 }
48
49 #[derive(Debug, Serialize, Deserialize, Clone)]
50 pub struct ModBanView {
51   pub mod_ban: ModBan,
52   pub moderator: PersonSafe,
53   pub banned_person: PersonSafeAlias1,
54 }
55
56 #[derive(Debug, Serialize, Deserialize, Clone)]
57 pub struct ModHideCommunityView {
58   pub mod_hide_community: ModHideCommunity,
59   pub admin: PersonSafe,
60   pub community: CommunitySafe,
61 }
62
63 #[derive(Debug, Serialize, Deserialize, Clone)]
64 pub struct ModLockPostView {
65   pub mod_lock_post: ModLockPost,
66   pub moderator: PersonSafe,
67   pub post: Post,
68   pub community: CommunitySafe,
69 }
70
71 #[derive(Debug, Serialize, Deserialize, Clone)]
72 pub struct ModRemoveCommentView {
73   pub mod_remove_comment: ModRemoveComment,
74   pub moderator: PersonSafe,
75   pub comment: Comment,
76   pub commenter: PersonSafeAlias1,
77   pub post: Post,
78   pub community: CommunitySafe,
79 }
80
81 #[derive(Debug, Serialize, Deserialize, Clone)]
82 pub struct ModRemoveCommunityView {
83   pub mod_remove_community: ModRemoveCommunity,
84   pub moderator: PersonSafe,
85   pub community: CommunitySafe,
86 }
87
88 #[derive(Debug, Serialize, Deserialize, Clone)]
89 pub struct ModRemovePostView {
90   pub mod_remove_post: ModRemovePost,
91   pub moderator: PersonSafe,
92   pub post: Post,
93   pub community: CommunitySafe,
94 }
95
96 #[derive(Debug, Serialize, Deserialize, Clone)]
97 pub struct ModStickyPostView {
98   pub mod_sticky_post: ModStickyPost,
99   pub moderator: PersonSafe,
100   pub post: Post,
101   pub community: CommunitySafe,
102 }
103
104 #[derive(Debug, Serialize, Deserialize, Clone)]
105 pub struct ModTransferCommunityView {
106   pub mod_transfer_community: ModTransferCommunity,
107   pub moderator: PersonSafe,
108   pub community: CommunitySafe,
109   pub modded_person: PersonSafeAlias1,
110 }
111
112 #[derive(Debug, Serialize, Deserialize, Clone)]
113 pub struct AdminPurgeCommentView {
114   pub admin_purge_comment: AdminPurgeComment,
115   pub admin: PersonSafe,
116   pub post: Post,
117 }
118
119 #[derive(Debug, Serialize, Deserialize, Clone)]
120 pub struct AdminPurgeCommunityView {
121   pub admin_purge_community: AdminPurgeCommunity,
122   pub admin: PersonSafe,
123 }
124
125 #[derive(Debug, Serialize, Deserialize, Clone)]
126 pub struct AdminPurgePersonView {
127   pub admin_purge_person: AdminPurgePerson,
128   pub admin: PersonSafe,
129 }
130
131 #[derive(Debug, Serialize, Deserialize, Clone)]
132 pub struct AdminPurgePostView {
133   pub admin_purge_post: AdminPurgePost,
134   pub admin: PersonSafe,
135   pub community: CommunitySafe,
136 }