Add stub for controllers

This commit is contained in:
Jack Hadrill 2020-09-23 23:34:23 +01:00
parent 43734e0993
commit ba8040a63c
7 changed files with 86 additions and 11 deletions

View File

@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -9,9 +9,9 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Debug|Any CPU.Build.0 = Debug|Any CPU {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF731C3C-2EB8-4C7A-B0BA-556B5CB74106}.Release|Any CPU.ActiveCfg = Release|Any CPU {465DE7C9-B246-4F97-BC9B-7004AE0C7D2E}.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}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -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<string> 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)
{
}
}
}

View File

@ -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<string> 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)
{
}
}
}

View File

@ -10,6 +10,6 @@ namespace VCinemaApi.Hubs
public void LeaveScreen(); public void LeaveScreen();
public Watcher SetWatcherName(string name); public Watcher SetWatcherName(string name);
public Screen SetPlayState(bool playing); public Screen SetPlayState(bool playing);
public void SetPlayState(bool playing, int playOffset); public Screen SetPlayOffset(int playOffset);
} }
} }

View File

@ -61,7 +61,7 @@ namespace VCinemaApi.Hubs
throw new NotImplementedException(); throw new NotImplementedException();
} }
public Screen SetPlayState(bool playing, int playOffset) public Screen SetPlayOffset(int playOffset)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -60,7 +60,7 @@ namespace VCinemaApi.Repositories
}; };
} }
public Watcher SetWatcherName(string connectionId, string name) public Watcher SetWatcherNameByConnectionId(string connectionId, string name)
{ {
return new Watcher 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 return new Watcher
{ {
@ -90,7 +90,7 @@ namespace VCinemaApi.Repositories
}; };
} }
public Watcher UnsetWatcherScreen(string connectionId) public Watcher UnsetWatcherScreenByConnectionId(string connectionId)
{ {
return new Watcher return new Watcher
{ {
@ -101,7 +101,7 @@ namespace VCinemaApi.Repositories
}; };
} }
public void DeleteWatcher(string connectionId) public void DeleteWatcherByConnectionId(string connectionId)
{ {
} }

View File

@ -12,6 +12,7 @@
<Folder Include="wwwroot\" /> <Folder Include="wwwroot\" />
<Folder Include="wwwroot\js\" /> <Folder Include="wwwroot\js\" />
<Folder Include="Repositories\" /> <Folder Include="Repositories\" />
<Folder Include="Controllers\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.8" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.8" />