1 use lemmy_db_schema::{CommunityId, PostId};
3 comment_view::CommentView,
4 post_report_view::PostReportView,
7 use lemmy_db_views_actor::{
8 community_moderator_view::CommunityModeratorView,
9 community_view::CommunityView,
11 use serde::{Deserialize, Serialize};
14 #[derive(Deserialize, Debug)]
15 pub struct CreatePost {
18 pub body: Option<String>,
20 pub community_id: CommunityId,
24 #[derive(Serialize, Clone)]
25 pub struct PostResponse {
26 pub post_view: PostView,
29 #[derive(Deserialize)]
32 pub auth: Option<String>,
36 pub struct GetPostResponse {
37 pub post_view: PostView,
38 pub community_view: CommunityView,
39 pub comments: Vec<CommentView>,
40 pub moderators: Vec<CommunityModeratorView>,
44 #[derive(Deserialize, Debug)]
48 pub page: Option<i64>,
49 pub limit: Option<i64>,
50 pub community_id: Option<CommunityId>,
51 pub community_name: Option<String>,
53 pub auth: Option<String>,
56 #[derive(Serialize, Debug)]
57 pub struct GetPostsResponse {
58 pub posts: Vec<PostView>,
61 #[derive(Deserialize)]
62 pub struct CreatePostLike {
68 #[derive(Deserialize)]
73 pub body: Option<String>,
78 #[derive(Deserialize)]
79 pub struct DeletePost {
85 #[derive(Deserialize)]
86 pub struct RemovePost {
89 pub reason: Option<String>,
93 #[derive(Deserialize)]
100 #[derive(Deserialize)]
101 pub struct StickyPost {
107 #[derive(Deserialize)]
108 pub struct SavePost {
114 #[derive(Serialize, Deserialize)]
115 pub struct CreatePostReport {
121 #[derive(Serialize, Deserialize, Clone)]
122 pub struct CreatePostReportResponse {
126 #[derive(Serialize, Deserialize, Debug)]
127 pub struct ResolvePostReport {
133 #[derive(Serialize, Deserialize, Clone, Debug)]
134 pub struct ResolvePostReportResponse {
139 #[derive(Serialize, Deserialize, Debug)]
140 pub struct ListPostReports {
141 pub page: Option<i64>,
142 pub limit: Option<i64>,
143 pub community: Option<CommunityId>,
147 #[derive(Serialize, Clone, Debug)]
148 pub struct ListPostReportsResponse {
149 pub posts: Vec<PostReportView>,