add: create EmployeeController to manage employee selection for workshops
This commit is contained in:
25
ServiceHost/Areas/Client/Controllers/EmployeeController.cs
Normal file
25
ServiceHost/Areas/Client/Controllers/EmployeeController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user