You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Txgy.RBS.DTO;
using Txgy.RBS.Framework.Api;
using Txgy.RBS.IServices;
namespace Txgy.RBS.Server.WebApi.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class TimeTabController : ControllerBase
{
private readonly ITimeTabService _timeTabService;
public TimeTabController(ILogger<TimeTabController> logger, ITimeTabService timeTabService)
{
this._timeTabService = timeTabService;
}
[HttpPost]
public ApiResult AddTimeTab(TimeTabDTO timeTabDTO)
{
return _timeTabService.AddTimeTab(timeTabDTO);
}
[HttpDelete("{id}")]
public ApiResult DeleteTimeTab(int id)
{
return _timeTabService.DeleteTimeTab(id);
}
[HttpPost]
public ApiResult UpdateTimeTab(TimeTabDTO timeTabDTO)
{
return _timeTabService.UpdateTimeTab(timeTabDTO);
}
[HttpGet("{id}")]
public TimeTabDTO GetTimeTab(int id)
{
return _timeTabService.GetTimeTab(id);
}
[HttpGet]
public List<TimeTabDTO> GetAllTimeTabs()
{
return _timeTabService.GetAllTimeTab();
}
}
}