aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 16:23:20 +0800
committercrupest <crupest@outlook.com>2021-01-07 16:23:20 +0800
commit7594a16e38304739487b053405153379faee6e58 (patch)
treebb99d1a24fffc9c4142219b9c25dc66e3d2b60d2 /BackEnd/Timeline/Controllers/HighlightTimelineController.cs
parent97e094c97dc9ed79cf7daa0a93568e1933015bdd (diff)
downloadtimeline-7594a16e38304739487b053405153379faee6e58.tar.gz
timeline-7594a16e38304739487b053405153379faee6e58.tar.bz2
timeline-7594a16e38304739487b053405153379faee6e58.zip
史诗级重构!
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>