feat(dashboard): add optional CommonRequestDto parameter to GetManagerSummary
Add optional CommonRequestDto parameter to GetManagerSummary method in both service interface and implementation, and update the controller endpoint to accept it as a query parameter. This allows passing common request data (e.g., pagination, filtering) to the dashboard summary retrieval.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Complex.Application;
|
using Complex.Application;
|
||||||
|
using Complex.Application.Common;
|
||||||
using Complex.Common.Dto;
|
using Complex.Common.Dto;
|
||||||
using Complex.Domain.Entities;
|
using Complex.Domain.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -7,7 +8,7 @@ namespace Complex.Application.Services.Dashboard
|
|||||||
{
|
{
|
||||||
public interface IDashboardService
|
public interface IDashboardService
|
||||||
{
|
{
|
||||||
ResultDto<DashboardSummaryDto> GetManagerSummary(Guid complexId);
|
ResultDto<DashboardSummaryDto> GetManagerSummary(Guid complexId, CommonRequestDto? commonRequest = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DashboardService : IDashboardService
|
public class DashboardService : IDashboardService
|
||||||
@@ -19,7 +20,7 @@ namespace Complex.Application.Services.Dashboard
|
|||||||
_complexDBContext = complexDBContext;
|
_complexDBContext = complexDBContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultDto<DashboardSummaryDto> GetManagerSummary(Guid complexId)
|
public ResultDto<DashboardSummaryDto> GetManagerSummary(Guid complexId, CommonRequestDto? commonRequest = null)
|
||||||
{
|
{
|
||||||
var units = _complexDBContext.Units.Where(u => u.ComplexId == complexId);
|
var units = _complexDBContext.Units.Where(u => u.ComplexId == complexId);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Complex.Application.Common;
|
||||||
using Complex.Application.Services.Dashboard;
|
using Complex.Application.Services.Dashboard;
|
||||||
using Complex.Common.Dto;
|
using Complex.Common.Dto;
|
||||||
using Complex.EndPoint.Utility;
|
using Complex.EndPoint.Utility;
|
||||||
@@ -20,9 +21,11 @@ namespace Complex.EndPoint.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public ResultDto<DashboardSummaryDto> ManagerSummary(Guid complexId)
|
public ResultDto<DashboardSummaryDto> ManagerSummary(
|
||||||
|
Guid complexId,
|
||||||
|
[FromQuery] CommonRequestDto? commonRequest)
|
||||||
{
|
{
|
||||||
return _dashboardService.GetManagerSummary(complexId);
|
return _dashboardService.GetManagerSummary(complexId, commonRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user