2 aggregates::structs::{CommentAggregates, PersonAggregates, PostAggregates, SiteAggregates},
5 comment_report::CommentReport,
6 community::CommunitySafe,
7 local_user::{LocalUser, LocalUserSettings},
8 person::{Person, PersonSafe, PersonSafeAlias1, PersonSafeAlias2},
10 post_report::PostReport,
11 private_message::PrivateMessage,
12 registration_application::RegistrationApplication,
17 use serde::{Deserialize, Serialize};
19 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
20 pub struct CommentReportView {
21 pub comment_report: CommentReport,
24 pub community: CommunitySafe,
25 pub creator: PersonSafe,
26 pub comment_creator: PersonSafeAlias1,
27 pub counts: CommentAggregates,
28 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
29 pub my_vote: Option<i16>, // Left join to CommentLike
30 pub resolver: Option<PersonSafeAlias2>,
33 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
34 pub struct CommentView {
36 pub creator: PersonSafe,
37 pub recipient: Option<PersonSafeAlias1>, // Left joins to comment and person
39 pub community: CommunitySafe,
40 pub counts: CommentAggregates,
41 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
42 pub subscribed: SubscribedType, // Left join to CommunityFollower
43 pub saved: bool, // Left join to CommentSaved
44 pub creator_blocked: bool, // Left join to PersonBlock
45 pub my_vote: Option<i16>, // Left join to CommentLike
48 #[derive(Debug, Serialize, Deserialize, Clone)]
49 pub struct LocalUserView {
50 pub local_user: LocalUser,
52 pub counts: PersonAggregates,
55 #[derive(Debug, Serialize, Deserialize, Clone)]
56 pub struct LocalUserSettingsView {
57 pub local_user: LocalUserSettings,
58 pub person: PersonSafe,
59 pub counts: PersonAggregates,
62 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
63 pub struct PostReportView {
64 pub post_report: PostReport,
66 pub community: CommunitySafe,
67 pub creator: PersonSafe,
68 pub post_creator: PersonSafeAlias1,
69 pub creator_banned_from_community: bool,
70 pub my_vote: Option<i16>,
71 pub counts: PostAggregates,
72 pub resolver: Option<PersonSafeAlias2>,
75 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
78 pub creator: PersonSafe,
79 pub community: CommunitySafe,
80 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
81 pub counts: PostAggregates,
82 pub subscribed: SubscribedType, // Left join to CommunityFollower
83 pub saved: bool, // Left join to PostSaved
84 pub read: bool, // Left join to PostRead
85 pub creator_blocked: bool, // Left join to PersonBlock
86 pub my_vote: Option<i16>, // Left join to PostLike
89 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
90 pub struct PrivateMessageView {
91 pub private_message: PrivateMessage,
92 pub creator: PersonSafe,
93 pub recipient: PersonSafeAlias1,
96 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
97 pub struct RegistrationApplicationView {
98 pub registration_application: RegistrationApplication,
99 pub creator_local_user: LocalUserSettings,
100 pub creator: PersonSafe,
101 pub admin: Option<PersonSafeAlias1>,
104 #[derive(Debug, Serialize, Deserialize, Clone)]
105 pub struct SiteView {
107 pub counts: SiteAggregates,