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("rbs/[controller]/[action]")] [ApiController] public class TimeTabController : ControllerBase { private readonly ITimeTabService _timeTabService; public TimeTabController(ILogger 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 GetAllTimeTabs() { return _timeTabService.GetAllTimeTab(); } } }