media view count incrementation endpoint added, media page loading optimized, media view count incrementation on media page added
This commit is contained in:
@@ -14,6 +14,8 @@ public interface IMediaWebAPIService
|
||||
Task GetMediaRatingByUser(long mediaId, long userId, Action<short>? successAction = null, Action? notFoundAction = null);
|
||||
Task PutMediaRating(long mediaId, MediaRatingRequest body, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? notFoundAction = null);
|
||||
Task DeleteMediaRating(long mediaId, Action? successAction = null, Action? unauthorizedAction = null);
|
||||
|
||||
Task PostMediaView(long mediaId, Action? successAction = null, Action? notFoundAction = null);
|
||||
|
||||
Task GetPhotoMediaRandomBackground(long mediaId, Action<MediaPhotoResponse>? successAction = null, Action? notFoundAction = null);
|
||||
Task GetPhotoRandomBackground(Action<MediaPhotoResponse>? successAction = null, Action? notFoundAction = null);
|
||||
|
||||
@@ -113,6 +113,22 @@ public class MediaWebAPIService(IHttpClientService httpClientService, IConfigura
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region View count
|
||||
|
||||
public async Task PostMediaView(long mediaId, Action? successAction = null, Action? notFoundAction = null)
|
||||
{
|
||||
string url = GetUrl(EndpointsConfiguration.Media.PostMediaView, mediaId);
|
||||
|
||||
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||
|
||||
HttpResponse response = await httpClientService.SendRequestAsync(request);
|
||||
response.RegisterActionFor2XXSuccess(successAction)
|
||||
.RegisterActionFor404NotFound(notFoundAction)
|
||||
.ExecuteAction();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user