aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 16:36:57 +0800
committerGitHub <noreply@github.com>2021-01-07 16:36:57 +0800
commit5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d (patch)
treec483a2fff48ad952e787e5af1bb541d939a09f19 /BackEnd/Timeline/Controllers/HighlightTimelineController.cs
parent20e9136a9f27a0b77f076ea5997b71d89ce3cfca (diff)
parentdf1ef1e21d8d889a2c9abd440039533c6a43818f (diff)
downloadtimeline-5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d.tar.gz
timeline-5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d.tar.bz2
timeline-5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d.zip
Merge pull request #198 from crupest/back-dev
Refactor back end.
Diffstat (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/HighlightTimelineController.cs12
1 files changed, 7 insertions, 5 deletions
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;
}
/// <summary>
@@ -34,8 +35,9 @@ namespace Timeline.Controllers
[ProducesResponseType(200)]
public async Task<ActionResult<List<HttpTimeline>>> List()
{
- var t = await _service.GetHighlightTimelines();
- return _mapper.Map<List<HttpTimeline>>(t);
+ var ids = await _service.GetHighlightTimelines();
+ var timelines = await _timelineService.GetTimelineList(ids);
+ return timelines.MapToHttp(Url);
}
/// <summary>