using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.OutputCaching; using Portfolio.Shared.Models; using Portfolio.Shared.Services; namespace Portfolio.Api.Controller; [ApiController, Route("api/timeline"), OutputCache(Tags = [DatabaseContext.CacheKey])] public class TimelineController(ITimelineRepository repository) : ControllerBase { [HttpGet("{type}")] public async Task GetTimeline(TimelineEntryType type, CancellationToken ct) { var timeline = await repository.GetTimeline(type, ct); return Ok(timeline); } [HttpGet("featured")] public async Task GetFeaturedTimeline(CancellationToken ct) { var timeline = await repository.GetFeaturedTimeline(ct); return Ok(timeline); } }