2 aggregates::structs::{CommentAggregates, CommunityAggregates, PersonAggregates},
5 comment_reply::CommentReply,
8 person_mention::PersonMention,
13 use serde::{Deserialize, Serialize};
14 use serde_with::skip_serializing_none;
15 #[cfg(feature = "full")]
18 #[derive(Debug, Serialize, Deserialize, Clone)]
19 #[cfg_attr(feature = "full", derive(TS))]
20 #[cfg_attr(feature = "full", ts(export))]
21 /// A community block.
22 pub struct CommunityBlockView {
24 pub community: Community,
27 #[derive(Debug, Serialize, Deserialize, Clone)]
28 #[cfg_attr(feature = "full", derive(TS))]
29 #[cfg_attr(feature = "full", ts(export))]
30 /// A community follower.
31 pub struct CommunityFollowerView {
32 pub community: Community,
36 #[derive(Debug, Serialize, Deserialize, Clone)]
37 #[cfg_attr(feature = "full", derive(TS))]
38 #[cfg_attr(feature = "full", ts(export))]
39 /// A community moderator.
40 pub struct CommunityModeratorView {
41 pub community: Community,
42 pub moderator: Person,
45 #[derive(Debug, Serialize, Deserialize, Clone)]
46 /// A community person ban.
47 pub struct CommunityPersonBanView {
48 pub community: Community,
52 #[derive(Debug, Serialize, Deserialize, Clone)]
53 #[cfg_attr(feature = "full", derive(TS))]
54 #[cfg_attr(feature = "full", ts(export))]
56 pub struct CommunityView {
57 pub community: Community,
58 pub subscribed: SubscribedType,
60 pub counts: CommunityAggregates,
63 #[derive(Debug, Serialize, Deserialize, Clone)]
64 #[cfg_attr(feature = "full", derive(TS))]
65 #[cfg_attr(feature = "full", ts(export))]
67 pub struct PersonBlockView {
72 #[skip_serializing_none]
73 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
74 #[cfg_attr(feature = "full", derive(TS))]
75 #[cfg_attr(feature = "full", ts(export))]
76 /// A person mention view.
77 pub struct PersonMentionView {
78 pub person_mention: PersonMention,
82 pub community: Community,
83 pub recipient: Person,
84 pub counts: CommentAggregates,
85 pub creator_banned_from_community: bool,
86 pub subscribed: SubscribedType,
88 pub creator_blocked: bool,
89 pub my_vote: Option<i16>,
92 #[skip_serializing_none]
93 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
94 #[cfg_attr(feature = "full", derive(TS))]
95 #[cfg_attr(feature = "full", ts(export))]
96 /// A comment reply view.
97 pub struct CommentReplyView {
98 pub comment_reply: CommentReply,
102 pub community: Community,
103 pub recipient: Person,
104 pub counts: CommentAggregates,
105 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
106 pub subscribed: SubscribedType, // Left join to CommunityFollower
107 pub saved: bool, // Left join to CommentSaved
108 pub creator_blocked: bool, // Left join to PersonBlock
109 pub my_vote: Option<i16>, // Left join to CommentLike
112 #[derive(Debug, Serialize, Deserialize, Clone)]
113 #[cfg_attr(feature = "full", derive(TS))]
114 #[cfg_attr(feature = "full", ts(export))]
116 pub struct PersonView {
118 pub counts: PersonAggregates,