mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 11:21:02 +00:00
Add both (De)Serialize to all models (#1851)
This commit is contained in:
parent
97aa7268ae
commit
aef9786fa7
47 changed files with 237 additions and 215 deletions
|
@ -2,7 +2,7 @@ use lemmy_db_schema::{CommentId, CommentReportId, CommunityId, LocalUserId, Post
|
||||||
use lemmy_db_views::{comment_report_view::CommentReportView, comment_view::CommentView};
|
use lemmy_db_views::{comment_report_view::CommentReportView, comment_view::CommentView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreateComment {
|
pub struct CreateComment {
|
||||||
pub content: String,
|
pub content: String,
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
|
@ -11,7 +11,7 @@ pub struct CreateComment {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct EditComment {
|
pub struct EditComment {
|
||||||
pub content: String,
|
pub content: String,
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
|
@ -19,14 +19,14 @@ pub struct EditComment {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct DeleteComment {
|
pub struct DeleteComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct RemoveComment {
|
pub struct RemoveComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub removed: bool,
|
pub removed: bool,
|
||||||
|
@ -34,35 +34,35 @@ pub struct RemoveComment {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct MarkCommentAsRead {
|
pub struct MarkCommentAsRead {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct SaveComment {
|
pub struct SaveComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub save: bool,
|
pub save: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct CommentResponse {
|
pub struct CommentResponse {
|
||||||
pub comment_view: CommentView,
|
pub comment_view: CommentView,
|
||||||
pub recipient_ids: Vec<LocalUserId>,
|
pub recipient_ids: Vec<LocalUserId>,
|
||||||
pub form_id: Option<String>, // An optional front end ID, to tell which is coming back
|
pub form_id: Option<String>, // An optional front end ID, to tell which is coming back
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreateCommentLike {
|
pub struct CreateCommentLike {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub score: i16,
|
pub score: i16,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetComments {
|
pub struct GetComments {
|
||||||
pub type_: Option<String>,
|
pub type_: Option<String>,
|
||||||
pub sort: Option<String>,
|
pub sort: Option<String>,
|
||||||
|
@ -74,31 +74,31 @@ pub struct GetComments {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetCommentsResponse {
|
pub struct GetCommentsResponse {
|
||||||
pub comments: Vec<CommentView>,
|
pub comments: Vec<CommentView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreateCommentReport {
|
pub struct CreateCommentReport {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub reason: String,
|
pub reason: String,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct CommentReportResponse {
|
pub struct CommentReportResponse {
|
||||||
pub comment_report_view: CommentReportView,
|
pub comment_report_view: CommentReportView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ResolveCommentReport {
|
pub struct ResolveCommentReport {
|
||||||
pub report_id: CommentReportId,
|
pub report_id: CommentReportId,
|
||||||
pub resolved: bool,
|
pub resolved: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ListCommentReports {
|
pub struct ListCommentReports {
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
|
@ -109,7 +109,7 @@ pub struct ListCommentReports {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ListCommentReportsResponse {
|
pub struct ListCommentReportsResponse {
|
||||||
pub comment_reports: Vec<CommentReportView>,
|
pub comment_reports: Vec<CommentReportView>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ use lemmy_db_views_actor::{
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetCommunity {
|
pub struct GetCommunity {
|
||||||
pub id: Option<CommunityId>,
|
pub id: Option<CommunityId>,
|
||||||
/// Example: star_trek , or star_trek@xyz.tld
|
/// Example: star_trek , or star_trek@xyz.tld
|
||||||
|
@ -14,14 +14,14 @@ pub struct GetCommunity {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetCommunityResponse {
|
pub struct GetCommunityResponse {
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
pub moderators: Vec<CommunityModeratorView>,
|
pub moderators: Vec<CommunityModeratorView>,
|
||||||
pub online: usize,
|
pub online: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreateCommunity {
|
pub struct CreateCommunity {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub title: String,
|
pub title: String,
|
||||||
|
@ -32,12 +32,12 @@ pub struct CreateCommunity {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityResponse {
|
pub struct CommunityResponse {
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct ListCommunities {
|
pub struct ListCommunities {
|
||||||
pub type_: Option<String>,
|
pub type_: Option<String>,
|
||||||
pub sort: Option<String>,
|
pub sort: Option<String>,
|
||||||
|
@ -46,12 +46,12 @@ pub struct ListCommunities {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct ListCommunitiesResponse {
|
pub struct ListCommunitiesResponse {
|
||||||
pub communities: Vec<CommunityView>,
|
pub communities: Vec<CommunityView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct BanFromCommunity {
|
pub struct BanFromCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
@ -62,13 +62,13 @@ pub struct BanFromCommunity {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct BanFromCommunityResponse {
|
pub struct BanFromCommunityResponse {
|
||||||
pub person_view: PersonViewSafe,
|
pub person_view: PersonViewSafe,
|
||||||
pub banned: bool,
|
pub banned: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct AddModToCommunity {
|
pub struct AddModToCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
@ -76,12 +76,12 @@ pub struct AddModToCommunity {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct AddModToCommunityResponse {
|
pub struct AddModToCommunityResponse {
|
||||||
pub moderators: Vec<CommunityModeratorView>,
|
pub moderators: Vec<CommunityModeratorView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct EditCommunity {
|
pub struct EditCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
|
@ -92,14 +92,14 @@ pub struct EditCommunity {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct DeleteCommunity {
|
pub struct DeleteCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct RemoveCommunity {
|
pub struct RemoveCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub removed: bool,
|
pub removed: bool,
|
||||||
|
@ -108,27 +108,27 @@ pub struct RemoveCommunity {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct FollowCommunity {
|
pub struct FollowCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub follow: bool,
|
pub follow: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct BlockCommunity {
|
pub struct BlockCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub block: bool,
|
pub block: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct BlockCommunityResponse {
|
pub struct BlockCommunityResponse {
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
pub blocked: bool,
|
pub blocked: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct TransferCommunity {
|
pub struct TransferCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
|
|
@ -10,14 +10,14 @@ use lemmy_db_views_actor::{
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct Login {
|
pub struct Login {
|
||||||
pub username_or_email: String,
|
pub username_or_email: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
}
|
}
|
||||||
use lemmy_db_schema::{CommunityId, PersonId, PersonMentionId, PrivateMessageId};
|
use lemmy_db_schema::{CommunityId, PersonId, PersonMentionId, PrivateMessageId};
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct Register {
|
pub struct Register {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
@ -29,22 +29,22 @@ pub struct Register {
|
||||||
pub honeypot: Option<String>,
|
pub honeypot: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetCaptcha {}
|
pub struct GetCaptcha {}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetCaptchaResponse {
|
pub struct GetCaptchaResponse {
|
||||||
pub ok: Option<CaptchaResponse>, // Will be None if captchas are disabled
|
pub ok: Option<CaptchaResponse>, // Will be None if captchas are disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CaptchaResponse {
|
pub struct CaptchaResponse {
|
||||||
pub png: String, // A Base64 encoded png
|
pub png: String, // A Base64 encoded png
|
||||||
pub wav: String, // A Base64 encoded wav audio
|
pub wav: String, // A Base64 encoded wav audio
|
||||||
pub uuid: String,
|
pub uuid: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct SaveUserSettings {
|
pub struct SaveUserSettings {
|
||||||
pub show_nsfw: Option<bool>,
|
pub show_nsfw: Option<bool>,
|
||||||
pub show_scores: Option<bool>,
|
pub show_scores: Option<bool>,
|
||||||
|
@ -67,7 +67,7 @@ pub struct SaveUserSettings {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ChangePassword {
|
pub struct ChangePassword {
|
||||||
pub new_password: String,
|
pub new_password: String,
|
||||||
pub new_password_verify: String,
|
pub new_password_verify: String,
|
||||||
|
@ -75,12 +75,12 @@ pub struct ChangePassword {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct LoginResponse {
|
pub struct LoginResponse {
|
||||||
pub jwt: String,
|
pub jwt: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPersonDetails {
|
pub struct GetPersonDetails {
|
||||||
pub person_id: Option<PersonId>, // One of these two are required
|
pub person_id: Option<PersonId>, // One of these two are required
|
||||||
/// Example: dessalines , or dessalines@xyz.tld
|
/// Example: dessalines , or dessalines@xyz.tld
|
||||||
|
@ -93,7 +93,7 @@ pub struct GetPersonDetails {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPersonDetailsResponse {
|
pub struct GetPersonDetailsResponse {
|
||||||
pub person_view: PersonViewSafe,
|
pub person_view: PersonViewSafe,
|
||||||
pub comments: Vec<CommentView>,
|
pub comments: Vec<CommentView>,
|
||||||
|
@ -101,34 +101,34 @@ pub struct GetPersonDetailsResponse {
|
||||||
pub moderates: Vec<CommunityModeratorView>,
|
pub moderates: Vec<CommunityModeratorView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetRepliesResponse {
|
pub struct GetRepliesResponse {
|
||||||
pub replies: Vec<CommentView>,
|
pub replies: Vec<CommentView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPersonMentionsResponse {
|
pub struct GetPersonMentionsResponse {
|
||||||
pub mentions: Vec<PersonMentionView>,
|
pub mentions: Vec<PersonMentionView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct MarkAllAsRead {
|
pub struct MarkAllAsRead {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct AddAdmin {
|
pub struct AddAdmin {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub added: bool,
|
pub added: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct AddAdminResponse {
|
pub struct AddAdminResponse {
|
||||||
pub admins: Vec<PersonViewSafe>,
|
pub admins: Vec<PersonViewSafe>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct BanPerson {
|
pub struct BanPerson {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub ban: bool,
|
pub ban: bool,
|
||||||
|
@ -138,26 +138,26 @@ pub struct BanPerson {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct BanPersonResponse {
|
pub struct BanPersonResponse {
|
||||||
pub person_view: PersonViewSafe,
|
pub person_view: PersonViewSafe,
|
||||||
pub banned: bool,
|
pub banned: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct BlockPerson {
|
pub struct BlockPerson {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub block: bool,
|
pub block: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct BlockPersonResponse {
|
pub struct BlockPersonResponse {
|
||||||
pub person_view: PersonViewSafe,
|
pub person_view: PersonViewSafe,
|
||||||
pub blocked: bool,
|
pub blocked: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetReplies {
|
pub struct GetReplies {
|
||||||
pub sort: Option<String>,
|
pub sort: Option<String>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
@ -166,7 +166,7 @@ pub struct GetReplies {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPersonMentions {
|
pub struct GetPersonMentions {
|
||||||
pub sort: Option<String>,
|
pub sort: Option<String>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
@ -175,68 +175,68 @@ pub struct GetPersonMentions {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct MarkPersonMentionAsRead {
|
pub struct MarkPersonMentionAsRead {
|
||||||
pub person_mention_id: PersonMentionId,
|
pub person_mention_id: PersonMentionId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PersonMentionResponse {
|
pub struct PersonMentionResponse {
|
||||||
pub person_mention_view: PersonMentionView,
|
pub person_mention_view: PersonMentionView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct DeleteAccount {
|
pub struct DeleteAccount {
|
||||||
pub password: String,
|
pub password: String,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct PasswordReset {
|
pub struct PasswordReset {
|
||||||
pub email: String,
|
pub email: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PasswordResetResponse {}
|
pub struct PasswordResetResponse {}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct PasswordChange {
|
pub struct PasswordChange {
|
||||||
pub token: String,
|
pub token: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
pub password_verify: String,
|
pub password_verify: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreatePrivateMessage {
|
pub struct CreatePrivateMessage {
|
||||||
pub content: String,
|
pub content: String,
|
||||||
pub recipient_id: PersonId,
|
pub recipient_id: PersonId,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct EditPrivateMessage {
|
pub struct EditPrivateMessage {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub content: String,
|
pub content: String,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct DeletePrivateMessage {
|
pub struct DeletePrivateMessage {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct MarkPrivateMessageAsRead {
|
pub struct MarkPrivateMessageAsRead {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPrivateMessages {
|
pub struct GetPrivateMessages {
|
||||||
pub unread_only: Option<bool>,
|
pub unread_only: Option<bool>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
@ -244,35 +244,35 @@ pub struct GetPrivateMessages {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PrivateMessagesResponse {
|
pub struct PrivateMessagesResponse {
|
||||||
pub private_messages: Vec<PrivateMessageView>,
|
pub private_messages: Vec<PrivateMessageView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PrivateMessageResponse {
|
pub struct PrivateMessageResponse {
|
||||||
pub private_message_view: PrivateMessageView,
|
pub private_message_view: PrivateMessageView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetReportCount {
|
pub struct GetReportCount {
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct GetReportCountResponse {
|
pub struct GetReportCountResponse {
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub comment_reports: i64,
|
pub comment_reports: i64,
|
||||||
pub post_reports: i64,
|
pub post_reports: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetUnreadCount {
|
pub struct GetUnreadCount {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct GetUnreadCountResponse {
|
pub struct GetUnreadCountResponse {
|
||||||
pub replies: i64,
|
pub replies: i64,
|
||||||
pub mentions: i64,
|
pub mentions: i64,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use lemmy_utils::request::SiteMetadata;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct CreatePost {
|
pub struct CreatePost {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
|
@ -23,18 +23,18 @@ pub struct CreatePost {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PostResponse {
|
pub struct PostResponse {
|
||||||
pub post_view: PostView,
|
pub post_view: PostView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPost {
|
pub struct GetPost {
|
||||||
pub id: PostId,
|
pub id: PostId,
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetPostResponse {
|
pub struct GetPostResponse {
|
||||||
pub post_view: PostView,
|
pub post_view: PostView,
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
|
@ -43,7 +43,7 @@ pub struct GetPostResponse {
|
||||||
pub online: usize,
|
pub online: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GetPosts {
|
pub struct GetPosts {
|
||||||
pub type_: Option<String>,
|
pub type_: Option<String>,
|
||||||
pub sort: Option<String>,
|
pub sort: Option<String>,
|
||||||
|
@ -55,19 +55,19 @@ pub struct GetPosts {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GetPostsResponse {
|
pub struct GetPostsResponse {
|
||||||
pub posts: Vec<PostView>,
|
pub posts: Vec<PostView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreatePostLike {
|
pub struct CreatePostLike {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub score: i16,
|
pub score: i16,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct EditPost {
|
pub struct EditPost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
|
@ -77,14 +77,14 @@ pub struct EditPost {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct DeletePost {
|
pub struct DeletePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct RemovePost {
|
pub struct RemovePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub removed: bool,
|
pub removed: bool,
|
||||||
|
@ -92,47 +92,47 @@ pub struct RemovePost {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct LockPost {
|
pub struct LockPost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub locked: bool,
|
pub locked: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct StickyPost {
|
pub struct StickyPost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub stickied: bool,
|
pub stickied: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct SavePost {
|
pub struct SavePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub save: bool,
|
pub save: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreatePostReport {
|
pub struct CreatePostReport {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub reason: String,
|
pub reason: String,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PostReportResponse {
|
pub struct PostReportResponse {
|
||||||
pub post_report_view: PostReportView,
|
pub post_report_view: PostReportView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ResolvePostReport {
|
pub struct ResolvePostReport {
|
||||||
pub report_id: PostReportId,
|
pub report_id: PostReportId,
|
||||||
pub resolved: bool,
|
pub resolved: bool,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ListPostReports {
|
pub struct ListPostReports {
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
|
@ -143,17 +143,17 @@ pub struct ListPostReports {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ListPostReportsResponse {
|
pub struct ListPostReportsResponse {
|
||||||
pub post_reports: Vec<PostReportView>,
|
pub post_reports: Vec<PostReportView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GetSiteMetadata {
|
pub struct GetSiteMetadata {
|
||||||
pub url: Url,
|
pub url: Url,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone, Debug)]
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||||
pub struct GetSiteMetadataResponse {
|
pub struct GetSiteMetadataResponse {
|
||||||
pub metadata: SiteMetadata,
|
pub metadata: SiteMetadata,
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ use lemmy_db_views_moderator::{
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct Search {
|
pub struct Search {
|
||||||
pub q: String,
|
pub q: String,
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
|
@ -41,7 +41,7 @@ pub struct Search {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct SearchResponse {
|
pub struct SearchResponse {
|
||||||
pub type_: String,
|
pub type_: String,
|
||||||
pub comments: Vec<CommentView>,
|
pub comments: Vec<CommentView>,
|
||||||
|
@ -50,13 +50,13 @@ pub struct SearchResponse {
|
||||||
pub users: Vec<PersonViewSafe>,
|
pub users: Vec<PersonViewSafe>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct ResolveObject {
|
pub struct ResolveObject {
|
||||||
pub q: String,
|
pub q: String,
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Default)]
|
#[derive(Serialize, Deserialize, Default)]
|
||||||
pub struct ResolveObjectResponse {
|
pub struct ResolveObjectResponse {
|
||||||
pub comment: Option<CommentView>,
|
pub comment: Option<CommentView>,
|
||||||
pub post: Option<PostView>,
|
pub post: Option<PostView>,
|
||||||
|
@ -64,7 +64,7 @@ pub struct ResolveObjectResponse {
|
||||||
pub person: Option<PersonViewSafe>,
|
pub person: Option<PersonViewSafe>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetModlog {
|
pub struct GetModlog {
|
||||||
pub mod_person_id: Option<PersonId>,
|
pub mod_person_id: Option<PersonId>,
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
|
@ -72,7 +72,7 @@ pub struct GetModlog {
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetModlogResponse {
|
pub struct GetModlogResponse {
|
||||||
pub removed_posts: Vec<ModRemovePostView>,
|
pub removed_posts: Vec<ModRemovePostView>,
|
||||||
pub locked_posts: Vec<ModLockPostView>,
|
pub locked_posts: Vec<ModLockPostView>,
|
||||||
|
@ -86,7 +86,7 @@ pub struct GetModlogResponse {
|
||||||
pub added: Vec<ModAddView>,
|
pub added: Vec<ModAddView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CreateSite {
|
pub struct CreateSite {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub sidebar: Option<String>,
|
pub sidebar: Option<String>,
|
||||||
|
@ -100,7 +100,7 @@ pub struct CreateSite {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct EditSite {
|
pub struct EditSite {
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
pub sidebar: Option<String>,
|
pub sidebar: Option<String>,
|
||||||
|
@ -114,17 +114,17 @@ pub struct EditSite {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetSite {
|
pub struct GetSite {
|
||||||
pub auth: Option<String>,
|
pub auth: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct SiteResponse {
|
pub struct SiteResponse {
|
||||||
pub site_view: SiteView,
|
pub site_view: SiteView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetSiteResponse {
|
pub struct GetSiteResponse {
|
||||||
pub site_view: Option<SiteView>, // Because the site might not be set up yet
|
pub site_view: Option<SiteView>, // Because the site might not be set up yet
|
||||||
pub admins: Vec<PersonViewSafe>,
|
pub admins: Vec<PersonViewSafe>,
|
||||||
|
@ -135,7 +135,7 @@ pub struct GetSiteResponse {
|
||||||
pub federated_instances: Option<FederatedInstances>, // Federation may be disabled
|
pub federated_instances: Option<FederatedInstances>, // Federation may be disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct MyUserInfo {
|
pub struct MyUserInfo {
|
||||||
pub local_user_view: LocalUserSettingsView,
|
pub local_user_view: LocalUserSettingsView,
|
||||||
pub follows: Vec<CommunityFollowerView>,
|
pub follows: Vec<CommunityFollowerView>,
|
||||||
|
@ -144,29 +144,29 @@ pub struct MyUserInfo {
|
||||||
pub person_blocks: Vec<PersonBlockView>,
|
pub person_blocks: Vec<PersonBlockView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct TransferSite {
|
pub struct TransferSite {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetSiteConfig {
|
pub struct GetSiteConfig {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct GetSiteConfigResponse {
|
pub struct GetSiteConfigResponse {
|
||||||
pub config_hjson: String,
|
pub config_hjson: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct SaveSiteConfig {
|
pub struct SaveSiteConfig {
|
||||||
pub config_hjson: String,
|
pub config_hjson: String,
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct FederatedInstances {
|
pub struct FederatedInstances {
|
||||||
pub linked: Vec<String>,
|
pub linked: Vec<String>,
|
||||||
pub allowed: Option<Vec<String>>,
|
pub allowed: Option<Vec<String>>,
|
||||||
|
|
|
@ -1,42 +1,42 @@
|
||||||
use lemmy_db_schema::{CommunityId, PostId};
|
use lemmy_db_schema::{CommunityId, PostId};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct UserJoin {
|
pub struct UserJoin {
|
||||||
pub auth: String,
|
pub auth: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct UserJoinResponse {
|
pub struct UserJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct CommunityJoin {
|
pub struct CommunityJoin {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityJoinResponse {
|
pub struct CommunityJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct ModJoin {
|
pub struct ModJoin {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct ModJoinResponse {
|
pub struct ModJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct PostJoin {
|
pub struct PostJoin {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct PostJoinResponse {
|
pub struct PostJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use lemmy_db_schema::{schema::comment_aggregates, CommentId};
|
use lemmy_db_schema::{schema::comment_aggregates, CommentId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
|
#[derive(
|
||||||
|
Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize, Clone,
|
||||||
|
)]
|
||||||
#[table_name = "comment_aggregates"]
|
#[table_name = "comment_aggregates"]
|
||||||
pub struct CommentAggregates {
|
pub struct CommentAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use lemmy_db_schema::{schema::community_aggregates, CommunityId};
|
use lemmy_db_schema::{schema::community_aggregates, CommunityId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
|
#[derive(
|
||||||
|
Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize, Clone,
|
||||||
|
)]
|
||||||
#[table_name = "community_aggregates"]
|
#[table_name = "community_aggregates"]
|
||||||
pub struct CommunityAggregates {
|
pub struct CommunityAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use lemmy_db_schema::{schema::person_aggregates, PersonId};
|
use lemmy_db_schema::{schema::person_aggregates, PersonId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
|
#[derive(
|
||||||
|
Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize, Clone,
|
||||||
|
)]
|
||||||
#[table_name = "person_aggregates"]
|
#[table_name = "person_aggregates"]
|
||||||
pub struct PersonAggregates {
|
pub struct PersonAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use lemmy_db_schema::{schema::post_aggregates, PostId};
|
use lemmy_db_schema::{schema::post_aggregates, PostId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
|
#[derive(
|
||||||
|
Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize, Clone,
|
||||||
|
)]
|
||||||
#[table_name = "post_aggregates"]
|
#[table_name = "post_aggregates"]
|
||||||
pub struct PostAggregates {
|
pub struct PostAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use lemmy_db_schema::schema::site_aggregates;
|
use lemmy_db_schema::schema::site_aggregates;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
|
#[derive(
|
||||||
|
Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize, Clone,
|
||||||
|
)]
|
||||||
#[table_name = "site_aggregates"]
|
#[table_name = "site_aggregates"]
|
||||||
pub struct SiteAggregates {
|
pub struct SiteAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use chrono::NaiveDateTime;
|
||||||
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
||||||
use lemmy_apub_lib::traits::ApubObject;
|
use lemmy_apub_lib::traits::ApubObject;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
// WITH RECURSIVE MyTree AS (
|
// WITH RECURSIVE MyTree AS (
|
||||||
|
@ -20,7 +20,9 @@ use url::Url;
|
||||||
// )
|
// )
|
||||||
// SELECT * FROM MyTree;
|
// SELECT * FROM MyTree;
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(
|
||||||
|
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
|
||||||
|
)]
|
||||||
#[belongs_to(Post)]
|
#[belongs_to(Post)]
|
||||||
#[table_name = "comment"]
|
#[table_name = "comment"]
|
||||||
pub struct Comment {
|
pub struct Comment {
|
||||||
|
@ -38,7 +40,9 @@ pub struct Comment {
|
||||||
pub local: bool,
|
pub local: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(
|
||||||
|
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
|
||||||
|
)]
|
||||||
#[belongs_to(Post)]
|
#[belongs_to(Post)]
|
||||||
#[table_name = "comment_alias_1"]
|
#[table_name = "comment_alias_1"]
|
||||||
pub struct CommentAlias1 {
|
pub struct CommentAlias1 {
|
||||||
|
|
|
@ -8,10 +8,10 @@ use chrono::NaiveDateTime;
|
||||||
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
||||||
use lemmy_apub_lib::traits::{ActorType, ApubObject};
|
use lemmy_apub_lib::traits::{ActorType, ApubObject};
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "community"]
|
#[table_name = "community"]
|
||||||
pub struct Community {
|
pub struct Community {
|
||||||
pub id: CommunityId,
|
pub id: CommunityId,
|
||||||
|
@ -36,7 +36,7 @@ pub struct Community {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A safe representation of community, without the sensitive info
|
/// A safe representation of community, without the sensitive info
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "community"]
|
#[table_name = "community"]
|
||||||
pub struct CommunitySafe {
|
pub struct CommunitySafe {
|
||||||
pub id: CommunityId,
|
pub id: CommunityId,
|
||||||
|
|
|
@ -5,9 +5,11 @@ use crate::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(
|
||||||
|
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
|
||||||
|
)]
|
||||||
#[table_name = "community_block"]
|
#[table_name = "community_block"]
|
||||||
#[belongs_to(Community)]
|
#[belongs_to(Community)]
|
||||||
pub struct CommunityBlock {
|
pub struct CommunityBlock {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{schema::local_user, LocalUserId, PersonId};
|
use crate::{schema::local_user, LocalUserId, PersonId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "local_user"]
|
#[table_name = "local_user"]
|
||||||
pub struct LocalUser {
|
pub struct LocalUser {
|
||||||
pub id: LocalUserId,
|
pub id: LocalUserId,
|
||||||
|
@ -43,7 +43,7 @@ pub struct LocalUserForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A local user view that removes password encrypted
|
/// A local user view that removes password encrypted
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "local_user"]
|
#[table_name = "local_user"]
|
||||||
pub struct LocalUserSettings {
|
pub struct LocalUserSettings {
|
||||||
pub id: LocalUserId,
|
pub id: LocalUserId,
|
||||||
|
|
|
@ -16,9 +16,9 @@ use crate::{
|
||||||
PersonId,
|
PersonId,
|
||||||
PostId,
|
PostId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_remove_post"]
|
#[table_name = "mod_remove_post"]
|
||||||
pub struct ModRemovePost {
|
pub struct ModRemovePost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -38,7 +38,7 @@ pub struct ModRemovePostForm {
|
||||||
pub removed: Option<bool>,
|
pub removed: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_lock_post"]
|
#[table_name = "mod_lock_post"]
|
||||||
pub struct ModLockPost {
|
pub struct ModLockPost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -56,7 +56,7 @@ pub struct ModLockPostForm {
|
||||||
pub locked: Option<bool>,
|
pub locked: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_sticky_post"]
|
#[table_name = "mod_sticky_post"]
|
||||||
pub struct ModStickyPost {
|
pub struct ModStickyPost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -74,7 +74,7 @@ pub struct ModStickyPostForm {
|
||||||
pub stickied: Option<bool>,
|
pub stickied: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_remove_comment"]
|
#[table_name = "mod_remove_comment"]
|
||||||
pub struct ModRemoveComment {
|
pub struct ModRemoveComment {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -94,7 +94,7 @@ pub struct ModRemoveCommentForm {
|
||||||
pub removed: Option<bool>,
|
pub removed: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_remove_community"]
|
#[table_name = "mod_remove_community"]
|
||||||
pub struct ModRemoveCommunity {
|
pub struct ModRemoveCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -116,7 +116,7 @@ pub struct ModRemoveCommunityForm {
|
||||||
pub expires: Option<chrono::NaiveDateTime>,
|
pub expires: Option<chrono::NaiveDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_ban_from_community"]
|
#[table_name = "mod_ban_from_community"]
|
||||||
pub struct ModBanFromCommunity {
|
pub struct ModBanFromCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -140,7 +140,7 @@ pub struct ModBanFromCommunityForm {
|
||||||
pub expires: Option<chrono::NaiveDateTime>,
|
pub expires: Option<chrono::NaiveDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_ban"]
|
#[table_name = "mod_ban"]
|
||||||
pub struct ModBan {
|
pub struct ModBan {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -162,7 +162,7 @@ pub struct ModBanForm {
|
||||||
pub expires: Option<chrono::NaiveDateTime>,
|
pub expires: Option<chrono::NaiveDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_add_community"]
|
#[table_name = "mod_add_community"]
|
||||||
pub struct ModAddCommunity {
|
pub struct ModAddCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -182,7 +182,7 @@ pub struct ModAddCommunityForm {
|
||||||
pub removed: Option<bool>,
|
pub removed: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_transfer_community"]
|
#[table_name = "mod_transfer_community"]
|
||||||
pub struct ModTransferCommunity {
|
pub struct ModTransferCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -202,7 +202,7 @@ pub struct ModTransferCommunityForm {
|
||||||
pub removed: Option<bool>,
|
pub removed: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "mod_add"]
|
#[table_name = "mod_add"]
|
||||||
pub struct ModAdd {
|
pub struct ModAdd {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -7,10 +7,10 @@ use chrono::NaiveDateTime;
|
||||||
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
||||||
use lemmy_apub_lib::traits::{ActorType, ApubObject};
|
use lemmy_apub_lib::traits::{ActorType, ApubObject};
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "person"]
|
#[table_name = "person"]
|
||||||
pub struct Person {
|
pub struct Person {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
|
@ -36,7 +36,7 @@ pub struct Person {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A safe representation of person, without the sensitive info
|
/// A safe representation of person, without the sensitive info
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "person"]
|
#[table_name = "person"]
|
||||||
pub struct PersonSafe {
|
pub struct PersonSafe {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
|
@ -58,7 +58,7 @@ pub struct PersonSafe {
|
||||||
pub bot_account: bool,
|
pub bot_account: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "person_alias_1"]
|
#[table_name = "person_alias_1"]
|
||||||
pub struct PersonAlias1 {
|
pub struct PersonAlias1 {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
|
@ -83,7 +83,7 @@ pub struct PersonAlias1 {
|
||||||
pub bot_account: bool,
|
pub bot_account: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "person_alias_1"]
|
#[table_name = "person_alias_1"]
|
||||||
pub struct PersonSafeAlias1 {
|
pub struct PersonSafeAlias1 {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
|
@ -105,7 +105,7 @@ pub struct PersonSafeAlias1 {
|
||||||
pub bot_account: bool,
|
pub bot_account: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "person_alias_2"]
|
#[table_name = "person_alias_2"]
|
||||||
pub struct PersonAlias2 {
|
pub struct PersonAlias2 {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
|
@ -130,7 +130,7 @@ pub struct PersonAlias2 {
|
||||||
pub bot_account: bool,
|
pub bot_account: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "person_alias_1"]
|
#[table_name = "person_alias_1"]
|
||||||
pub struct PersonSafeAlias2 {
|
pub struct PersonSafeAlias2 {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::{schema::person_block, PersonBlockId, PersonId};
|
use crate::{schema::person_block, PersonBlockId, PersonId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(
|
||||||
|
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
|
||||||
|
)]
|
||||||
#[table_name = "person_block"]
|
#[table_name = "person_block"]
|
||||||
pub struct PersonBlock {
|
pub struct PersonBlock {
|
||||||
pub id: PersonBlockId,
|
pub id: PersonBlockId,
|
||||||
|
|
|
@ -5,9 +5,11 @@ use crate::{
|
||||||
PersonId,
|
PersonId,
|
||||||
PersonMentionId,
|
PersonMentionId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(
|
||||||
|
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
|
||||||
|
)]
|
||||||
#[belongs_to(Comment)]
|
#[belongs_to(Comment)]
|
||||||
#[table_name = "person_mention"]
|
#[table_name = "person_mention"]
|
||||||
pub struct PersonMention {
|
pub struct PersonMention {
|
||||||
|
|
|
@ -9,10 +9,10 @@ use chrono::NaiveDateTime;
|
||||||
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
||||||
use lemmy_apub_lib::traits::ApubObject;
|
use lemmy_apub_lib::traits::ApubObject;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[table_name = "post"]
|
#[table_name = "post"]
|
||||||
pub struct Post {
|
pub struct Post {
|
||||||
pub id: PostId,
|
pub id: PostId,
|
||||||
|
|
|
@ -3,10 +3,12 @@ use chrono::NaiveDateTime;
|
||||||
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
|
||||||
use lemmy_apub_lib::traits::ApubObject;
|
use lemmy_apub_lib::traits::ApubObject;
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(
|
||||||
|
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
|
||||||
|
)]
|
||||||
#[table_name = "private_message"]
|
#[table_name = "private_message"]
|
||||||
pub struct PrivateMessage {
|
pub struct PrivateMessage {
|
||||||
pub id: PrivateMessageId,
|
pub id: PrivateMessageId,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{schema::site, DbUrl, PersonId};
|
use crate::{schema::site, DbUrl, PersonId};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Queryable, Identifiable, PartialEq, Debug, Clone, Serialize)]
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[table_name = "site"]
|
#[table_name = "site"]
|
||||||
pub struct Site {
|
pub struct Site {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -31,9 +31,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Clone)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommentReportView {
|
pub struct CommentReportView {
|
||||||
pub comment_report: CommentReport,
|
pub comment_report: CommentReport,
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
|
|
|
@ -39,9 +39,9 @@ use lemmy_db_schema::{
|
||||||
PersonId,
|
PersonId,
|
||||||
PostId,
|
PostId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Clone)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommentView {
|
pub struct CommentView {
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
pub creator: PersonSafe,
|
pub creator: PersonSafe,
|
||||||
|
|
|
@ -9,9 +9,9 @@ use lemmy_db_schema::{
|
||||||
LocalUserId,
|
LocalUserId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct LocalUserView {
|
pub struct LocalUserView {
|
||||||
pub local_user: LocalUser,
|
pub local_user: LocalUser,
|
||||||
pub person: Person,
|
pub person: Person,
|
||||||
|
@ -117,7 +117,7 @@ impl LocalUserView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct LocalUserSettingsView {
|
pub struct LocalUserSettingsView {
|
||||||
pub local_user: LocalUserSettings,
|
pub local_user: LocalUserSettings,
|
||||||
pub person: PersonSafe,
|
pub person: PersonSafe,
|
||||||
|
|
|
@ -29,9 +29,9 @@ use lemmy_db_schema::{
|
||||||
PersonId,
|
PersonId,
|
||||||
PostReportId,
|
PostReportId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Clone)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
pub struct PostReportView {
|
pub struct PostReportView {
|
||||||
pub post_report: PostReport,
|
pub post_report: PostReport,
|
||||||
pub post: Post,
|
pub post: Post,
|
||||||
|
|
|
@ -36,9 +36,9 @@ use lemmy_db_schema::{
|
||||||
PostId,
|
PostId,
|
||||||
};
|
};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Clone)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
pub struct PostView {
|
pub struct PostView {
|
||||||
pub post: Post,
|
pub post: Post,
|
||||||
pub creator: PersonSafe,
|
pub creator: PersonSafe,
|
||||||
|
|
|
@ -10,9 +10,9 @@ use lemmy_db_schema::{
|
||||||
PrivateMessageId,
|
PrivateMessageId,
|
||||||
};
|
};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Clone)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
pub struct PrivateMessageView {
|
pub struct PrivateMessageView {
|
||||||
pub private_message: PrivateMessage,
|
pub private_message: PrivateMessage,
|
||||||
pub creator: PersonSafe,
|
pub creator: PersonSafe,
|
||||||
|
|
|
@ -7,9 +7,9 @@ use lemmy_db_schema::{
|
||||||
site::Site,
|
site::Site,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct SiteView {
|
pub struct SiteView {
|
||||||
pub site: Site,
|
pub site: Site,
|
||||||
pub creator: PersonSafe,
|
pub creator: PersonSafe,
|
||||||
|
|
|
@ -8,9 +8,9 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityBlockView {
|
pub struct CommunityBlockView {
|
||||||
pub person: PersonSafe,
|
pub person: PersonSafe,
|
||||||
pub community: CommunitySafe,
|
pub community: CommunitySafe,
|
||||||
|
|
|
@ -9,9 +9,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityFollowerView {
|
pub struct CommunityFollowerView {
|
||||||
pub community: CommunitySafe,
|
pub community: CommunitySafe,
|
||||||
pub follower: PersonSafe,
|
pub follower: PersonSafe,
|
||||||
|
|
|
@ -9,9 +9,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityModeratorView {
|
pub struct CommunityModeratorView {
|
||||||
pub community: CommunitySafe,
|
pub community: CommunitySafe,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -9,9 +9,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityPersonBanView {
|
pub struct CommunityPersonBanView {
|
||||||
pub community: CommunitySafe,
|
pub community: CommunitySafe,
|
||||||
pub person: PersonSafe,
|
pub person: PersonSafe,
|
||||||
|
|
|
@ -20,9 +20,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct CommunityView {
|
pub struct CommunityView {
|
||||||
pub community: CommunitySafe,
|
pub community: CommunitySafe,
|
||||||
pub subscribed: bool,
|
pub subscribed: bool,
|
||||||
|
|
|
@ -5,9 +5,9 @@ use lemmy_db_schema::{
|
||||||
source::person::{Person, PersonAlias1, PersonSafe, PersonSafeAlias1},
|
source::person::{Person, PersonAlias1, PersonSafe, PersonSafeAlias1},
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct PersonBlockView {
|
pub struct PersonBlockView {
|
||||||
pub person: PersonSafe,
|
pub person: PersonSafe,
|
||||||
pub target: PersonSafeAlias1,
|
pub target: PersonSafeAlias1,
|
||||||
|
|
|
@ -34,9 +34,9 @@ use lemmy_db_schema::{
|
||||||
PersonId,
|
PersonId,
|
||||||
PersonMentionId,
|
PersonMentionId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Clone)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
pub struct PersonMentionView {
|
pub struct PersonMentionView {
|
||||||
pub person_mention: PersonMention,
|
pub person_mention: PersonMention,
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
|
|
|
@ -13,9 +13,9 @@ use lemmy_db_schema::{
|
||||||
source::person::{Person, PersonSafe},
|
source::person::{Person, PersonSafe},
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct PersonViewSafe {
|
pub struct PersonViewSafe {
|
||||||
pub person: PersonSafe,
|
pub person: PersonSafe,
|
||||||
pub counts: PersonAggregates,
|
pub counts: PersonAggregates,
|
||||||
|
|
|
@ -10,9 +10,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModAddCommunityView {
|
pub struct ModAddCommunityView {
|
||||||
pub mod_add_community: ModAddCommunity,
|
pub mod_add_community: ModAddCommunity,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -8,9 +8,9 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModAddView {
|
pub struct ModAddView {
|
||||||
pub mod_add: ModAdd,
|
pub mod_add: ModAdd,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -10,9 +10,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModBanFromCommunityView {
|
pub struct ModBanFromCommunityView {
|
||||||
pub mod_ban_from_community: ModBanFromCommunity,
|
pub mod_ban_from_community: ModBanFromCommunity,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -8,9 +8,9 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModBanView {
|
pub struct ModBanView {
|
||||||
pub mod_ban: ModBan,
|
pub mod_ban: ModBan,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -11,9 +11,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModLockPostView {
|
pub struct ModLockPostView {
|
||||||
pub mod_lock_post: ModLockPost,
|
pub mod_lock_post: ModLockPost,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -12,9 +12,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModRemoveCommentView {
|
pub struct ModRemoveCommentView {
|
||||||
pub mod_remove_comment: ModRemoveComment,
|
pub mod_remove_comment: ModRemoveComment,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -9,9 +9,9 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModRemoveCommunityView {
|
pub struct ModRemoveCommunityView {
|
||||||
pub mod_remove_community: ModRemoveCommunity,
|
pub mod_remove_community: ModRemoveCommunity,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -11,9 +11,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModRemovePostView {
|
pub struct ModRemovePostView {
|
||||||
pub mod_remove_post: ModRemovePost,
|
pub mod_remove_post: ModRemovePost,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -11,9 +11,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModStickyPostView {
|
pub struct ModStickyPostView {
|
||||||
pub mod_sticky_post: ModStickyPost,
|
pub mod_sticky_post: ModStickyPost,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
|
@ -10,9 +10,9 @@ use lemmy_db_schema::{
|
||||||
CommunityId,
|
CommunityId,
|
||||||
PersonId,
|
PersonId,
|
||||||
};
|
};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub struct ModTransferCommunityView {
|
pub struct ModTransferCommunityView {
|
||||||
pub mod_transfer_community: ModTransferCommunity,
|
pub mod_transfer_community: ModTransferCommunity,
|
||||||
pub moderator: PersonSafe,
|
pub moderator: PersonSafe,
|
||||||
|
|
Loading…
Reference in a new issue