2 aggregates::site_aggregates::SiteAggregates,
4 comment_view::CommentView,
5 community::community_view::CommunityView,
7 mod_add_community_view::ModAddCommunityView,
8 mod_add_view::ModAddView,
9 mod_ban_from_community_view::ModBanFromCommunityView,
10 mod_ban_view::ModBanView,
11 mod_lock_post_view::ModLockPostView,
12 mod_remove_comment_view::ModRemoveCommentView,
13 mod_remove_community_view::ModRemoveCommunityView,
14 mod_remove_post_view::ModRemovePostView,
15 mod_sticky_post_view::ModStickyPostView,
19 user_view::UserViewSafe,
22 use lemmy_db_schema::source::{category::*, user::User_};
23 use serde::{Deserialize, Serialize};
25 #[derive(Deserialize)]
26 pub struct ListCategories {}
29 pub struct ListCategoriesResponse {
30 pub categories: Vec<Category>,
33 #[derive(Deserialize, Debug)]
37 pub community_id: Option<i32>,
38 pub community_name: Option<String>,
40 pub page: Option<i64>,
41 pub limit: Option<i64>,
42 pub auth: Option<String>,
45 #[derive(Serialize, Debug)]
46 pub struct SearchResponse {
48 pub comments: Vec<CommentView>,
49 pub posts: Vec<PostView>,
50 pub communities: Vec<CommunityView>,
51 pub users: Vec<UserViewSafe>,
54 #[derive(Deserialize)]
55 pub struct GetModlog {
56 pub mod_user_id: Option<i32>,
57 pub community_id: Option<i32>,
58 pub page: Option<i64>,
59 pub limit: Option<i64>,
63 pub struct GetModlogResponse {
64 pub removed_posts: Vec<ModRemovePostView>,
65 pub locked_posts: Vec<ModLockPostView>,
66 pub stickied_posts: Vec<ModStickyPostView>,
67 pub removed_comments: Vec<ModRemoveCommentView>,
68 pub removed_communities: Vec<ModRemoveCommunityView>,
69 pub banned_from_community: Vec<ModBanFromCommunityView>,
70 pub banned: Vec<ModBanView>,
71 pub added_to_community: Vec<ModAddCommunityView>,
72 pub added: Vec<ModAddView>,
75 #[derive(Deserialize)]
76 pub struct CreateSite {
78 pub description: Option<String>,
79 pub icon: Option<String>,
80 pub banner: Option<String>,
81 pub enable_downvotes: bool,
82 pub open_registration: bool,
83 pub enable_nsfw: bool,
87 #[derive(Deserialize)]
90 pub description: Option<String>,
91 pub icon: Option<String>,
92 pub banner: Option<String>,
93 pub enable_downvotes: bool,
94 pub open_registration: bool,
95 pub enable_nsfw: bool,
99 #[derive(Deserialize)]
101 pub auth: Option<String>,
104 // TODO combine siteresponse and getsiteresponse
105 #[derive(Serialize, Clone)]
106 pub struct SiteResponse {
111 pub struct GetSiteResponse {
112 pub site: Option<SiteView>, // Because the site might not be set up yet
113 pub counts: SiteAggregates,
114 pub admins: Vec<UserViewSafe>,
115 pub banned: Vec<UserViewSafe>,
118 pub my_user: Option<User_>,
119 pub federated_instances: Vec<String>,
122 #[derive(Deserialize)]
123 pub struct TransferSite {
128 #[derive(Deserialize)]
129 pub struct GetSiteConfig {
134 pub struct GetSiteConfigResponse {
135 pub config_hjson: String,
138 #[derive(Deserialize)]
139 pub struct SaveSiteConfig {
140 pub config_hjson: String,