Skip to content

Commit 2b5554e

Browse files
�[200~Refactor controllers and improve repository handling
Removed legacy controllers (ProjectController and TestController) and added paging support to repositories with GetPagedAsync. Refactored user entity namespace and updated related components for consistency. Reorganized UserProfile query structure for better maintainability.~
1 parent aa461db commit 2b5554e

File tree

20 files changed

+208
-225
lines changed

20 files changed

+208
-225
lines changed

Controllers/AuthController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace PaymentCoreServiceApi.Controllers;
88

99
[ApiController]
1010
[Route("api/[controller]")]
11-
[Authorize] // Yêu cầu authentication mặc định cho controller
11+
[Authorize]
1212
public class AuthController : ControllerBase
1313
{
1414
private readonly IMediator _mediator;

Controllers/ProjectController.cs

Lines changed: 0 additions & 106 deletions
This file was deleted.

Controllers/TestController.cs

Lines changed: 0 additions & 48 deletions
This file was deleted.

Core/Entities/UserAgents/UseEnum.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace PaymentCoreServiceApi.Core.Entities.UserGenerated;
2+
3+
public class UseEnum
4+
{
5+
6+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using PaymentCoreServiceApi.Core.Entities.BaseModel;
22

3-
namespace PaymentCoreServiceApi.Core.Entities.UserAgents;
3+
namespace PaymentCoreServiceApi.Core.Entities.UserGenerated;
44

55
public class User : EntityBase
66
{
7-
public string NickName { get; set; }
7+
public string? NickName { get; set; }
88
public string Avatar { get; set; }
99
public int? Gender { get; set; }
1010
public DateTime? BirthDate { get; set; }

Core/Interfaces/Repositories/Write/IBaseWriteOnlyRepository.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Linq.Expressions;
12
using PaymentCoreServiceApi.Core.Interfaces.Repositories.IUnitOfWork;
23

34
namespace PaymentCoreServiceApi.Core.Interfaces.Repositories.Write
@@ -15,5 +16,7 @@ public interface IBaseWriteOnlyRepository<TEntity> : IDbUnitOfWork where TEntity
1516

1617
Task<TEntity> GetByIdAsync(int id);
1718
Task<IEnumerable<TEntity>> GetAllAsync();
19+
Task<(IEnumerable<TEntity> Items, int TotalCount)> GetPagedAsync(int pageIndex, int pageSize, Expression<Func<TEntity, bool>> predicate);
20+
1821
}
1922
}

Core/Interfaces/Repositories/Write/IUserWriteRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using PaymentCoreServiceApi.Core.Entities.UserAgents;
1+
using PaymentCoreServiceApi.Core.Entities.UserGenerated;
22

33
namespace PaymentCoreServiceApi.Core.Interfaces.Repositories.Write;
44

Features/Auth/JwtService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Security.Claims;
33
using System.Text;
44
using Microsoft.IdentityModel.Tokens;
5-
using PaymentCoreServiceApi.Core.Entities.UserAgents;
5+
using PaymentCoreServiceApi.Core.Entities.UserGenerated;
66

77
namespace PaymentCoreServiceApi.Features.Auth;
88

Features/Users/Commands/CreateUserCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using MediatR;
2-
using PaymentCoreServiceApi.Core.Entities.UserAgents;
2+
using PaymentCoreServiceApi.Core.Entities.UserGenerated;
33

44
namespace PaymentCoreServiceApi.Features.Users.Commands;
55

0 commit comments

Comments
 (0)