2 schema::{community, community_follower, community_moderator, community_user_ban},
7 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
8 #[table_name = "community"]
13 pub description: Option<String>,
17 pub published: chrono::NaiveDateTime,
18 pub updated: Option<chrono::NaiveDateTime>,
23 pub private_key: Option<String>,
24 pub public_key: Option<String>,
25 pub last_refreshed_at: chrono::NaiveDateTime,
26 pub icon: Option<String>,
27 pub banner: Option<String>,
28 pub followers_url: Url,
30 pub shared_inbox_url: Option<Url>,
33 /// A safe representation of community, without the sensitive info
34 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
35 #[table_name = "community"]
36 pub struct CommunitySafe {
40 pub description: Option<String>,
44 pub published: chrono::NaiveDateTime,
45 pub updated: Option<chrono::NaiveDateTime>,
50 pub icon: Option<String>,
51 pub banner: Option<String>,
54 #[derive(Insertable, AsChangeset, Debug)]
55 #[table_name = "community"]
56 pub struct CommunityForm {
59 pub description: Option<String>,
62 pub removed: Option<bool>,
63 pub published: Option<chrono::NaiveDateTime>,
64 pub updated: Option<chrono::NaiveDateTime>,
65 pub deleted: Option<bool>,
67 pub actor_id: Option<Url>,
69 pub private_key: Option<String>,
70 pub public_key: Option<String>,
71 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
72 pub icon: Option<Option<String>>,
73 pub banner: Option<Option<String>>,
74 pub followers_url: Option<Url>,
75 pub inbox_url: Option<Url>,
76 pub shared_inbox_url: Option<Option<Url>>,
79 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
80 #[belongs_to(Community)]
81 #[table_name = "community_moderator"]
82 pub struct CommunityModerator {
84 pub community_id: i32,
86 pub published: chrono::NaiveDateTime,
89 #[derive(Insertable, AsChangeset, Clone)]
90 #[table_name = "community_moderator"]
91 pub struct CommunityModeratorForm {
92 pub community_id: i32,
96 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
97 #[belongs_to(Community)]
98 #[table_name = "community_user_ban"]
99 pub struct CommunityUserBan {
101 pub community_id: i32,
103 pub published: chrono::NaiveDateTime,
106 #[derive(Insertable, AsChangeset, Clone)]
107 #[table_name = "community_user_ban"]
108 pub struct CommunityUserBanForm {
109 pub community_id: i32,
113 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
114 #[belongs_to(Community)]
115 #[table_name = "community_follower"]
116 pub struct CommunityFollower {
118 pub community_id: i32,
120 pub published: chrono::NaiveDateTime,
121 pub pending: Option<bool>,
124 #[derive(Insertable, AsChangeset, Clone)]
125 #[table_name = "community_follower"]
126 pub struct CommunityFollowerForm {
127 pub community_id: i32,