2 comment_view::CommentView,
3 community::community_view::CommunityView,
5 mod_add_community_view::ModAddCommunityView,
6 mod_add_view::ModAddView,
7 mod_ban_from_community_view::ModBanFromCommunityView,
8 mod_ban_view::ModBanView,
9 mod_lock_post_view::ModLockPostView,
10 mod_remove_comment_view::ModRemoveCommentView,
11 mod_remove_community_view::ModRemoveCommunityView,
12 mod_remove_post_view::ModRemovePostView,
13 mod_sticky_post_view::ModStickyPostView,
17 user_view::UserViewSafe,
19 use lemmy_db_schema::source::{category::*, user::User_};
20 use serde::{Deserialize, Serialize};
22 #[derive(Deserialize)]
23 pub struct ListCategories {}
26 pub struct ListCategoriesResponse {
27 pub categories: Vec<Category>,
30 #[derive(Deserialize, Debug)]
34 pub community_id: Option<i32>,
35 pub community_name: Option<String>,
37 pub page: Option<i64>,
38 pub limit: Option<i64>,
39 pub auth: Option<String>,
42 #[derive(Serialize, Debug)]
43 pub struct SearchResponse {
45 pub comments: Vec<CommentView>,
46 pub posts: Vec<PostView>,
47 pub communities: Vec<CommunityView>,
48 pub users: Vec<UserViewSafe>,
51 #[derive(Deserialize)]
52 pub struct GetModlog {
53 pub mod_user_id: Option<i32>,
54 pub community_id: Option<i32>,
55 pub page: Option<i64>,
56 pub limit: Option<i64>,
60 pub struct GetModlogResponse {
61 pub removed_posts: Vec<ModRemovePostView>,
62 pub locked_posts: Vec<ModLockPostView>,
63 pub stickied_posts: Vec<ModStickyPostView>,
64 pub removed_comments: Vec<ModRemoveCommentView>,
65 pub removed_communities: Vec<ModRemoveCommunityView>,
66 pub banned_from_community: Vec<ModBanFromCommunityView>,
67 pub banned: Vec<ModBanView>,
68 pub added_to_community: Vec<ModAddCommunityView>,
69 pub added: Vec<ModAddView>,
72 #[derive(Deserialize)]
73 pub struct CreateSite {
75 pub description: Option<String>,
76 pub icon: Option<String>,
77 pub banner: Option<String>,
78 pub enable_downvotes: bool,
79 pub open_registration: bool,
80 pub enable_nsfw: bool,
84 #[derive(Deserialize)]
87 pub description: Option<String>,
88 pub icon: Option<String>,
89 pub banner: Option<String>,
90 pub enable_downvotes: bool,
91 pub open_registration: bool,
92 pub enable_nsfw: bool,
96 #[derive(Deserialize)]
98 pub auth: Option<String>,
101 #[derive(Serialize, Clone)]
102 pub struct SiteResponse {
103 pub site_view: SiteView,
107 pub struct GetSiteResponse {
108 pub site_view: Option<SiteView>, // Because the site might not be set up yet
109 pub admins: Vec<UserViewSafe>,
110 pub banned: Vec<UserViewSafe>,
113 pub my_user: Option<User_>,
114 pub federated_instances: Vec<String>,
117 #[derive(Deserialize)]
118 pub struct TransferSite {
123 #[derive(Deserialize)]
124 pub struct GetSiteConfig {
129 pub struct GetSiteConfigResponse {
130 pub config_hjson: String,
133 #[derive(Deserialize)]
134 pub struct SaveSiteConfig {
135 pub config_hjson: String,