28 lines
No EOL
838 B
C#
28 lines
No EOL
838 B
C#
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));
|
|
}
|
|
}
|
|
} |