feat: Enhance API endpoints with pagination and new subscription details for players

This commit is contained in:
Alexa
2026-06-23 00:21:58 +03:00
parent 70980bf3b6
commit df73507ee9
12 changed files with 388 additions and 78 deletions
@@ -191,6 +191,23 @@ public class ClubsController(ClubService clubs) : ControllerBase
return Ok(playerSubs + clubSubs);
}
[HttpGet("/subscription/details/{accountId:long}")]
public async Task<IActionResult> SubscriptionDetails(long accountId)
{
var viewerId = this.CurrentPlayerId();
var subscriberCount = await clubs.PlayerSubscriberCountAsync(accountId);
var subscribedCount = await clubs.PlayerSubscribedCountAsync(accountId);
var isSubscribed = viewerId is long viewer
&& await clubs.IsSubscribedToPlayerAsync(viewer, accountId);
return Ok(new
{
accountId,
subscriberCount,
subscribedCount,
isSubscribed,
});
}
/// <summary>
/// POST endpoint the watch hits when the player taps "mark read".
/// Idempotent — the upsert in the service quietly returns if a