refactoring and cleanup
This commit is contained in:
parent
777608941b
commit
535c420952
8 changed files with 212 additions and 95 deletions
|
@ -1,23 +0,0 @@
|
|||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sledgemapper.Api.Handlers;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sledgemapper.Api.Controllers
|
||||
{
|
||||
[Route("tile")]
|
||||
public class TileController : ControllerBase
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public TileController(IMediator mediator) { _mediator = mediator; }
|
||||
|
||||
[HttpPost]
|
||||
|
||||
public async Task Post(string sessionName, Tile tile)
|
||||
{
|
||||
await _mediator.Publish(new NewTileNotification(sessionName, tile));
|
||||
}
|
||||
}
|
||||
}
|
28
Sledgemapper.Api/Controllers/SessionController.cs
Normal file
28
Sledgemapper.Api/Controllers/SessionController.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sledgemapper.Api.Handlers;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sledgemapper.Api.Controllers
|
||||
{
|
||||
[Route("[controller]/{sessionName}")]
|
||||
public class SessionController : ControllerBase
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public SessionController(IMediator mediator) { _mediator = mediator; }
|
||||
|
||||
[HttpPost("tile")]
|
||||
public async Task Post(string sessionName, [FromBody]Tile tile)
|
||||
{
|
||||
await _mediator.Publish(new NewTileNotification(sessionName, tile));
|
||||
}
|
||||
|
||||
[HttpPost("session")]
|
||||
public async Task Post(string sessionName, [FromBody]Overlay overlay)
|
||||
{
|
||||
await _mediator.Publish(new NewOverlayNotification(sessionName, overlay));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue