aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 20:12:00 +0800
committercrupest <crupest@outlook.com>2021-01-07 20:12:00 +0800
commitffe44ba70c9e5c6a01179c7e2f4185543cbc441c (patch)
tree67128b91d6cfd08c54c9e745e7bf2abbdf1f20f4 /BackEnd/Timeline/Controllers/HighlightTimelineController.cs
parent5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d (diff)
downloadtimeline-ffe44ba70c9e5c6a01179c7e2f4185543cbc441c.tar.gz
timeline-ffe44ba70c9e5c6a01179c7e2f4185543cbc441c.tar.bz2
timeline-ffe44ba70c9e5c6a01179c7e2f4185543cbc441c.zip
refactor: Make mapper a service. Fix #202.
Diffstat (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/HighlightTimelineController.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
index 76650b00..685ec16f 100644
--- a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
+++ b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
@@ -1,5 +1,4 @@
-using AutoMapper;
-using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Auth;
@@ -20,11 +19,13 @@ namespace Timeline.Controllers
{
private readonly IHighlightTimelineService _service;
private readonly ITimelineService _timelineService;
+ private readonly TimelineMapper _timelineMapper;
- public HighlightTimelineController(IHighlightTimelineService service, ITimelineService timelineService)
+ public HighlightTimelineController(IHighlightTimelineService service, ITimelineService timelineService, TimelineMapper timelineMapper)
{
_service = service;
_timelineService = timelineService;
+ _timelineMapper = timelineMapper;
}
/// <summary>
@@ -37,7 +38,7 @@ namespace Timeline.Controllers
{
var ids = await _service.GetHighlightTimelines();
var timelines = await _timelineService.GetTimelineList(ids);
- return timelines.MapToHttp(Url);
+ return await _timelineMapper.MapToHttp(timelines, Url);
}
/// <summary>