Generator Changes at 9/27/2025 10:36:00 AM
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
public record GetAllUserByFilterQuery : IRequest<GetAllUserByFilterResponseDto>
|
||||
{
|
||||
//موقعیت صفحه بندی
|
||||
public PaginationState? PaginationState { get; init; }
|
||||
//مرتب سازی بر اساس
|
||||
public string? SortBy { get; init; }
|
||||
//فیلتر
|
||||
public GetAllUserByFilterFilter? Filter { get; init; }
|
||||
|
||||
}public class GetAllUserByFilterFilter
|
||||
{
|
||||
//شناسه
|
||||
public long? Id { get; set; }
|
||||
//نام
|
||||
public string? FirstName { get; set; }
|
||||
//نام خانوادگی
|
||||
public string? LastName { get; set; }
|
||||
//شماره موبایل
|
||||
public string? Mobile { get; set; }
|
||||
//کد ملی
|
||||
public string? NationalCode { get; set; }
|
||||
//آدرس آواتار
|
||||
public string? AvatarPath { get; set; }
|
||||
//شناسه والد
|
||||
public long? ParentId { get; set; }
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilterQuery, GetAllUserByFilterResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
|
||||
public GetAllUserByFilterQueryHandler(IApplicationContractContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<GetAllUserByFilterResponseDto> Handle(GetAllUserByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllUserByFilterResponseDto();
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
public class GetAllUserByFilterQueryValidator : AbstractValidator<GetAllUserByFilterQuery>
|
||||
{
|
||||
public GetAllUserByFilterQueryValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllUserByFilterQuery>.CreateWithOptions((GetAllUserByFilterQuery)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
public class GetAllUserByFilterResponseDto
|
||||
{
|
||||
//متادیتا
|
||||
public MetaData MetaData { get; set; }
|
||||
//مدل خروجی
|
||||
public List<GetAllUserByFilterResponseModel>? Models { get; set; }
|
||||
|
||||
}public class GetAllUserByFilterResponseModel
|
||||
{
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
//نام
|
||||
public string? FirstName { get; set; }
|
||||
//نام خانوادگی
|
||||
public string? LastName { get; set; }
|
||||
//شماره موبایل
|
||||
public string Mobile { get; set; }
|
||||
//کد ملی
|
||||
public string? NationalCode { get; set; }
|
||||
//آدرس آواتار
|
||||
public string? AvatarPath { get; set; }
|
||||
//شناسه والد
|
||||
public long? ParentId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public record GetUserQuery : IRequest<GetUserResponseDto>
|
||||
{
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
|
||||
public GetUserQueryHandler(IApplicationContractContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<GetUserResponseDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserResponseDto();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserQueryValidator : AbstractValidator<GetUserQuery>
|
||||
{
|
||||
public GetUserQueryValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetUserQuery>.CreateWithOptions((GetUserQuery)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserResponseDto
|
||||
{
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
//نام
|
||||
public string? FirstName { get; set; }
|
||||
//نام خانوادگی
|
||||
public string? LastName { get; set; }
|
||||
//شماره موبایل
|
||||
public string Mobile { get; set; }
|
||||
//کد ملی
|
||||
public string? NationalCode { get; set; }
|
||||
//آدرس آواتار
|
||||
public string? AvatarPath { get; set; }
|
||||
//شناسه والد
|
||||
public long? ParentId { get; set; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user