comments
This commit is contained in:
parent
cbf67bf5f1
commit
ce3888f1ab
15 changed files with 162 additions and 21 deletions
3
Femto.Api/Controllers/Posts/Dto/AddPostCommentRequest.cs
Normal file
3
Femto.Api/Controllers/Posts/Dto/AddPostCommentRequest.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Posts.Dto;
|
||||
|
||||
public record AddPostCommentRequest(Guid AuthorId, string Content);
|
3
Femto.Api/Controllers/Posts/Dto/PostCommentDto.cs
Normal file
3
Femto.Api/Controllers/Posts/Dto/PostCommentDto.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Posts.Dto;
|
||||
|
||||
public record PostCommentDto(string Author, string Content, DateTimeOffset PostedOn);
|
|
@ -10,7 +10,8 @@ public record PostDto(
|
|||
IEnumerable<PostMediaDto> Media,
|
||||
IEnumerable<PostReactionDto> Reactions,
|
||||
DateTimeOffset CreatedAt,
|
||||
IEnumerable<string> PossibleReactions
|
||||
IEnumerable<string> PossibleReactions,
|
||||
IEnumerable<PostCommentDto> Comments
|
||||
)
|
||||
{
|
||||
public static PostDto FromModel(Modules.Blog.Application.Queries.GetPosts.Dto.PostDto post) =>
|
||||
|
@ -21,6 +22,7 @@ public record PostDto(
|
|||
post.Media.Select(m => new PostMediaDto(m.Url, m.Width, m.Height)),
|
||||
post.Reactions.Select(r => new PostReactionDto(r.Emoji, r.AuthorName, r.ReactedOn)),
|
||||
post.CreatedAt,
|
||||
post.PossibleReactions
|
||||
post.PossibleReactions,
|
||||
post.Comments.Select(c => new PostCommentDto(c.Author, c.Content, c.PostedOn))
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue