Files
Backend-Api/ServiceHost/Areas/Client/Controllers/EmployeeController.cs
2025-12-28 18:45:32 +03:30

39 lines
1.2 KiB
C#

using _0_Framework.Application;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.Employee.DTO;
using Microsoft.AspNetCore.Mvc;
using ServiceHost.BaseControllers;
namespace ServiceHost.Areas.Client.Controllers;
public class EmployeeController:ClientBaseController
{
private readonly IEmployeeApplication _employeeApplication;
private readonly long _workshopId;
public EmployeeController(IEmployeeApplication employeeApplication,IAuthHelper authHelper)
{
_employeeApplication = employeeApplication;
_workshopId = authHelper.GetWorkshopId();
}
[HttpGet("select-list")]
public async Task<ActionResult<List<EmployeeSelectListViewModel>>> GetEmployeeSelectList()
{
var result = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return result;
}
/// <summary>
/// دریافت لیست پرسنل
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult<List<EmployeeListDto>>> GetList(EmployeeSearchModelDto searchModel)
{
var result = await _employeeApplication.ListOfAllEmployees(searchModel, _workshopId);
return result;
}
}