From 52c59d7cd949ee6ccc89fbb25231666e1e589fe2 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 10 Mar 2020 15:46:59 +0800 Subject: Revert namespace name change. --- Timeline/Services/BadPasswordException.cs | 4 +-- Timeline/Services/Clock.cs | 2 +- Timeline/Services/ConflictException.cs | 2 +- Timeline/Services/DataManager.cs | 4 +-- Timeline/Services/DatabaseCorruptedException.cs | 2 +- Timeline/Services/ETagGenerator.cs | 2 +- Timeline/Services/ImageException.cs | 2 +- Timeline/Services/ImageValidator.cs | 2 +- .../Services/JwtUserTokenBadFormatException.cs | 4 +-- Timeline/Services/PasswordBadFormatException.cs | 2 +- Timeline/Services/PasswordService.cs | 2 +- Timeline/Services/PathProvider.cs | 2 +- Timeline/Services/TimelineNotExistException.cs | 2 +- Timeline/Services/TimelinePostNotExistException.cs | 2 +- Timeline/Services/TimelineService.cs | 32 +++++++++++----------- Timeline/Services/UserAvatarService.cs | 6 ++-- Timeline/Services/UserNotExistException.cs | 4 +-- Timeline/Services/UserRoleConvert.cs | 4 +-- Timeline/Services/UserService.cs | 12 ++++---- Timeline/Services/UserTokenException.cs | 2 +- Timeline/Services/UserTokenManager.cs | 4 +-- Timeline/Services/UserTokenService.cs | 6 ++-- 22 files changed, 52 insertions(+), 52 deletions(-) (limited to 'Timeline/Services') diff --git a/Timeline/Services/BadPasswordException.cs b/Timeline/Services/BadPasswordException.cs index 93251055..f609371d 100644 --- a/Timeline/Services/BadPasswordException.cs +++ b/Timeline/Services/BadPasswordException.cs @@ -1,7 +1,7 @@ using System; -using TimelineApp.Helpers; +using Timeline.Helpers; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] public class BadPasswordException : Exception diff --git a/Timeline/Services/Clock.cs b/Timeline/Services/Clock.cs index 68441e92..0499c0c6 100644 --- a/Timeline/Services/Clock.cs +++ b/Timeline/Services/Clock.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace TimelineApp.Services +namespace Timeline.Services { /// /// Convenient for unit test. diff --git a/Timeline/Services/ConflictException.cs b/Timeline/Services/ConflictException.cs index be9ec2c0..6ede183a 100644 --- a/Timeline/Services/ConflictException.cs +++ b/Timeline/Services/ConflictException.cs @@ -1,6 +1,6 @@ using System; -namespace TimelineApp.Services +namespace Timeline.Services { /// /// Thrown when a resource already exists and conflicts with the given resource. diff --git a/Timeline/Services/DataManager.cs b/Timeline/Services/DataManager.cs index a4241c1b..d447b0d5 100644 --- a/Timeline/Services/DataManager.cs +++ b/Timeline/Services/DataManager.cs @@ -2,9 +2,9 @@ using System; using System.Linq; using System.Threading.Tasks; -using TimelineApp.Entities; +using Timeline.Entities; -namespace TimelineApp.Services +namespace Timeline.Services { /// /// A data manager controlling data. diff --git a/Timeline/Services/DatabaseCorruptedException.cs b/Timeline/Services/DatabaseCorruptedException.cs index f5bd0c85..9988e0ad 100644 --- a/Timeline/Services/DatabaseCorruptedException.cs +++ b/Timeline/Services/DatabaseCorruptedException.cs @@ -1,6 +1,6 @@ using System; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] public class DatabaseCorruptedException : Exception diff --git a/Timeline/Services/ETagGenerator.cs b/Timeline/Services/ETagGenerator.cs index b7efd037..d328ea20 100644 --- a/Timeline/Services/ETagGenerator.cs +++ b/Timeline/Services/ETagGenerator.cs @@ -2,7 +2,7 @@ using System.Security.Cryptography; using System.Threading.Tasks; -namespace TimelineApp.Services +namespace Timeline.Services { public interface IETagGenerator { diff --git a/Timeline/Services/ImageException.cs b/Timeline/Services/ImageException.cs index f3f3b010..c6126aa3 100644 --- a/Timeline/Services/ImageException.cs +++ b/Timeline/Services/ImageException.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] public class ImageException : Exception diff --git a/Timeline/Services/ImageValidator.cs b/Timeline/Services/ImageValidator.cs index f10bb4d0..c331d912 100644 --- a/Timeline/Services/ImageValidator.cs +++ b/Timeline/Services/ImageValidator.cs @@ -4,7 +4,7 @@ using System; using System.Linq; using System.Threading.Tasks; -namespace TimelineApp.Services +namespace Timeline.Services { public interface IImageValidator { diff --git a/Timeline/Services/JwtUserTokenBadFormatException.cs b/Timeline/Services/JwtUserTokenBadFormatException.cs index 81450486..c528c3e3 100644 --- a/Timeline/Services/JwtUserTokenBadFormatException.cs +++ b/Timeline/Services/JwtUserTokenBadFormatException.cs @@ -1,8 +1,8 @@ using System; using System.Globalization; -using static TimelineApp.Resources.Services.Exception; +using static Timeline.Resources.Services.Exception; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] public class JwtUserTokenBadFormatException : UserTokenBadFormatException diff --git a/Timeline/Services/PasswordBadFormatException.cs b/Timeline/Services/PasswordBadFormatException.cs index 4db52092..2029ebb4 100644 --- a/Timeline/Services/PasswordBadFormatException.cs +++ b/Timeline/Services/PasswordBadFormatException.cs @@ -1,6 +1,6 @@ using System; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] diff --git a/Timeline/Services/PasswordService.cs b/Timeline/Services/PasswordService.cs index b08fe14d..e04a861b 100644 --- a/Timeline/Services/PasswordService.cs +++ b/Timeline/Services/PasswordService.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.CompilerServices; using System.Security.Cryptography; -namespace TimelineApp.Services +namespace Timeline.Services { /// /// Hashed password is of bad format. diff --git a/Timeline/Services/PathProvider.cs b/Timeline/Services/PathProvider.cs index 79f309a1..15e66972 100644 --- a/Timeline/Services/PathProvider.cs +++ b/Timeline/Services/PathProvider.cs @@ -5,7 +5,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -namespace TimelineApp.Services +namespace Timeline.Services { public interface IPathProvider { diff --git a/Timeline/Services/TimelineNotExistException.cs b/Timeline/Services/TimelineNotExistException.cs index b5bb0580..6dfd0bab 100644 --- a/Timeline/Services/TimelineNotExistException.cs +++ b/Timeline/Services/TimelineNotExistException.cs @@ -1,6 +1,6 @@ using System; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] public class TimelineNotExistException : Exception diff --git a/Timeline/Services/TimelinePostNotExistException.cs b/Timeline/Services/TimelinePostNotExistException.cs index 488bfe2b..c542e63e 100644 --- a/Timeline/Services/TimelinePostNotExistException.cs +++ b/Timeline/Services/TimelinePostNotExistException.cs @@ -1,6 +1,6 @@ using System; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] public class TimelinePostNotExistException : Exception diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs index 8c1e62d4..1bccb855 100644 --- a/Timeline/Services/TimelineService.cs +++ b/Timeline/Services/TimelineService.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading.Tasks; -using TimelineApp.Entities; -using TimelineApp.Models; -using TimelineApp.Models.Validation; -using static TimelineApp.Resources.Services.TimelineService; +using Timeline.Entities; +using Timeline.Models; +using Timeline.Models.Validation; +using static Timeline.Resources.Services.TimelineService; -namespace TimelineApp.Services +namespace Timeline.Services { public enum TimelineUserRelationshipType { @@ -67,7 +67,7 @@ namespace TimelineApp.Services /// Thrown when is null. /// See remarks of . /// See remarks of . - Task GetTimeline(string name); + Task GetTimeline(string name); /// /// Set the properties of a timeline. @@ -252,7 +252,7 @@ namespace TimelineApp.Services /// /// If user with related user id does not exist, empty list will be returned. /// - Task> GetTimelines(TimelineUserRelationship? relate = null, List? visibility = null); + Task> GetTimelines(TimelineUserRelationship? relate = null, List? visibility = null); /// /// Create a timeline. @@ -264,7 +264,7 @@ namespace TimelineApp.Services /// Thrown when timeline name is invalid. /// Thrown when the timeline already exists. /// Thrown when the owner user does not exist. - Task CreateTimeline(string name, long owner); + Task CreateTimeline(string name, long owner); /// /// Delete a timeline. @@ -334,7 +334,7 @@ namespace TimelineApp.Services /// protected abstract Task FindTimelineId(string name); - public async Task GetTimeline(string name) + public async Task GetTimeline(string name) { if (name == null) throw new ArgumentNullException(nameof(name)); @@ -353,7 +353,7 @@ namespace TimelineApp.Services members.Add(await UserService.GetUserById(memberEntity.UserId)); } - return new Timeline + return new Models.Timeline { Name = timelineEntity.Name ?? ("@" + owner.Username), Description = timelineEntity.Description ?? "", @@ -849,7 +849,7 @@ namespace TimelineApp.Services } } - public async Task> GetTimelines(TimelineUserRelationship? relate = null, List? visibility = null) + public async Task> GetTimelines(TimelineUserRelationship? relate = null, List? visibility = null) { List entities; @@ -883,12 +883,12 @@ namespace TimelineApp.Services } } - var result = new List(); + var result = new List(); foreach (var entity in entities) { var owner = await _userService.GetUserById(entity.OwnerId); - var timeline = new Timeline + var timeline = new Models.Timeline { Name = entity.Name ?? ("@" + owner.Username), Description = entity.Description ?? "", @@ -908,7 +908,7 @@ namespace TimelineApp.Services return result; } - public async Task CreateTimeline(string name, long owner) + public async Task CreateTimeline(string name, long owner) { if (name == null) throw new ArgumentNullException(nameof(name)); @@ -934,7 +934,7 @@ namespace TimelineApp.Services _database.Timelines.Add(newEntity); await _database.SaveChangesAsync(); - return new Timeline + return new Models.Timeline { Name = name, Description = "", @@ -978,7 +978,7 @@ namespace TimelineApp.Services } } - public Task GetTimeline(string name) + public Task GetTimeline(string name) { var s = BranchName(name, out var realName); return s.GetTimeline(realName); diff --git a/Timeline/Services/UserAvatarService.cs b/Timeline/Services/UserAvatarService.cs index 5f2ce4ed..1b1be698 100644 --- a/Timeline/Services/UserAvatarService.cs +++ b/Timeline/Services/UserAvatarService.cs @@ -6,10 +6,10 @@ using System; using System.IO; using System.Linq; using System.Threading.Tasks; -using TimelineApp.Entities; -using TimelineApp.Helpers; +using Timeline.Entities; +using Timeline.Helpers; -namespace TimelineApp.Services +namespace Timeline.Services { public class Avatar { diff --git a/Timeline/Services/UserNotExistException.cs b/Timeline/Services/UserNotExistException.cs index b51378ed..fd0b5ecf 100644 --- a/Timeline/Services/UserNotExistException.cs +++ b/Timeline/Services/UserNotExistException.cs @@ -1,7 +1,7 @@ using System; -using TimelineApp.Helpers; +using Timeline.Helpers; -namespace TimelineApp.Services +namespace Timeline.Services { /// /// The user requested does not exist. diff --git a/Timeline/Services/UserRoleConvert.cs b/Timeline/Services/UserRoleConvert.cs index 78c52ae3..f27ee1bb 100644 --- a/Timeline/Services/UserRoleConvert.cs +++ b/Timeline/Services/UserRoleConvert.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using TimelineApp.Entities; +using Timeline.Entities; -namespace TimelineApp.Services +namespace Timeline.Services { public static class UserRoleConvert { diff --git a/Timeline/Services/UserService.cs b/Timeline/Services/UserService.cs index 3279d2bd..e0a5ab50 100644 --- a/Timeline/Services/UserService.cs +++ b/Timeline/Services/UserService.cs @@ -4,13 +4,13 @@ using System; using System.Globalization; using System.Linq; using System.Threading.Tasks; -using TimelineApp.Entities; -using TimelineApp.Helpers; -using TimelineApp.Models; -using TimelineApp.Models.Validation; -using static TimelineApp.Resources.Services.UserService; +using Timeline.Entities; +using Timeline.Helpers; +using Timeline.Models; +using Timeline.Models.Validation; +using static Timeline.Resources.Services.UserService; -namespace TimelineApp.Services +namespace Timeline.Services { public interface IUserService { diff --git a/Timeline/Services/UserTokenException.cs b/Timeline/Services/UserTokenException.cs index 99d26dec..ed0bae1a 100644 --- a/Timeline/Services/UserTokenException.cs +++ b/Timeline/Services/UserTokenException.cs @@ -1,6 +1,6 @@ using System; -namespace TimelineApp.Services +namespace Timeline.Services { [Serializable] diff --git a/Timeline/Services/UserTokenManager.cs b/Timeline/Services/UserTokenManager.cs index 4a044353..6decf8f9 100644 --- a/Timeline/Services/UserTokenManager.cs +++ b/Timeline/Services/UserTokenManager.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -using TimelineApp.Models; +using Timeline.Models; -namespace TimelineApp.Services +namespace Timeline.Services { public class UserTokenCreateResult { diff --git a/Timeline/Services/UserTokenService.cs b/Timeline/Services/UserTokenService.cs index 76501ce3..86f3a0f7 100644 --- a/Timeline/Services/UserTokenService.cs +++ b/Timeline/Services/UserTokenService.cs @@ -5,10 +5,10 @@ using System.Globalization; using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Security.Claims; -using TimelineApp.Configs; -using TimelineApp.Entities; +using Timeline.Configs; +using Timeline.Entities; -namespace TimelineApp.Services +namespace Timeline.Services { public class UserTokenInfo { -- cgit v1.2.3