aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/Api
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-27 19:29:20 +0800
committercrupest <crupest@outlook.com>2021-04-27 19:29:20 +0800
commita665f5d894539cae5f4188e4a72ea9634b8c4ed0 (patch)
tree03aa9d578e13213018c178ba47755167e2ccc2d4 /BackEnd/Timeline/Services/Api
parent89e3c2103fa478ebc659a1b914e75d5138c06c08 (diff)
downloadtimeline-a665f5d894539cae5f4188e4a72ea9634b8c4ed0.tar.gz
timeline-a665f5d894539cae5f4188e4a72ea9634b8c4ed0.tar.bz2
timeline-a665f5d894539cae5f4188e4a72ea9634b8c4ed0.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Services/Api')
-rw-r--r--BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs10
-rw-r--r--BackEnd/Timeline/Services/Api/HighlightTimelineService.cs4
2 files changed, 7 insertions, 7 deletions
diff --git a/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs b/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs
index 0d4cc0a6..cabc1db2 100644
--- a/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs
+++ b/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs
@@ -93,7 +93,7 @@ namespace Timeline.Services.Api
public async Task<bool> AddBookmark(long userId, long timelineId)
{
- if (!await _userService.CheckUserExistence(userId))
+ if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
if (!await _timelineService.CheckExistence(timelineId))
@@ -115,7 +115,7 @@ namespace Timeline.Services.Api
public async Task<List<long>> GetBookmarks(long userId)
{
- if (!await _userService.CheckUserExistence(userId))
+ if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
var entities = await _database.BookmarkTimelines.Where(t => t.UserId == userId).OrderBy(t => t.Rank).Select(t => new { t.TimelineId }).ToListAsync();
@@ -125,7 +125,7 @@ namespace Timeline.Services.Api
public async Task<bool> IsBookmark(long userId, long timelineId, bool checkUserExistence = true, bool checkTimelineExistence = true)
{
- if (checkUserExistence && !await _userService.CheckUserExistence(userId))
+ if (checkUserExistence && !await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
if (checkTimelineExistence && !await _timelineService.CheckExistence(timelineId))
@@ -136,7 +136,7 @@ namespace Timeline.Services.Api
public async Task MoveBookmark(long userId, long timelineId, long newPosition)
{
- if (!await _userService.CheckUserExistence(userId))
+ if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
if (!await _timelineService.CheckExistence(timelineId))
@@ -178,7 +178,7 @@ namespace Timeline.Services.Api
public async Task<bool> RemoveBookmark(long userId, long timelineId)
{
- if (!await _userService.CheckUserExistence(userId))
+ if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
if (!await _timelineService.CheckExistence(timelineId))
diff --git a/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs b/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs
index 9ef8ea84..419aa68d 100644
--- a/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs
+++ b/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs
@@ -95,7 +95,7 @@ namespace Timeline.Services.Api
if (!await _timelineService.CheckExistence(timelineId))
throw new TimelineNotExistException(timelineId);
- if (operatorId.HasValue && !await _userService.CheckUserExistence(operatorId.Value))
+ if (operatorId.HasValue && !await _userService.CheckUserExistenceAsync(operatorId.Value))
{
throw new UserNotExistException(null, operatorId.Value, "User with given operator id does not exist.", null);
}
@@ -121,7 +121,7 @@ namespace Timeline.Services.Api
if (!await _timelineService.CheckExistence(timelineId))
throw new TimelineNotExistException(timelineId);
- if (operatorId.HasValue && !await _userService.CheckUserExistence(operatorId.Value))
+ if (operatorId.HasValue && !await _userService.CheckUserExistenceAsync(operatorId.Value))
{
throw new UserNotExistException(null, operatorId.Value, "User with given operator id does not exist.", null);
}