1 use lemmy_db_schema::{CommentId, CommunityId, LocalUserId, PostId};
2 use lemmy_db_views::{comment_report_view::CommentReportView, comment_view::CommentView};
3 use serde::{Deserialize, Serialize};
6 pub struct CreateComment {
8 pub parent_id: Option<CommentId>,
10 pub form_id: Option<String>,
14 #[derive(Deserialize)]
15 pub struct EditComment {
17 pub comment_id: CommentId,
18 pub form_id: Option<String>,
22 #[derive(Deserialize)]
23 pub struct DeleteComment {
24 pub comment_id: CommentId,
29 #[derive(Deserialize)]
30 pub struct RemoveComment {
31 pub comment_id: CommentId,
33 pub reason: Option<String>,
37 #[derive(Deserialize)]
38 pub struct MarkCommentAsRead {
39 pub comment_id: CommentId,
44 #[derive(Deserialize)]
45 pub struct SaveComment {
46 pub comment_id: CommentId,
51 #[derive(Serialize, Clone)]
52 pub struct CommentResponse {
53 pub comment_view: CommentView,
54 pub recipient_ids: Vec<LocalUserId>,
55 pub form_id: Option<String>, // An optional front end ID, to tell which is coming back
58 #[derive(Deserialize)]
59 pub struct CreateCommentLike {
60 pub comment_id: CommentId,
65 #[derive(Deserialize)]
66 pub struct GetComments {
69 pub page: Option<i64>,
70 pub limit: Option<i64>,
71 pub community_id: Option<CommunityId>,
72 pub community_name: Option<String>,
74 pub auth: Option<String>,
78 pub struct GetCommentsResponse {
79 pub comments: Vec<CommentView>,
82 #[derive(Serialize, Deserialize)]
83 pub struct CreateCommentReport {
84 pub comment_id: CommentId,
89 #[derive(Serialize, Deserialize, Clone)]
90 pub struct CreateCommentReportResponse {
94 #[derive(Serialize, Deserialize, Debug)]
95 pub struct ResolveCommentReport {
101 #[derive(Serialize, Deserialize, Clone, Debug)]
102 pub struct ResolveCommentReportResponse {
103 // TODO this should probably return the view
108 #[derive(Serialize, Deserialize, Debug)]
109 pub struct ListCommentReports {
110 pub page: Option<i64>,
111 pub limit: Option<i64>,
112 /// if no community is given, it returns reports for all communities moderated by the auth user
113 pub community: Option<CommunityId>,
117 #[derive(Serialize, Clone, Debug)]
118 pub struct ListCommentReportsResponse {
119 pub comments: Vec<CommentReportView>,