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.

58 lines
1.5 KiB
C#

using Microsoft.AspNetCore.Mvc;
using Txgy.RBS.DTO;
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(StationDTO stationsDTO)
{
return _stationsService.AddStations(stationsDTO);
}
[HttpDelete("{id}")]
public ApiResult DeleteStations(int id)
{
return _stationsService.DeleteStations(id);
}
[HttpPost]
public ApiResult UpdateStations(StationDTO stationsDTO)
{
return _stationsService.UpdateStations(stationsDTO);
}
[HttpGet("{id}")]
public StationDTO GetStations(int id)
{
return _stationsService.GetStations(id);
}
[HttpGet]
public List<StationDTO> GetAllStationss()
{
return _stationsService.GetAllStations();
}
[HttpGet]
public List<StationNumVpnDTO> GetStationNumVpn()
{
return _stationsService.GetStationNumVpn();
}
}
}