rectoring
This commit is contained in:
parent
628fab2146
commit
1ae0ee5a8a
16 changed files with 135 additions and 62 deletions
|
@ -1,6 +1,7 @@
|
|||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Handlers;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -8,13 +9,22 @@ using System.Threading.Tasks;
|
|||
namespace Sledgemapper.Api.Controllers
|
||||
{
|
||||
[Authorize]
|
||||
[Route("[controller]/{sessionName}")]
|
||||
[Route("[controller]/{sessionName}")]
|
||||
public class SessionController : ControllerBase
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public SessionController(IMediator mediator) { _mediator = mediator; }
|
||||
|
||||
[HttpPost]
|
||||
public async Task Post(string sessionName)
|
||||
{
|
||||
var userId = int.Parse(HttpContext.User.Identity.Name);
|
||||
|
||||
var result = await _mediator.Send(new NewSessionCommand(sessionName, userId));
|
||||
|
||||
}
|
||||
|
||||
[HttpPost("tile")]
|
||||
public async Task Post(string sessionName, [FromBody]Tile tile)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue