created all dtos

This commit is contained in:
2025-10-17 09:18:19 +02:00
parent f6011d6a83
commit 2a386ba289
9 changed files with 76 additions and 4 deletions

View File

@@ -22,10 +22,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="DTO\Comment\Request\" />
<Folder Include="DTO\Comment\Response\" />
<Folder Include="DTO\Post\Request\" />
<Folder Include="DTO\Post\Response\" />
<Folder Include="Endpoints\Comment\" />
<Folder Include="Endpoints\Post\" />
<Folder Include="Endpoints\User\" />

View File

@@ -0,0 +1,8 @@
namespace BlogPlatform.DTO.Comment.Request;
public class CreateCommentDto
{
public string? Content { get; set; }
public int PostId { get; set; }
public int UserId { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace BlogPlatform.DTO.Comment.Request;
public class UpdateCommentDto
{
public int Id { get; set; }
public string? Content { get; set; }
public DateOnly CreatedAt { get; set; }
public int PostId { get; set; }
public int UserId { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace BlogPlatform.DTO.Comment.Response;
public class GetCommentDto
{
public int Id { get; set; }
public string? Content { get; set; }
public DateOnly CreatedAt { get; set; }
public int PostId { get; set; }
public int UserId { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace BlogPlatform.DTO.Post.Request;
public class CreatePostDto
{
public string? Title { get; set; }
public string? Content { get; set; }
public int Likes { get; set; }
public int UserId { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace BlogPlatform.DTO.Post.Request;
public class PatchPostDecrementLikeDto
{
public int Id { get; set; }
public int Likes { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace BlogPlatform.DTO.Post.Request;
public class PatchPostIncrementLikeDto
{
public int Id { get; set; }
public int Likes { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace BlogPlatform.DTO.Post.Request;
public class UpdatePostDto
{
public int Id { get; set; }
public string? Title { get; set; }
public string? Content { get; set; }
public int Likes { get; set; }
public DateOnly CreatedAt { get; set; }
public int UserId { get; set; }
}

View File

@@ -0,0 +1,14 @@
using BlogPlatform.DTO.Comment.Response;
namespace BlogPlatform.DTO.Post.Response;
public class GetPostDto
{
public int Id { get; set; }
public string? Title { get; set; }
public string? Content { get; set; }
public int Likes { get; set; }
public DateOnly CreatedAt { get; set; }
public int UserId { get; set; }
public List<GetCommentDto>? Comments { get; set; }
}