98 lines
2.9 KiB
C#
98 lines
2.9 KiB
C#
using Refit;
|
|
using Sledgemapper.Shared.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Sledgemapper
|
|
{
|
|
[Headers("Authorization: Bearer")]
|
|
public interface IMapApi
|
|
{
|
|
[Headers("Authorization")]
|
|
[Post("/authmanagement/register")]
|
|
Task<AuthResult> Register([Body] RegisterModel registerModel);
|
|
|
|
[Headers("Authorization")]
|
|
[Post("/authmanagement/login")]
|
|
Task<AuthenticateResponse> Authenticate([Body] AuthenticateModel registerModel);
|
|
|
|
[Post("/map/{campaignId}/{mapId}/overlay")]
|
|
Task NewOverlay([Body] Overlay overlay, Guid campaignId, Guid mapId);
|
|
|
|
[Post("/map/{campaignId}/{mapId}/note")]
|
|
Task NewNote([Body] Note note, Guid campaignId, Guid mapId);
|
|
|
|
[Post("/map/{campaignId}/{mapId}/wall")]
|
|
Task NewWall([Body] Wall overlay, Guid campaignId, Guid mapId);
|
|
|
|
[Post("/map/{campaignId}/{mapId}/room")]
|
|
Task NewRoom(Room room, Guid campaignId, Guid mapId);
|
|
|
|
[Post("/map/{campaignId}/{mapId}/line")]
|
|
Task NewLine(Line line, Guid campaignId, Guid mapId);
|
|
|
|
[Post("/campaign/{campaignName}")]
|
|
Task NewCampaign(string campaignName);
|
|
|
|
[Get("/campaign/")]
|
|
Task<List<Campaign>> GetCampaigns();
|
|
|
|
[Get("/campaign/{campaignName}/players")]
|
|
Task<List<Player>> GetPlayers(Guid campaignName);
|
|
|
|
|
|
[Get("/campaign/{campaignId}/maps")]
|
|
Task<List<Session>> GetMaps(Guid campaignId);
|
|
|
|
[Get("/map/{campaignId}/{mapId}")]
|
|
Task<Session> GetMap(Guid campaignId, Guid mapId);
|
|
|
|
|
|
[Post("/campaign/{campaignId}/players/{email}")]
|
|
Task InvitePlayer(Guid campaignId, string email);
|
|
|
|
|
|
|
|
[Get("/session/{sessionName}")]
|
|
Task<Session> Session(string sessionName);
|
|
|
|
[Post("/map/{campaignid}/{sessionName}")]
|
|
Task<Guid> NewSession(Guid campaignid, string sessionName);
|
|
|
|
[Post("/session/{sessionName}/snapshot")]
|
|
Task SaveSnapshot([Body] Session session, Guid sessionName);
|
|
|
|
[Post("/map/{campaignId}/{mapId}/tile")]
|
|
Task NewTile([Body] Tile tile, Guid campaignId, Guid mapId);
|
|
|
|
|
|
|
|
|
|
|
|
[Delete("/map/{campaignId}/{mapId}/wall")]
|
|
Task DeleteWall([Body] Wall wall, Guid campaignId, Guid mapId);
|
|
|
|
[Delete("/map/{campaignId}/{mapId}/tile")]
|
|
Task DeleteTile([Body] Tile tile, Guid campaignId, Guid mapId);
|
|
|
|
[Delete("/map/{campaignId}/{mapId}/overlay")]
|
|
Task DeleteOverlay([Body] Overlay overlay, Guid campaignId, Guid mapId);
|
|
|
|
[Delete("/map/{campaignId}/{mapId}/note")]
|
|
Task DeleteNote([Body] Note overlay, Guid campaignId, Guid mapId);
|
|
|
|
|
|
public class AuthResult
|
|
{
|
|
public string Token { get; set; }
|
|
public bool Result { get; set; }
|
|
public List<string> Errors { get; set; }
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
} |