using API_SequentMicrosystems.Models; using API_SequentMicrosystems.Services; using Microsoft.AspNetCore.Mvc; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 namespace API_SequentMicrosystems.Controllers { [Route("points")] [ApiController] public class PointsController : ControllerBase { private PointsService _PointsService; public PointsController(PointsService _PS) { _PointsService = _PS; } // GET: api/ /// /// Get all saved points /// /// [HttpGet] public List Get() { return _PointsService.GetPoints(); } // GET api//5 /// /// Read points from first to specified number /// /// max readed points /// [HttpGet("{max}")] public List Get(int max) { return _PointsService.GetPoints().Take(max).ToList(); } // GET api//5/5 /// /// Read points from and to specified points positions /// /// /// /// [HttpGet("{max}/{start}")] public List Get(int max, int start) { return _PointsService.GetPoints().Skip(start).Take(max).ToList(); } //DELETE api/points /// /// Delete saved points /// [HttpDelete] public void Delete() { _PointsService.DeletePoints(); } //GET api/points/save /// /// Save new point /// [HttpGet("save")] public void GetSave() { _PointsService.SavePoint(); } //GET api/points/save/300 /// /// Start timer to automatic saving points in specified interval /// /// [HttpGet("save/{sec}")] public void GetSaveSec(int sec) { //start autosave timer } //GET api/points/save /// /// Stop timer for automatic save points /// [HttpDelete("save")] public void DeleteSaveSec() { //stop autosave timer } } }