From df1ef1e21d8d889a2c9abd440039533c6a43818f Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 7 Jan 2021 16:23:20 +0800 Subject: 史诗级重构! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BackEnd/Timeline/Controllers/HighlightTimelineController.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs') diff --git a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs index 519d6161..76650b00 100644 --- a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs +++ b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Timeline.Auth; using Timeline.Models.Http; +using Timeline.Models.Mapper; using Timeline.Models.Validation; using Timeline.Services; using Timeline.Services.Exceptions; @@ -18,12 +19,12 @@ namespace Timeline.Controllers public class HighlightTimelineController : Controller { private readonly IHighlightTimelineService _service; - private readonly IMapper _mapper; + private readonly ITimelineService _timelineService; - public HighlightTimelineController(IHighlightTimelineService service, IMapper mapper) + public HighlightTimelineController(IHighlightTimelineService service, ITimelineService timelineService) { _service = service; - _mapper = mapper; + _timelineService = timelineService; } /// @@ -34,8 +35,9 @@ namespace Timeline.Controllers [ProducesResponseType(200)] public async Task>> List() { - var t = await _service.GetHighlightTimelines(); - return _mapper.Map>(t); + var ids = await _service.GetHighlightTimelines(); + var timelines = await _timelineService.GetTimelineList(ids); + return timelines.MapToHttp(Url); } /// -- cgit v1.2.3