basic player management

This commit is contained in:
Michele 2021-02-21 22:59:43 +00:00
parent 350a283b5e
commit bab170552e
12 changed files with 244 additions and 91 deletions

View file

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using MediatR;
using Sledgemapper.Shared.Entities;
namespace Sledgemapper.Api.Commands
{
public class GetCampaignPlayersCommand : IRequest<List<Player>>
{
public double Timestamp { get; private set; }
public string CampaignName { get; private set; }
public string UserId { get; private set; }
public GetCampaignPlayersCommand(string campaingName, string userId)
{
Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
CampaignName = campaingName;
UserId = userId;
}
}
}

View file

@ -0,0 +1,15 @@
using System.Collections.Generic;
using MediatR;
namespace Sledgemapper.Api.Commands
{
public class GetCampaignsCommand : IRequest<List<Core.Entities.Campaign>>
{
public string UserId { get; private set; }
public GetCampaignsCommand(string userId)
{
UserId = userId;
}
}
}

View file

@ -0,0 +1,21 @@
using System;
using MediatR;
namespace Sledgemapper.Api.Commands
{
public class InvitePlayerToCampaignCommand : IRequest<bool>
{
public double Timestamp { get; private set; }
public string CampaignName { get; private set; }
public string Email { get; private set; }
public string UserId { get; private set; }
public InvitePlayerToCampaignCommand(string campaingName, string email, string userId)
{
Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
CampaignName = campaingName;
UserId = userId;
Email = email;
}
}
}

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using MediatR;
namespace Sledgemapper.Api.Commands
@ -24,13 +23,4 @@ namespace Sledgemapper.Api.Commands
}
}
public class GetCampaignsCommand : IRequest<List<Core.Entities.Campaign>>
{
public string UserId { get; private set; }
public GetCampaignsCommand(string userId)
{
UserId = userId;
}
}
}