using Microsoft.AspNetCore.Mvc;
using DorkNet.Server.Services;
namespace DorkNet.Server.Controllers.API.Activities;
///
/// api.{rec.net,localhost}/api/activities/* — per-activity content
/// (charades words, party-game prompts, etc.).
///
/// The March 2023 watch fetches a 3D Charades deck at card-box spawn from
/// api/activities/charades/v1/words/{source}, where {source}
/// is one of three baked CardBox.cardSource slots — Charades,
/// CharadesAprilFoolsDay, or Icebreakers (verified in the
/// 2023.03.21 il2cpp dump). We resolve the admin-bound word list for the
/// requested slot via and return the
/// wire array of { EN_US, Difficulty }. The older December route
/// (no {source}) maps to the default Charades slot.
///
[ApiController]
public class ActivitiesController(CharadesWordListService charades) : ControllerBase
{
[HttpGet("api/activities/charades/v1/words/{source}")]
public async Task CharadesWords(string source)
=> Ok(await charades.ResolveWireWordsAsync(source));
/// December 2020 shape — no source segment. Serves the default
/// Charades slot so the older client still gets a populated deck.
[HttpGet("api/activities/charades/v1/words")]
public async Task CharadesWordsDefault()
=> Ok(await charades.ResolveWireWordsAsync(
nameof(CharadesWordListService.CharadesSlot.Charades)));
}