3 community_follower_view::CommunityFollowerView,
4 community_moderator_view::CommunityModeratorView,
5 community_view::CommunityView,
7 user_view::UserViewSafe,
9 use serde::{Deserialize, Serialize};
11 #[derive(Deserialize)]
12 pub struct GetCommunity {
14 pub name: Option<String>,
15 pub auth: Option<String>,
19 pub struct GetCommunityResponse {
20 pub community_view: CommunityView,
21 pub moderators: Vec<CommunityModeratorView>,
25 #[derive(Deserialize)]
26 pub struct CreateCommunity {
29 pub description: Option<String>,
30 pub icon: Option<String>,
31 pub banner: Option<String>,
37 #[derive(Serialize, Clone)]
38 pub struct CommunityResponse {
39 pub community_view: CommunityView,
42 #[derive(Deserialize, Debug)]
43 pub struct ListCommunities {
45 pub page: Option<i64>,
46 pub limit: Option<i64>,
47 pub auth: Option<String>,
50 #[derive(Serialize, Debug)]
51 pub struct ListCommunitiesResponse {
52 pub communities: Vec<CommunityView>,
55 #[derive(Deserialize, Clone)]
56 pub struct BanFromCommunity {
57 pub community_id: i32,
60 pub remove_data: bool,
61 pub reason: Option<String>,
62 pub expires: Option<i64>,
66 #[derive(Serialize, Clone)]
67 pub struct BanFromCommunityResponse {
68 pub user_view: UserViewSafe,
72 #[derive(Deserialize)]
73 pub struct AddModToCommunity {
74 pub community_id: i32,
80 #[derive(Serialize, Clone)]
81 pub struct AddModToCommunityResponse {
82 pub moderators: Vec<CommunityModeratorView>,
85 #[derive(Deserialize)]
86 pub struct EditCommunity {
89 pub description: Option<String>,
90 pub icon: Option<String>,
91 pub banner: Option<String>,
97 #[derive(Deserialize)]
98 pub struct DeleteCommunity {
104 #[derive(Deserialize)]
105 pub struct RemoveCommunity {
108 pub reason: Option<String>,
109 pub expires: Option<i64>,
113 #[derive(Deserialize)]
114 pub struct FollowCommunity {
115 pub community_id: i32,
120 #[derive(Deserialize)]
121 pub struct GetFollowedCommunities {
126 pub struct GetFollowedCommunitiesResponse {
127 pub communities: Vec<CommunityFollowerView>,
130 #[derive(Deserialize)]
131 pub struct TransferCommunity {
132 pub community_id: i32,
137 #[derive(Deserialize, Debug)]
138 pub struct CommunityJoin {
139 pub community_id: i32,
142 #[derive(Serialize, Clone)]
143 pub struct CommunityJoinResponse {
147 #[derive(Deserialize, Debug)]
149 pub community_id: i32,
152 #[derive(Serialize, Clone)]
153 pub struct ModJoinResponse {