Add stub for controllers
This commit is contained in:
parent
43734e0993
commit
ba8040a63c
10
VCinema.sln
10
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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<Folder Include="wwwroot\" />
|
||||
<Folder Include="wwwroot\js\" />
|
||||
<Folder Include="Repositories\" />
|
||||
<Folder Include="Controllers\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.8" />
|
||||
|
|
Loading…
Reference in New Issue