movie page added
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
public class Media
|
||||
{
|
||||
public string Base { get; set; }
|
||||
public string Get { get; set; }
|
||||
public string GetGenres { get; set; }
|
||||
public string PostGenre { get; set; }
|
||||
public string DeleteGenre { get; set; }
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace WatchIt.Website.Services.WebAPI.Media;
|
||||
|
||||
public interface IMediaWebAPIService
|
||||
{
|
||||
Task Get(long mediaId, Action<MediaResponse> successAction = null, Action? notFoundAction = null);
|
||||
Task GetGenres(long mediaId, Action<IEnumerable<GenreResponse>>? successAction = null, Action? notFoundAction = null);
|
||||
Task PostGenre(long mediaId, long genreId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null);
|
||||
Task GetPhotoRandomBackground(Action<MediaPhotoResponse>? successAction = null, Action? notFoundAction = null);
|
||||
|
||||
@@ -10,6 +10,18 @@ namespace WatchIt.Website.Services.WebAPI.Media;
|
||||
public class MediaWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : BaseWebAPIService(configurationService), IMediaWebAPIService
|
||||
{
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public async Task Get(long mediaId, Action<MediaResponse> successAction = null, Action? notFoundAction = null)
|
||||
{
|
||||
string url = GetUrl(EndpointsConfiguration.Media.Get, mediaId);
|
||||
|
||||
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||
|
||||
HttpResponse response = await httpClientService.SendRequestAsync(request);
|
||||
response.RegisterActionFor2XXSuccess(successAction)
|
||||
.RegisterActionFor404NotFound(notFoundAction)
|
||||
.ExecuteAction();
|
||||
}
|
||||
|
||||
public async Task GetGenres(long mediaId, Action<IEnumerable<GenreResponse>>? successAction = null, Action? notFoundAction = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user