Removing all non-employee related routes
This commit is contained in:
@@ -7,151 +7,49 @@ namespace WD7UVN_HFT_2023241.Endpoint
|
|||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/database")]
|
[Route("api/database")]
|
||||||
public class DatabaseController : ControllerBase
|
public class EmployeeController : ControllerBase
|
||||||
{
|
{
|
||||||
public ILogicServices LogicServices { get; set; }
|
public ILogicServices LogicServices { get; set; }
|
||||||
|
|
||||||
public DatabaseController(ILogicServices LogicServices)
|
public EmployeeController(ILogicServices LogicServices)
|
||||||
{
|
{
|
||||||
this.LogicServices = LogicServices;
|
this.LogicServices = LogicServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("WhoWorksInMaintainerTeam/{id}")]
|
|
||||||
public IQueryable<Employee> WhoWorksInMaintainerTeam(int id)
|
|
||||||
{
|
|
||||||
return LogicServices.WhoWorksInMaintainerTeam(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("GetSubordinates/{id}")]
|
[HttpGet("GetSubordinates/{id}")]
|
||||||
public IQueryable<Employee> GetSubordinates(int id)
|
public IQueryable<Employee> GetSubordinates(int id)
|
||||||
{
|
{
|
||||||
return LogicServices.GetSubordinates(id);
|
return LogicServices.GetSubordinates(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("WhoUsesService")]
|
[HttpGet()]
|
||||||
public IQueryable<Customer> WhoUsesService(int id)
|
public IActionResult ReadAllEmployees()
|
||||||
{
|
{
|
||||||
return LogicServices.WhoUsesService(id);
|
return View(LogicServices.CRUDOperations.ReadAllEmployees());
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("Employees")]
|
[HttpGet("{id}")]
|
||||||
public IQueryable<Employee> ReadAllEmployees()
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadAllEmployees();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Services")]
|
|
||||||
public IQueryable<Service> ReadAllServices()
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadAllServices();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("MaintainerTeams")]
|
|
||||||
public IQueryable<MaintainerTeam> ReadAllMaintainerTeams()
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadAllMaintainerTeams();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Customer")]
|
|
||||||
public IQueryable<Customer> ReadAllCustomers()
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadAllCustomers();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("MaintainerTeam/{id}")]
|
|
||||||
public MaintainerTeam ReadMaintainerTeam(int id)
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadMaintainerTeam(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Service/{id}")]
|
|
||||||
public Service ReadService(int id)
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadService(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Customer/{id}")]
|
|
||||||
public Customer ReadCustomer(int id)
|
|
||||||
{
|
|
||||||
return LogicServices.CRUDOperations.ReadCustomer(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("Employee/{id}")]
|
|
||||||
public Employee ReadEmployee(int id)
|
public Employee ReadEmployee(int id)
|
||||||
{
|
{
|
||||||
return LogicServices.CRUDOperations.ReadEmployee(id);
|
return LogicServices.CRUDOperations.ReadEmployee(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPut("Employee")]
|
[HttpPut()]
|
||||||
public void PutEmployee([FromBody] Employee e)
|
public void PutEmployee([FromBody] Employee e)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.CreateEmployee(e);
|
LogicServices.CRUDOperations.CreateEmployee(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPut("Customer")]
|
[HttpPost()]
|
||||||
public void PutCustomer([FromBody] Customer c)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.CreateCustomer(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("Service")]
|
|
||||||
public void PutService([FromBody] Service s)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.CreateService(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("MaintainerTeam")]
|
|
||||||
public void PutMaintainerTeam([FromBody] MaintainerTeam m)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.CreateMaintainerTeam(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost("Employee")]
|
|
||||||
public void UpdateEmployee([FromBody] Employee e)
|
public void UpdateEmployee([FromBody] Employee e)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.UpdateEmployee(e);
|
LogicServices.CRUDOperations.UpdateEmployee(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("Customer")]
|
[HttpDelete()]
|
||||||
public void UpdateCustomer([FromBody] Customer c)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.UpdateCustomer(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost("Service")]
|
|
||||||
public void UpdateService([FromBody] Service s)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.UpdateService(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost("MaintainerTeam")]
|
|
||||||
public void UpdateMaintainerTeam([FromBody] MaintainerTeam m)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.UpdateMaintainerTeam(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpDelete("Employee")]
|
|
||||||
public void DeleteEmployee([FromBody] int id)
|
public void DeleteEmployee([FromBody] int id)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.DeleteEmployee(id);
|
LogicServices.CRUDOperations.DeleteEmployee(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("MaintainerTeam")]
|
|
||||||
public void DeleteMaintainerTeam([FromBody] int id)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.DeleteMaintainerTeam(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpDelete("Service")]
|
|
||||||
public void DeleteService([FromBody] int id)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.DeleteEmployee(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpDelete("Customer")]
|
|
||||||
public void DeleteCustomer([FromBody] int id)
|
|
||||||
{
|
|
||||||
LogicServices.CRUDOperations.DeleteEmployee(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user