Add episodes controller

This commit is contained in:
2020-02-29 16:01:22 +01:00
parent 0cef2e3df2
commit 54c0fb2fd2
10 changed files with 190 additions and 23 deletions

View File

@@ -0,0 +1,24 @@
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using EstusShots.Shared.Interfaces;
using EstusShots.Shared.Models;
using EstusShots.Shared.Models.Parameters;
namespace EstusShots.Client.Routes
{
public class Episodes : IEpisodesController
{
private readonly EstusShotsClient _client;
public Episodes(EstusShotsClient client)
{
_client = client;
}
private string ActionUrl([CallerMemberName]string caller = "") =>
$"{_client.ApiUrl}{nameof(Episodes)}/{caller}";
public async Task<ApiResponse<GetEpisodesResponse>> GetEpisodes(GetEpisodesParameter parameter)
=> await _client.PostToApi<GetEpisodesResponse, GetEpisodesParameter>(ActionUrl(), parameter);
}
}