Sube carpetas API, API.Tests, Application y Domain del Backend

This commit is contained in:
FrancoRu
2026-09-18 13:35:59 -03:00
parent bbb09554bb
commit 2eb4eeef03
572 changed files with 56405 additions and 0 deletions
@@ -0,0 +1,29 @@
using Microsoft.AspNetCore.Http;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.BlogPosts.Request;
/// <summary>
/// Represents a request to create a new blog post, including file upload for the photo.
/// </summary>
public class CreateBlogPostRequest
{
[Required]
[MaxLength(50)]
public required string Author { get; set; }
[Required]
public required string Title { get; set; }
public IFormFile? PhotoFile { get; set; }
[Required]
public required string MarkdownText { get; set; }
/// <summary>
/// Whether the post is published or a draft; defaults to true so existing create flows are unaffected.
/// </summary>
public bool IsPublished { get; set; } = true;
}
@@ -0,0 +1,23 @@
using Application.DTOs.Abstract.Request;
namespace Application.DTOs.BlogPosts.Request;
/// <summary>
/// Represents a request to get filtered blog posts.
/// </summary>
public class GetBlogPostsFilteredRequest : PaginatedFilterRequest
{
/// <summary>
/// Overrides the base PaginatedFilterRequest default to sort newest-created-first.
/// </summary>
public GetBlogPostsFilteredRequest()
{
// String literal matches EntityBase.DateCreated; QueryableExtensions.SortBy resolves this name against the entity by reflection.
OrderBy = "DateCreated";
Order = SortOrder.Descending;
}
public string? Author { get; set; }
public string? Title { get; set; }
}
@@ -0,0 +1,14 @@
using Microsoft.AspNetCore.Http;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.BlogPosts.Request;
/// <summary>
/// Represents a request to update the photo for a blog post.
/// </summary>
public class UpdateBlogPostPhotoRequest
{
[Required]
public required IFormFile PhotoFile { get; set; }
}
@@ -0,0 +1,28 @@
namespace Application.DTOs.BlogPosts.Request;
/// <summary>
/// Represents a request to update a blog post.
/// </summary>
public class UpdateBlogPostRequest
{
/// <summary>
/// Null leaves the current title unchanged.
/// </summary>
public string? Title { get; set; }
/// <summary>
/// Null leaves the current Markdown content unchanged.
/// </summary>
public string? MarkdownText { get; set; }
/// <summary>
/// Null leaves the current author unchanged.
/// </summary>
public string? Author { get; set; }
/// <summary>
/// The updated publication state; null leaves it unchanged, true publishes, false reverts to a draft.
/// </summary>
public bool? IsPublished { get; set; }
}