diff --git a/VCinema.sln b/VCinema.sln index f61de72..635eaf3 100644 --- a/VCinema.sln +++ b/VCinema.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCinemaApi", "VCinema\VCinemaApi.csproj", "{CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCinemaApi", "VCinema\VCinemaApi.csproj", "{465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -9,9 +9,9 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Release|Any CPU.Build.0 = Release|Any CPU + {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/VCinema/Controllers/ScreensController.cs b/VCinema/Controllers/ScreensController.cs new file mode 100644 index 0000000..7f16c54 --- /dev/null +++ b/VCinema/Controllers/ScreensController.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; + +namespace VCinemaApi.Controllers +{ + [Route("api/screens")] + [ApiController] + public class ScreensController : ControllerBase + { + [HttpGet] + public IEnumerable Get() + { + return new string[] { "value1", "value2" }; + } + + [HttpGet("{id}")] + public string Get(int id) + { + return "value"; + } + + [HttpPost] + public void Post([FromBody] string value) + { + } + + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/VCinema/Controllers/WatchersController.cs b/VCinema/Controllers/WatchersController.cs new file mode 100644 index 0000000..ffda98a --- /dev/null +++ b/VCinema/Controllers/WatchersController.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; + +namespace VCinemaApi.Controllers +{ + [Route("api/watchers")] + [ApiController] + public class WatchersController : ControllerBase + { + [HttpGet] + public IEnumerable Get() + { + return new string[] { "value1", "value2" }; + } + + [HttpGet("{id}")] + public string Get(int id) + { + return "value"; + } + + [HttpPost] + public void Post([FromBody] string value) + { + } + + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/VCinema/Hubs/IVCinemaHub.cs b/VCinema/Hubs/IVCinemaHub.cs index e585bcf..c5860a9 100644 --- a/VCinema/Hubs/IVCinemaHub.cs +++ b/VCinema/Hubs/IVCinemaHub.cs @@ -10,6 +10,6 @@ namespace VCinemaApi.Hubs public void LeaveScreen(); public Watcher SetWatcherName(string name); public Screen SetPlayState(bool playing); - public void SetPlayState(bool playing, int playOffset); + public Screen SetPlayOffset(int playOffset); } } diff --git a/VCinema/Hubs/VCinemaHub.cs b/VCinema/Hubs/VCinemaHub.cs index 4caa5e4..81e55f2 100644 --- a/VCinema/Hubs/VCinemaHub.cs +++ b/VCinema/Hubs/VCinemaHub.cs @@ -61,7 +61,7 @@ namespace VCinemaApi.Hubs throw new NotImplementedException(); } - public Screen SetPlayState(bool playing, int playOffset) + public Screen SetPlayOffset(int playOffset) { throw new NotImplementedException(); } diff --git a/VCinema/Repositories/MockWatcherRepository.cs b/VCinema/Repositories/MockWatcherRepository.cs index b6d01e2..8d18840 100644 --- a/VCinema/Repositories/MockWatcherRepository.cs +++ b/VCinema/Repositories/MockWatcherRepository.cs @@ -60,7 +60,7 @@ namespace VCinemaApi.Repositories }; } - public Watcher SetWatcherName(string connectionId, string name) + public Watcher SetWatcherNameByConnectionId(string connectionId, string name) { return new Watcher { @@ -71,7 +71,7 @@ namespace VCinemaApi.Repositories }; } - public Watcher SetWatcherScreen(string connectionId, int screenId) + public Watcher SetWatcherScreenByConnectionId(string connectionId, int screenId) { return new Watcher { @@ -90,7 +90,7 @@ namespace VCinemaApi.Repositories }; } - public Watcher UnsetWatcherScreen(string connectionId) + public Watcher UnsetWatcherScreenByConnectionId(string connectionId) { return new Watcher { @@ -101,7 +101,7 @@ namespace VCinemaApi.Repositories }; } - public void DeleteWatcher(string connectionId) + public void DeleteWatcherByConnectionId(string connectionId) { } diff --git a/VCinema/VCinemaApi.csproj b/VCinema/VCinemaApi.csproj index a2bb656..1d5e367 100644 --- a/VCinema/VCinemaApi.csproj +++ b/VCinema/VCinemaApi.csproj @@ -12,6 +12,7 @@ +