diff options
author | crupest <crupest@outlook.com> | 2020-11-27 01:26:23 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-27 01:26:23 +0800 |
commit | 5e4cdbbfa75ce021dfbfd8e1f2d38370a702285e (patch) | |
tree | e0c263bd7a3827c0f6ddbee123362f7f79757a0c /BackEnd/Timeline/Services/HighlightTimelineService.cs | |
parent | 7883590a7a0c5c5c4e5cff6290e26c64e1258a25 (diff) | |
download | timeline-5e4cdbbfa75ce021dfbfd8e1f2d38370a702285e.tar.gz timeline-5e4cdbbfa75ce021dfbfd8e1f2d38370a702285e.tar.bz2 timeline-5e4cdbbfa75ce021dfbfd8e1f2d38370a702285e.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Services/HighlightTimelineService.cs')
-rw-r--r-- | BackEnd/Timeline/Services/HighlightTimelineService.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/BackEnd/Timeline/Services/HighlightTimelineService.cs b/BackEnd/Timeline/Services/HighlightTimelineService.cs index 619bc33e..0f4e5488 100644 --- a/BackEnd/Timeline/Services/HighlightTimelineService.cs +++ b/BackEnd/Timeline/Services/HighlightTimelineService.cs @@ -46,12 +46,14 @@ namespace Timeline.Services private readonly DatabaseContext _database;
private readonly IBasicUserService _userService;
private readonly ITimelineService _timelineService;
+ private readonly IClock _clock;
- public HighlightTimelineService(DatabaseContext database, IBasicUserService userService, ITimelineService timelineService)
+ public HighlightTimelineService(DatabaseContext database, IBasicUserService userService, ITimelineService timelineService, IClock clock)
{
_database = database;
_userService = userService;
_timelineService = timelineService;
+ _clock = clock;
}
public async Task AddHighlightTimeline(string timelineName, long? operatorId)
@@ -70,7 +72,7 @@ namespace Timeline.Services if (alreadyIs) return;
- _database.HighlightTimelines.Add(new HighlightTimelineEntity { TimelineId = timelineId, OperatorId = operatorId });
+ _database.HighlightTimelines.Add(new HighlightTimelineEntity { TimelineId = timelineId, OperatorId = operatorId, AddTime = _clock.GetCurrentTime() });
await _database.SaveChangesAsync();
}
|