-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'i11' of github.com:migueloliveiradev/living into i11
- Loading branch information
Showing
7 changed files
with
32 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Living.Domain.Base; | ||
public class Paginated<T>(IEnumerable<T> items, int pageIndex, int pageSize, long totalCount) | ||
{ | ||
public IEnumerable<T> Items { get; } = items; | ||
public int PageIndex { get; } = pageIndex; | ||
public int PageSize { get; } = pageSize; | ||
public long TotalCount { get; } = totalCount; | ||
public int TotalPages => (int)Math.Ceiling(TotalCount / (double)PageSize); | ||
public bool HasPreviousPage => PageIndex > 1; | ||
public bool HasNextPage => PageIndex < TotalPages; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
Living.Tests.Unit/WebAPI/Attributes/NotificationProducesResponseTypeAttributeTests.cs
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
Living.WebAPI/Attributes/NotificationProducesResponseTypeAttribute.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Living.Domain.Base; | ||
using Living.Domain.Features.Posts.Models; | ||
|
||
namespace Living.WebAPI.Controllers; | ||
|
||
[ApiController] | ||
[Route("api/feed")] | ||
[Authorize] | ||
public class FeedController : ControllerAPI | ||
{ | ||
[HttpGet] | ||
[ProducesResponseType<Paginated<PostItem>>(200)] | ||
public async Task<IActionResult> Index() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters