use lemmy_db::{ category::*, comment_view::*, community_view::*, moderator_views::*, post_view::*, site_view::*, user::*, user_view::*, }; use serde::{Deserialize, Serialize}; #[derive(Deserialize)] pub struct ListCategories {} #[derive(Serialize)] pub struct ListCategoriesResponse { pub categories: Vec, } #[derive(Deserialize, Debug)] pub struct Search { pub q: String, pub type_: String, pub community_id: Option, pub sort: String, pub page: Option, pub limit: Option, pub auth: Option, } #[derive(Serialize, Debug)] pub struct SearchResponse { pub type_: String, pub comments: Vec, pub posts: Vec, pub communities: Vec, pub users: Vec, } #[derive(Deserialize)] pub struct GetModlog { pub mod_user_id: Option, pub community_id: Option, pub page: Option, pub limit: Option, } #[derive(Serialize)] pub struct GetModlogResponse { pub removed_posts: Vec, pub locked_posts: Vec, pub stickied_posts: Vec, pub removed_comments: Vec, pub removed_communities: Vec, pub banned_from_community: Vec, pub banned: Vec, pub added_to_community: Vec, pub added: Vec, } #[derive(Deserialize)] pub struct CreateSite { pub name: String, pub description: Option, pub icon: Option, pub banner: Option, pub enable_downvotes: bool, pub open_registration: bool, pub enable_nsfw: bool, pub auth: String, } #[derive(Deserialize)] pub struct EditSite { pub name: String, pub description: Option, pub icon: Option, pub banner: Option, pub enable_downvotes: bool, pub open_registration: bool, pub enable_nsfw: bool, pub auth: String, } #[derive(Deserialize)] pub struct GetSite { pub auth: Option, } #[derive(Serialize, Clone)] pub struct SiteResponse { pub site: SiteView, } #[derive(Serialize)] pub struct GetSiteResponse { pub site: Option, pub admins: Vec, pub banned: Vec, pub online: usize, pub version: String, pub my_user: Option, pub federated_instances: Vec, } #[derive(Deserialize)] pub struct TransferSite { pub user_id: i32, pub auth: String, } #[derive(Deserialize)] pub struct GetSiteConfig { pub auth: String, } #[derive(Serialize)] pub struct GetSiteConfigResponse { pub config_hjson: String, } #[derive(Deserialize)] pub struct SaveSiteConfig { pub config_hjson: String, pub auth: String, }