]> Untitled Git - lemmy.git/blob - crates/db_views_moderator/src/structs.rs
9d525b57b11e9d5440797f032e8d0cd6852c6dbd
[lemmy.git] / crates / db_views_moderator / src / structs.rs
1 use lemmy_db_schema::source::{
2   comment::Comment,
3   community::CommunitySafe,
4   moderator::{
5     ModAdd,
6     ModAddCommunity,
7     ModBan,
8     ModBanFromCommunity,
9     ModHideCommunity,
10     ModLockPost,
11     ModRemoveComment,
12     ModRemoveCommunity,
13     ModRemovePost,
14     ModStickyPost,
15     ModTransferCommunity,
16   },
17   person::{PersonSafe, PersonSafeAlias1},
18   post::Post,
19 };
20 use serde::{Deserialize, Serialize};
21
22 #[derive(Debug, Serialize, Deserialize, Clone)]
23 pub struct ModAddCommunityView {
24   pub mod_add_community: ModAddCommunity,
25   pub moderator: PersonSafe,
26   pub community: CommunitySafe,
27   pub modded_person: PersonSafeAlias1,
28 }
29
30 #[derive(Debug, Serialize, Deserialize, Clone)]
31 pub struct ModAddView {
32   pub mod_add: ModAdd,
33   pub moderator: PersonSafe,
34   pub modded_person: PersonSafeAlias1,
35 }
36
37 #[derive(Debug, Serialize, Deserialize, Clone)]
38 pub struct ModBanFromCommunityView {
39   pub mod_ban_from_community: ModBanFromCommunity,
40   pub moderator: PersonSafe,
41   pub community: CommunitySafe,
42   pub banned_person: PersonSafeAlias1,
43 }
44
45 #[derive(Debug, Serialize, Deserialize, Clone)]
46 pub struct ModBanView {
47   pub mod_ban: ModBan,
48   pub moderator: PersonSafe,
49   pub banned_person: PersonSafeAlias1,
50 }
51
52 #[derive(Debug, Serialize, Deserialize, Clone)]
53 pub struct ModHideCommunityView {
54   pub mod_hide_community: ModHideCommunity,
55   pub admin: PersonSafe,
56   pub community: CommunitySafe,
57 }
58
59 #[derive(Debug, Serialize, Deserialize, Clone)]
60 pub struct ModLockPostView {
61   pub mod_lock_post: ModLockPost,
62   pub moderator: PersonSafe,
63   pub post: Post,
64   pub community: CommunitySafe,
65 }
66
67 #[derive(Debug, Serialize, Deserialize, Clone)]
68 pub struct ModRemoveCommentView {
69   pub mod_remove_comment: ModRemoveComment,
70   pub moderator: PersonSafe,
71   pub comment: Comment,
72   pub commenter: PersonSafeAlias1,
73   pub post: Post,
74   pub community: CommunitySafe,
75 }
76
77 #[derive(Debug, Serialize, Deserialize, Clone)]
78 pub struct ModRemoveCommunityView {
79   pub mod_remove_community: ModRemoveCommunity,
80   pub moderator: PersonSafe,
81   pub community: CommunitySafe,
82 }
83
84 #[derive(Debug, Serialize, Deserialize, Clone)]
85 pub struct ModRemovePostView {
86   pub mod_remove_post: ModRemovePost,
87   pub moderator: PersonSafe,
88   pub post: Post,
89   pub community: CommunitySafe,
90 }
91
92 #[derive(Debug, Serialize, Deserialize, Clone)]
93 pub struct ModStickyPostView {
94   pub mod_sticky_post: ModStickyPost,
95   pub moderator: PersonSafe,
96   pub post: Post,
97   pub community: CommunitySafe,
98 }
99
100 #[derive(Debug, Serialize, Deserialize, Clone)]
101 pub struct ModTransferCommunityView {
102   pub mod_transfer_community: ModTransferCommunity,
103   pub moderator: PersonSafe,
104   pub community: CommunitySafe,
105   pub modded_person: PersonSafeAlias1,
106 }