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.
52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Txgy.RBS.DbModel.Models;
|
|
using Txgy.RBS.Framework.Api;
|
|
using Txgy.RBS.IServices;
|
|
|
|
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
|
|
namespace Txgy.RBS.Server.WebApi.Controllers
|
|
{
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class StationsController : ControllerBase
|
|
{
|
|
private readonly IStationsService _stationsService;
|
|
|
|
public StationsController(ILogger<StationsController> logger, IStationsService stationsService)
|
|
{
|
|
this._stationsService = stationsService;
|
|
}
|
|
|
|
[HttpPost]
|
|
public ApiResult AddStations(StationsDTO stationsDTO)
|
|
{
|
|
return _stationsService.AddStations(stationsDTO);
|
|
}
|
|
|
|
[HttpDelete("{id}")]
|
|
public ApiResult DeleteStations(int id)
|
|
{
|
|
return _stationsService.DeleteStations(id);
|
|
}
|
|
|
|
[HttpPost]
|
|
public ApiResult UpdateStations(StationsDTO stationsDTO)
|
|
{
|
|
return _stationsService.UpdateStations(stationsDTO);
|
|
}
|
|
|
|
[HttpGet("{id}")]
|
|
public StationsDTO GetStations(int id)
|
|
{
|
|
return _stationsService.GetStations(id);
|
|
}
|
|
|
|
[HttpGet]
|
|
public List<StationsDTO> GetAllStationss()
|
|
{
|
|
return _stationsService.GetAllStations();
|
|
}
|
|
}
|
|
}
|