2 aggregates::structs::{CommentAggregates, PersonAggregates, PostAggregates, SiteAggregates},
5 comment_report::CommentReport,
6 community::CommunitySafe,
9 local_site_rate_limit::LocalSiteRateLimit,
10 local_user::{LocalUser, LocalUserSettings},
11 person::{Person, PersonSafe},
13 post_report::PostReport,
14 private_message::PrivateMessage,
15 private_message_report::PrivateMessageReport,
16 registration_application::RegistrationApplication,
21 use serde::{Deserialize, Serialize};
23 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
24 pub struct CommentReportView {
25 pub comment_report: CommentReport,
28 pub community: CommunitySafe,
29 pub creator: PersonSafe,
30 pub comment_creator: PersonSafe,
31 pub counts: CommentAggregates,
32 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
33 pub my_vote: Option<i16>, // Left join to CommentLike
34 pub resolver: Option<PersonSafe>,
37 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
38 pub struct CommentView {
40 pub creator: PersonSafe,
42 pub community: CommunitySafe,
43 pub counts: CommentAggregates,
44 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
45 pub subscribed: SubscribedType, // Left join to CommunityFollower
46 pub saved: bool, // Left join to CommentSaved
47 pub creator_blocked: bool, // Left join to PersonBlock
48 pub my_vote: Option<i16>, // Left join to CommentLike
51 #[derive(Debug, Serialize, Deserialize, Clone)]
52 pub struct LocalUserView {
53 pub local_user: LocalUser,
55 pub counts: PersonAggregates,
58 #[derive(Debug, Serialize, Deserialize, Clone)]
59 pub struct LocalUserSettingsView {
60 pub local_user: LocalUserSettings,
61 pub person: PersonSafe,
62 pub counts: PersonAggregates,
65 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
66 pub struct PostReportView {
67 pub post_report: PostReport,
69 pub community: CommunitySafe,
70 pub creator: PersonSafe,
71 pub post_creator: PersonSafe,
72 pub creator_banned_from_community: bool,
73 pub my_vote: Option<i16>,
74 pub counts: PostAggregates,
75 pub resolver: Option<PersonSafe>,
78 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
81 pub creator: PersonSafe,
82 pub community: CommunitySafe,
83 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
84 pub counts: PostAggregates,
85 pub subscribed: SubscribedType, // Left join to CommunityFollower
86 pub saved: bool, // Left join to PostSaved
87 pub read: bool, // Left join to PostRead
88 pub creator_blocked: bool, // Left join to PersonBlock
89 pub my_vote: Option<i16>, // Left join to PostLike
90 pub unread_comments: i64, // Left join to PersonPostAggregates
93 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
94 pub struct PrivateMessageView {
95 pub private_message: PrivateMessage,
96 pub creator: PersonSafe,
97 pub recipient: PersonSafe,
100 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
101 pub struct PrivateMessageReportView {
102 pub private_message_report: PrivateMessageReport,
103 pub private_message: PrivateMessage,
104 pub private_message_creator: PersonSafe,
105 pub creator: PersonSafe,
106 pub resolver: Option<PersonSafe>,
109 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
110 pub struct RegistrationApplicationView {
111 pub registration_application: RegistrationApplication,
112 pub creator_local_user: LocalUserSettings,
113 pub creator: PersonSafe,
114 pub admin: Option<PersonSafe>,
117 #[derive(Debug, Serialize, Deserialize, Clone)]
118 pub struct SiteView {
120 pub local_site: LocalSite,
121 pub local_site_rate_limit: LocalSiteRateLimit,
122 pub counts: SiteAggregates,
125 #[derive(Debug, Serialize, Deserialize, Clone)]
126 pub struct LocalUserDiscussionLanguageView {
127 pub local_user: LocalUserSettings,
128 pub language: Language,