diff options
author | crupest <crupest@outlook.com> | 2021-04-29 19:29:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-29 19:29:35 +0800 |
commit | bf4c48980f81e566065c07f3fe534ce7551ebdcc (patch) | |
tree | b34c57efd216c5b94845a298ffcb7480d773784c | |
parent | fc9eb47119dd33d67c1e4daba18608bfb3355f54 (diff) | |
download | timeline-bf4c48980f81e566065c07f3fe534ce7551ebdcc.tar.gz timeline-bf4c48980f81e566065c07f3fe534ce7551ebdcc.tar.bz2 timeline-bf4c48980f81e566065c07f3fe534ce7551ebdcc.zip |
...
32 files changed, 265 insertions, 1642 deletions
diff --git a/BackEnd/Timeline.Tests/Services/SearchServiceTest.cs b/BackEnd/Timeline.Tests/Services/SearchServiceTest.cs index 1c96eb34..6e3c0f40 100644 --- a/BackEnd/Timeline.Tests/Services/SearchServiceTest.cs +++ b/BackEnd/Timeline.Tests/Services/SearchServiceTest.cs @@ -24,7 +24,7 @@ namespace Timeline.Tests.Services await TimelineService.ChangePropertyAsync(t2.Id, new TimelineChangePropertyParams { Title = "hahaha" });
await TimelineService.CreateTimelineAsync("bbbbbb", UserId);
- var searchResult = await _service.SearchTimeline("hah");
+ var searchResult = await _service.SearchTimelineAsync("hah");
searchResult.Items.Should().HaveCount(2);
searchResult.Items[0].Item.Name.Should().Be("hahaha");
searchResult.Items[0].Score.Should().Be(2);
@@ -40,7 +40,7 @@ namespace Timeline.Tests.Services await UserService.ModifyUserAsync(u2.Id, new ModifyUserParams { Nickname = "hahaha" });
await UserService.CreateUserAsync(new CreateUserParams("bbbbbb", "p"));
- var searchResult = await _service.SearchUser("hah");
+ var searchResult = await _service.SearchUserAsync("hah");
searchResult.Items.Should().HaveCount(2);
searchResult.Items[0].Item.Username.Should().Be("hahaha");
searchResult.Items[0].Score.Should().Be(2);
diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs index e7ffa5c5..cbc96fc6 100644 --- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs +++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs @@ -44,7 +44,7 @@ namespace Timeline.Controllers [ProducesResponseType(401)]
public async Task<ActionResult<List<HttpTimeline>>> List()
{
- var ids = await _service.GetBookmarks(this.GetUserId());
+ var ids = await _service.GetBookmarksAsync(this.GetUserId());
var timelines = await _timelineService.GetTimelineList(ids);
return await Map(timelines);
}
@@ -63,7 +63,7 @@ namespace Timeline.Controllers try
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);
- var create = await _service.AddBookmark(this.GetUserId(), timelineId);
+ var create = await _service.AddBookmarkAsync(this.GetUserId(), timelineId);
return CommonPutResponse.Create(create);
}
catch (TimelineNotExistException)
@@ -86,7 +86,7 @@ namespace Timeline.Controllers try
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);
- var delete = await _service.RemoveBookmark(this.GetUserId(), timelineId);
+ var delete = await _service.RemoveBookmarkAsync(this.GetUserId(), timelineId);
return CommonDeleteResponse.Create(delete);
}
catch (TimelineNotExistException)
@@ -109,7 +109,7 @@ namespace Timeline.Controllers try
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(request.Timeline);
- await _service.MoveBookmark(this.GetUserId(), timelineId, request.NewPosition!.Value);
+ await _service.MoveBookmarkAsync(this.GetUserId(), timelineId, request.NewPosition!.Value);
return Ok();
}
catch (TimelineNotExistException)
diff --git a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs index 4e739056..ffaa50c1 100644 --- a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs +++ b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs @@ -43,7 +43,7 @@ namespace Timeline.Controllers [ProducesResponseType(200)]
public async Task<ActionResult<List<HttpTimeline>>> List()
{
- var ids = await _service.GetHighlightTimelines();
+ var ids = await _service.GetHighlightTimelinesAsync();
var timelines = await _timelineService.GetTimelineList(ids);
return await Map(timelines);
}
@@ -63,7 +63,7 @@ namespace Timeline.Controllers try
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);
- var create = await _service.AddHighlightTimeline(timelineId, this.GetUserId());
+ var create = await _service.AddHighlightTimelineAsync(timelineId, this.GetUserId());
return CommonPutResponse.Create(create);
}
catch (TimelineNotExistException)
@@ -87,7 +87,7 @@ namespace Timeline.Controllers try
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);
- var delete = await _service.RemoveHighlightTimeline(timelineId, this.GetUserId());
+ var delete = await _service.RemoveHighlightTimelineAsync(timelineId, this.GetUserId());
return CommonDeleteResponse.Create(delete);
}
catch (TimelineNotExistException)
@@ -110,7 +110,7 @@ namespace Timeline.Controllers try
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(body.Timeline);
- await _service.MoveHighlightTimeline(timelineId, body.NewPosition!.Value);
+ await _service.MoveHighlightTimelineAsync(timelineId, body.NewPosition!.Value);
return Ok();
}
catch (TimelineNotExistException)
diff --git a/BackEnd/Timeline/Controllers/SearchController.cs b/BackEnd/Timeline/Controllers/SearchController.cs index 76f3d8f2..cd085e5b 100644 --- a/BackEnd/Timeline/Controllers/SearchController.cs +++ b/BackEnd/Timeline/Controllers/SearchController.cs @@ -42,7 +42,7 @@ namespace Timeline.Controllers [ProducesResponseType(400)]
public async Task<ActionResult<List<HttpTimeline>>> TimelineSearch([FromQuery(Name = "q"), Required(AllowEmptyStrings = false)] string query)
{
- var searchResult = await _service.SearchTimeline(query);
+ var searchResult = await _service.SearchTimelineAsync(query);
var timelines = searchResult.Items.Select(i => i.Item).ToList();
return await Map(timelines);
}
@@ -57,7 +57,7 @@ namespace Timeline.Controllers [ProducesResponseType(400)]
public async Task<ActionResult<List<HttpUser>>> UserSearch([FromQuery(Name = "q"), Required(AllowEmptyStrings = false)] string query)
{
- var searchResult = await _service.SearchUser(query);
+ var searchResult = await _service.SearchUserAsync(query);
var users = searchResult.Items.Select(i => i.Item).ToList();
return await _mapper.MapListAsync<HttpUser>(users, Url, User);
}
diff --git a/BackEnd/Timeline/Controllers/TimelineController.cs b/BackEnd/Timeline/Controllers/TimelineController.cs index 497d7893..3fd0f2ac 100644 --- a/BackEnd/Timeline/Controllers/TimelineController.cs +++ b/BackEnd/Timeline/Controllers/TimelineController.cs @@ -29,9 +29,6 @@ namespace Timeline.Controllers private readonly ITimelineService _service;
private readonly IGenericMapper _mapper;
- /// <summary>
- ///
- /// </summary>
public TimelineController(IUserService userService, ITimelineService service, IGenericMapper mapper)
{
_userService = userService;
diff --git a/BackEnd/Timeline/Controllers/TimelinePostController.cs b/BackEnd/Timeline/Controllers/TimelinePostController.cs index 2e1ed3a9..2d3e5423 100644 --- a/BackEnd/Timeline/Controllers/TimelinePostController.cs +++ b/BackEnd/Timeline/Controllers/TimelinePostController.cs @@ -35,9 +35,6 @@ namespace Timeline.Controllers private readonly MarkdownProcessor _markdownProcessor;
- /// <summary>
- ///
- /// </summary>
public TimelinePostController(ITimelineService timelineService, ITimelinePostService timelinePostService, IGenericMapper mapper, MarkdownProcessor markdownProcessor)
{
_timelineService = timelineService;
diff --git a/BackEnd/Timeline/Controllers/TokenController.cs b/BackEnd/Timeline/Controllers/TokenController.cs index e728ae6d..3d4e9444 100644 --- a/BackEnd/Timeline/Controllers/TokenController.cs +++ b/BackEnd/Timeline/Controllers/TokenController.cs @@ -1,17 +1,13 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
using System;
-using System.Globalization;
using System.Threading.Tasks;
-using Timeline.Helpers;
using Timeline.Models.Http;
using Timeline.Services;
using Timeline.Services.Mapper;
using Timeline.Services.Token;
using Timeline.Services.User;
-using static Timeline.Resources.Controllers.TokenController;
namespace Timeline.Controllers
{
@@ -24,15 +20,12 @@ namespace Timeline.Controllers public class TokenController : Controller
{
private readonly IUserTokenManager _userTokenManager;
- private readonly ILogger<TokenController> _logger;
private readonly IGenericMapper _mapper;
private readonly IClock _clock;
- /// <summary></summary>
- public TokenController(IUserTokenManager userTokenManager, ILogger<TokenController> logger, IGenericMapper mapper, IClock clock)
+ public TokenController(IUserTokenManager userTokenManager, IGenericMapper mapper, IClock clock)
{
_userTokenManager = userTokenManager;
- _logger = logger;
_mapper = mapper;
_clock = clock;
}
@@ -47,15 +40,6 @@ namespace Timeline.Controllers [ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<HttpCreateTokenResponse>> Create([FromBody] HttpCreateTokenRequest request)
{
- void LogFailure(string reason, Exception? e = null)
- {
- _logger.LogInformation(e, Log.Format(LogCreateFailure,
- ("Reason", reason),
- ("Username", request.Username),
- ("Password", request.Password),
- ("Expire (in days)", request.Expire)
- ));
- }
try
{
@@ -65,24 +49,18 @@ namespace Timeline.Controllers var result = await _userTokenManager.CreateTokenAsync(request.Username, request.Password, expireTime);
- _logger.LogInformation(Log.Format(LogCreateSuccess,
- ("Username", request.Username),
- ("Expire At", expireTime?.ToString(CultureInfo.CurrentCulture.DateTimeFormat) ?? "default")
- ));
return new HttpCreateTokenResponse
{
Token = result.Token,
User = await _mapper.MapAsync<HttpUser>(result.User, Url, User)
};
}
- catch (UserNotExistException e)
+ catch (UserNotExistException)
{
- LogFailure(LogUserNotExist, e);
return BadRequest(ErrorResponse.TokenController.Create_BadCredential());
}
- catch (BadPasswordException e)
+ catch (BadPasswordException)
{
- LogFailure(LogBadPassword, e);
return BadRequest(ErrorResponse.TokenController.Create_BadCredential());
}
}
@@ -97,44 +75,28 @@ namespace Timeline.Controllers [ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<HttpVerifyTokenResponse>> Verify([FromBody] HttpVerifyTokenRequest request)
{
- void LogFailure(string reason, Exception? e = null, params (string, object?)[] otherProperties)
- {
- var properties = new (string, object?)[2 + otherProperties.Length];
- properties[0] = ("Reason", reason);
- properties[1] = ("Token", request.Token);
- otherProperties.CopyTo(properties, 2);
- _logger.LogInformation(e, Log.Format(LogVerifyFailure, properties));
- }
-
try
{
var result = await _userTokenManager.VerifyTokenAsync(request.Token);
- _logger.LogInformation(Log.Format(LogVerifySuccess,
- ("Username", result.Username), ("Token", request.Token)));
return new HttpVerifyTokenResponse
{
User = await _mapper.MapAsync<HttpUser>(result, Url, User)
};
}
- catch (UserTokenTimeExpiredException e)
+ catch (UserTokenTimeExpiredException)
{
- LogFailure(LogVerifyExpire, e, ("Expire Time", e.ExpireTime), ("Verify Time", e.VerifyTime));
return BadRequest(ErrorResponse.TokenController.Verify_TimeExpired());
}
- catch (UserTokenVersionExpiredException e)
+ catch (UserTokenVersionExpiredException)
{
- LogFailure(LogVerifyOldVersion, e, ("Token Version", e.TokenVersion), ("Required Version", e.RequiredVersion));
return BadRequest(ErrorResponse.TokenController.Verify_OldVersion());
-
}
- catch (UserTokenBadFormatException e)
+ catch (UserTokenBadFormatException)
{
- LogFailure(LogVerifyBadFormat, e);
return BadRequest(ErrorResponse.TokenController.Verify_BadFormat());
}
- catch (UserTokenUserNotExistException e)
+ catch (UserTokenUserNotExistException)
{
- LogFailure(LogVerifyUserNotExist, e);
return BadRequest(ErrorResponse.TokenController.Verify_UserNotExist());
}
}
diff --git a/BackEnd/Timeline/Controllers/UserAvatarController.cs b/BackEnd/Timeline/Controllers/UserAvatarController.cs index c280f033..b1129329 100644 --- a/BackEnd/Timeline/Controllers/UserAvatarController.cs +++ b/BackEnd/Timeline/Controllers/UserAvatarController.cs @@ -1,11 +1,9 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Timeline.Filters;
-using Timeline.Helpers;
using Timeline.Helpers.Cache;
using Timeline.Models;
using Timeline.Models.Http;
@@ -13,7 +11,6 @@ using Timeline.Models.Validation; using Timeline.Services.Imaging;
using Timeline.Services.User;
using Timeline.Services.User.Avatar;
-using static Timeline.Resources.Controllers.UserAvatarController;
namespace Timeline.Controllers
{
@@ -24,17 +21,11 @@ namespace Timeline.Controllers [ProducesErrorResponseType(typeof(CommonResponse))]
public class UserAvatarController : Controller
{
- private readonly ILogger<UserAvatarController> _logger;
-
private readonly IUserService _userService;
private readonly IUserAvatarService _service;
- /// <summary>
- ///
- /// </summary>
- public UserAvatarController(ILogger<UserAvatarController> logger, IUserService userService, IUserAvatarService service)
+ public UserAvatarController(IUserService userService, IUserAvatarService service)
{
- _logger = logger;
_userService = userService;
_service = service;
}
@@ -53,18 +44,16 @@ namespace Timeline.Controllers public async Task<IActionResult> Get([FromRoute][Username] string username, [FromHeader(Name = "If-None-Match")] string? ifNoneMatch)
{
_ = ifNoneMatch;
- long id;
try
{
- id = await _userService.GetUserIdByUsernameAsync(username);
+ long userId = await _userService.GetUserIdByUsernameAsync(username);
+ return await DataCacheHelper.GenerateActionResult(this, () => _service.GetAvatarDigestAsync(userId), () => _service.GetAvatarAsync(userId));
}
- catch (UserNotExistException e)
+ catch (UserNotExistException)
{
- _logger.LogInformation(e, Log.Format(LogGetUserNotExist, ("Username", username)));
return NotFound(ErrorResponse.UserCommon.NotExist());
}
- return await DataCacheHelper.GenerateActionResult(this, () => _service.GetAvatarDigestAsync(id), () => _service.GetAvatarAsync(id));
}
/// <summary>
@@ -84,8 +73,6 @@ namespace Timeline.Controllers {
if (!this.UserHasPermission(UserPermission.UserManagement) && User.Identity!.Name != username)
{
- _logger.LogInformation(Log.Format(LogPutForbid,
- ("Operator Username", User.Identity.Name), ("Username To Put Avatar", username)));
return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
}
@@ -94,9 +81,8 @@ namespace Timeline.Controllers {
id = await _userService.GetUserIdByUsernameAsync(username);
}
- catch (UserNotExistException e)
+ catch (UserNotExistException)
{
- _logger.LogInformation(e, Log.Format(LogPutUserNotExist, ("Username", username)));
return BadRequest(ErrorResponse.UserCommon.NotExist());
}
@@ -104,23 +90,18 @@ namespace Timeline.Controllers {
var digest = await _service.SetAvatarAsync(id, body);
- _logger.LogInformation(Log.Format(LogPutSuccess,
- ("Username", username), ("Mime Type", Request.ContentType)));
-
Response.Headers.Append("ETag", $"\"{digest.ETag}\"");
return Ok();
}
catch (ImageException e)
{
- _logger.LogInformation(e, Log.Format(LogPutUserBadFormat, ("Username", username)));
return BadRequest(e.Error switch
{
ImageException.ErrorReason.CantDecode => ErrorResponse.UserAvatar.BadFormat_CantDecode(),
ImageException.ErrorReason.UnmatchedFormat => ErrorResponse.UserAvatar.BadFormat_UnmatchedFormat(),
ImageException.ErrorReason.BadSize => ErrorResponse.UserAvatar.BadFormat_BadSize(),
- _ =>
- throw new Exception(ExceptionUnknownAvatarFormatError)
+ _ => throw new Exception()
});
}
}
@@ -143,8 +124,6 @@ namespace Timeline.Controllers {
if (!this.UserHasPermission(UserPermission.UserManagement) && User.Identity!.Name != username)
{
- _logger.LogInformation(Log.Format(LogDeleteForbid,
- ("Operator Username", User.Identity!.Name), ("Username To Delete Avatar", username)));
return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
}
@@ -153,9 +132,8 @@ namespace Timeline.Controllers {
id = await _userService.GetUserIdByUsernameAsync(username);
}
- catch (UserNotExistException e)
+ catch (UserNotExistException)
{
- _logger.LogInformation(e, Log.Format(LogDeleteNotExist, ("Username", username)));
return BadRequest(ErrorResponse.UserCommon.NotExist());
}
diff --git a/BackEnd/Timeline/Controllers/UserController.cs b/BackEnd/Timeline/Controllers/UserController.cs index 615eac2d..c0ae6a09 100644 --- a/BackEnd/Timeline/Controllers/UserController.cs +++ b/BackEnd/Timeline/Controllers/UserController.cs @@ -1,18 +1,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Auth;
-using Timeline.Helpers;
using Timeline.Models.Http;
using Timeline.Models.Validation;
using Timeline.Services;
using Timeline.Services.Mapper;
using Timeline.Services.User;
-using static Timeline.Resources.Controllers.UserController;
-using static Timeline.Resources.Messages;
namespace Timeline.Controllers
{
@@ -23,16 +19,14 @@ namespace Timeline.Controllers [ProducesErrorResponseType(typeof(CommonResponse))]
public class UserController : Controller
{
- private readonly ILogger<UserController> _logger;
private readonly IUserService _userService;
private readonly IUserPermissionService _userPermissionService;
private readonly IUserDeleteService _userDeleteService;
private readonly IGenericMapper _mapper;
/// <summary></summary>
- public UserController(ILogger<UserController> logger, IUserService userService, IUserPermissionService userPermissionService, IUserDeleteService userDeleteService, IGenericMapper mapper)
+ public UserController(IUserService userService, IUserPermissionService userPermissionService, IUserDeleteService userDeleteService, IGenericMapper mapper)
{
- _logger = logger;
_userService = userService;
_userPermissionService = userPermissionService;
_userDeleteService = userDeleteService;
@@ -93,9 +87,8 @@ namespace Timeline.Controllers var user = await _userService.GetUserAsync(id);
return await _mapper.MapAsync<HttpUser>(user, Url, User);
}
- catch (UserNotExistException e)
+ catch (UserNotExistException)
{
- _logger.LogInformation(e, Log.Format(LogGetUserNotExist, ("Username", username)));
return NotFound(ErrorResponse.UserCommon.NotExist());
}
}
@@ -122,9 +115,8 @@ namespace Timeline.Controllers var user = await _userService.ModifyUserAsync(id, _mapper.AutoMapperMap<ModifyUserParams>(body));
return await _mapper.MapAsync<HttpUser>(user, Url, User);
}
- catch (UserNotExistException e)
+ catch (UserNotExistException)
{
- _logger.LogInformation(e, Log.Format(LogPatchUserNotExist, ("Username", username)));
return NotFound(ErrorResponse.UserCommon.NotExist());
}
catch (EntityAlreadyExistException e) when (e.EntityName == EntityNames.User)
@@ -136,15 +128,15 @@ namespace Timeline.Controllers {
if (User.Identity!.Name != username)
return StatusCode(StatusCodes.Status403Forbidden,
- ErrorResponse.Common.CustomMessage_Forbid(Common_Forbid_NotSelf));
+ ErrorResponse.Common.CustomMessage_Forbid(Resources.Messages.Common_Forbid_NotSelf));
if (body.Username != null)
return StatusCode(StatusCodes.Status403Forbidden,
- ErrorResponse.Common.CustomMessage_Forbid(UserController_Patch_Forbid_Username));
+ ErrorResponse.Common.CustomMessage_Forbid(Resources.Messages.UserController_Patch_Forbid_Username));
if (body.Password != null)
return StatusCode(StatusCodes.Status403Forbidden,
- ErrorResponse.Common.CustomMessage_Forbid(UserController_Patch_Forbid_Password));
+ ErrorResponse.Common.CustomMessage_Forbid(Resources.Messages.UserController_Patch_Forbid_Password));
var user = await _userService.ModifyUserAsync(this.GetUserId(), _mapper.AutoMapperMap<ModifyUserParams>(body));
return await _mapper.MapAsync<HttpUser>(user, Url, User);
@@ -191,10 +183,8 @@ namespace Timeline.Controllers await _userService.ChangePassword(this.GetUserId(), request.OldPassword, request.NewPassword);
return Ok();
}
- catch (BadPasswordException e)
+ catch (BadPasswordException)
{
- _logger.LogInformation(e, Log.Format(LogChangePasswordBadPassword,
- ("Username", User.Identity!.Name), ("Old Password", request.OldPassword)));
return BadRequest(ErrorResponse.UserController.ChangePassword_BadOldPassword());
}
// User can't be non-existent or the token is bad.
diff --git a/BackEnd/Timeline/Helpers/Log.cs b/BackEnd/Timeline/Helpers/Log.cs deleted file mode 100644 index af0b7e13..00000000 --- a/BackEnd/Timeline/Helpers/Log.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Text;
-
-namespace Timeline.Helpers
-{
- public static class Log
- {
- public static string Format(string summary, params (string, object?)[] properties)
- {
- var builder = new StringBuilder();
- builder.Append(summary);
- foreach (var property in properties)
- {
- var (key, value) = property;
- builder.AppendLine();
- builder.Append(key);
- builder.Append(" : ");
- builder.Append(value);
- }
- return builder.ToString();
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Controllers/ControllerAuthExtensions.Designer.cs b/BackEnd/Timeline/Resources/Controllers/ControllerAuthExtensions.Designer.cs deleted file mode 100644 index 70a1d605..00000000 --- a/BackEnd/Timeline/Resources/Controllers/ControllerAuthExtensions.Designer.cs +++ /dev/null @@ -1,81 +0,0 @@ -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Controllers {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class ControllerAuthExtensions {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal ControllerAuthExtensions() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Controllers.ControllerAuthExtensions", typeof(ControllerAuthExtensions).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Failed to get user id because User has no NameIdentifier claim..
- /// </summary>
- internal static string ExceptionNoUserIdentifierClaim {
- get {
- return ResourceManager.GetString("ExceptionNoUserIdentifierClaim", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Failed to get user id because NameIdentifier claim is not a number..
- /// </summary>
- internal static string ExceptionUserIdentifierClaimBadFormat {
- get {
- return ResourceManager.GetString("ExceptionUserIdentifierClaimBadFormat", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Controllers/ControllerAuthExtensions.resx b/BackEnd/Timeline/Resources/Controllers/ControllerAuthExtensions.resx deleted file mode 100644 index 03e6d95a..00000000 --- a/BackEnd/Timeline/Resources/Controllers/ControllerAuthExtensions.resx +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="ExceptionNoUserIdentifierClaim" xml:space="preserve">
- <value>Failed to get user id because User has no NameIdentifier claim.</value>
- </data>
- <data name="ExceptionUserIdentifierClaimBadFormat" xml:space="preserve">
- <value>Failed to get user id because NameIdentifier claim is not a number.</value>
- </data>
-</root>
\ No newline at end of file diff --git a/BackEnd/Timeline/Resources/Controllers/TimelineController.Designer.cs b/BackEnd/Timeline/Resources/Controllers/TimelineController.Designer.cs deleted file mode 100644 index ae6414e6..00000000 --- a/BackEnd/Timeline/Resources/Controllers/TimelineController.Designer.cs +++ /dev/null @@ -1,81 +0,0 @@ -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Controllers {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class TimelineController {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal TimelineController() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Controllers.TimelineController", typeof(TimelineController).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to An unknown timeline visibility value. Can't convert it..
- /// </summary>
- internal static string ExceptionStringToVisibility {
- get {
- return ResourceManager.GetString("ExceptionStringToVisibility", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to An unknown TimelineMemberOperationUserException is thrown. Can't recognize its inner exception. It is rethrown..
- /// </summary>
- internal static string LogUnknownTimelineMemberOperationUserException {
- get {
- return ResourceManager.GetString("LogUnknownTimelineMemberOperationUserException", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Controllers/TimelineController.resx b/BackEnd/Timeline/Resources/Controllers/TimelineController.resx deleted file mode 100644 index 4cf3d6fb..00000000 --- a/BackEnd/Timeline/Resources/Controllers/TimelineController.resx +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="ExceptionStringToVisibility" xml:space="preserve">
- <value>An unknown timeline visibility value. Can't convert it.</value>
- </data>
- <data name="LogUnknownTimelineMemberOperationUserException" xml:space="preserve">
- <value>An unknown TimelineMemberOperationUserException is thrown. Can't recognize its inner exception. It is rethrown.</value>
- </data>
-</root>
\ No newline at end of file diff --git a/BackEnd/Timeline/Resources/Controllers/TokenController.Designer.cs b/BackEnd/Timeline/Resources/Controllers/TokenController.Designer.cs deleted file mode 100644 index a7c2864b..00000000 --- a/BackEnd/Timeline/Resources/Controllers/TokenController.Designer.cs +++ /dev/null @@ -1,153 +0,0 @@ -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Controllers {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class TokenController {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal TokenController() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Controllers.TokenController", typeof(TokenController).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to The password is wrong..
- /// </summary>
- internal static string LogBadPassword {
- get {
- return ResourceManager.GetString("LogBadPassword", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to A user failed to create a token..
- /// </summary>
- internal static string LogCreateFailure {
- get {
- return ResourceManager.GetString("LogCreateFailure", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to A user succeeded to create a token..
- /// </summary>
- internal static string LogCreateSuccess {
- get {
- return ResourceManager.GetString("LogCreateSuccess", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to The user does not exist..
- /// </summary>
- internal static string LogUserNotExist {
- get {
- return ResourceManager.GetString("LogUserNotExist", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to The token is of bad format. It might not be created by the server..
- /// </summary>
- internal static string LogVerifyBadFormat {
- get {
- return ResourceManager.GetString("LogVerifyBadFormat", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to The token is expired..
- /// </summary>
- internal static string LogVerifyExpire {
- get {
- return ResourceManager.GetString("LogVerifyExpire", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to A token failed to be verified..
- /// </summary>
- internal static string LogVerifyFailure {
- get {
- return ResourceManager.GetString("LogVerifyFailure", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Token has an old version. User might have update some info..
- /// </summary>
- internal static string LogVerifyOldVersion {
- get {
- return ResourceManager.GetString("LogVerifyOldVersion", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to A token succeeded to be verified..
- /// </summary>
- internal static string LogVerifySuccess {
- get {
- return ResourceManager.GetString("LogVerifySuccess", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to User does not exist. Administrator might have deleted this user..
- /// </summary>
- internal static string LogVerifyUserNotExist {
- get {
- return ResourceManager.GetString("LogVerifyUserNotExist", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Controllers/TokenController.resx b/BackEnd/Timeline/Resources/Controllers/TokenController.resx deleted file mode 100644 index 683d6cc9..00000000 --- a/BackEnd/Timeline/Resources/Controllers/TokenController.resx +++ /dev/null @@ -1,150 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="LogBadPassword" xml:space="preserve">
- <value>The password is wrong.</value>
- </data>
- <data name="LogCreateFailure" xml:space="preserve">
- <value>A user failed to create a token.</value>
- </data>
- <data name="LogCreateSuccess" xml:space="preserve">
- <value>A user succeeded to create a token.</value>
- </data>
- <data name="LogUserNotExist" xml:space="preserve">
- <value>The user does not exist.</value>
- </data>
- <data name="LogVerifyBadFormat" xml:space="preserve">
- <value>The token is of bad format. It might not be created by the server.</value>
- </data>
- <data name="LogVerifyExpire" xml:space="preserve">
- <value>The token is expired.</value>
- </data>
- <data name="LogVerifyFailure" xml:space="preserve">
- <value>A token failed to be verified.</value>
- </data>
- <data name="LogVerifyOldVersion" xml:space="preserve">
- <value>Token has an old version. User might have update some info.</value>
- </data>
- <data name="LogVerifySuccess" xml:space="preserve">
- <value>A token succeeded to be verified.</value>
- </data>
- <data name="LogVerifyUserNotExist" xml:space="preserve">
- <value>User does not exist. Administrator might have deleted this user.</value>
- </data>
-</root>
\ No newline at end of file diff --git a/BackEnd/Timeline/Resources/Controllers/UserAvatarController.Designer.cs b/BackEnd/Timeline/Resources/Controllers/UserAvatarController.Designer.cs deleted file mode 100644 index b0c35ff9..00000000 --- a/BackEnd/Timeline/Resources/Controllers/UserAvatarController.Designer.cs +++ /dev/null @@ -1,144 +0,0 @@ -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Controllers {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class UserAvatarController {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal UserAvatarController() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Controllers.UserAvatarController", typeof(UserAvatarController).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Unknown AvatarDataException.ErrorReason value..
- /// </summary>
- internal static string ExceptionUnknownAvatarFormatError {
- get {
- return ResourceManager.GetString("ExceptionUnknownAvatarFormatError", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to delete a avatar of other user as a non-admin failed..
- /// </summary>
- internal static string LogDeleteForbid {
- get {
- return ResourceManager.GetString("LogDeleteForbid", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to delete a avatar of a non-existent user failed..
- /// </summary>
- internal static string LogDeleteNotExist {
- get {
- return ResourceManager.GetString("LogDeleteNotExist", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Succeed to delete a avatar of a user..
- /// </summary>
- internal static string LogDeleteSuccess {
- get {
- return ResourceManager.GetString("LogDeleteSuccess", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to get a avatar of a non-existent user failed..
- /// </summary>
- internal static string LogGetUserNotExist {
- get {
- return ResourceManager.GetString("LogGetUserNotExist", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to put a avatar of other user as a non-admin failed..
- /// </summary>
- internal static string LogPutForbid {
- get {
- return ResourceManager.GetString("LogPutForbid", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Succeed to put a avatar of a user..
- /// </summary>
- internal static string LogPutSuccess {
- get {
- return ResourceManager.GetString("LogPutSuccess", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to put a avatar of a bad format failed..
- /// </summary>
- internal static string LogPutUserBadFormat {
- get {
- return ResourceManager.GetString("LogPutUserBadFormat", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to put a avatar of a non-existent user failed..
- /// </summary>
- internal static string LogPutUserNotExist {
- get {
- return ResourceManager.GetString("LogPutUserNotExist", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Controllers/UserAvatarController.resx b/BackEnd/Timeline/Resources/Controllers/UserAvatarController.resx deleted file mode 100644 index 864d96c0..00000000 --- a/BackEnd/Timeline/Resources/Controllers/UserAvatarController.resx +++ /dev/null @@ -1,147 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="ExceptionUnknownAvatarFormatError" xml:space="preserve">
- <value>Unknown AvatarDataException.ErrorReason value.</value>
- </data>
- <data name="LogDeleteForbid" xml:space="preserve">
- <value>Attempt to delete a avatar of other user as a non-admin failed.</value>
- </data>
- <data name="LogDeleteNotExist" xml:space="preserve">
- <value>Attempt to delete a avatar of a non-existent user failed.</value>
- </data>
- <data name="LogDeleteSuccess" xml:space="preserve">
- <value>Succeed to delete a avatar of a user.</value>
- </data>
- <data name="LogGetUserNotExist" xml:space="preserve">
- <value>Attempt to get a avatar of a non-existent user failed.</value>
- </data>
- <data name="LogPutForbid" xml:space="preserve">
- <value>Attempt to put a avatar of other user as a non-admin failed.</value>
- </data>
- <data name="LogPutSuccess" xml:space="preserve">
- <value>Succeed to put a avatar of a user.</value>
- </data>
- <data name="LogPutUserBadFormat" xml:space="preserve">
- <value>Attempt to put a avatar of a bad format failed.</value>
- </data>
- <data name="LogPutUserNotExist" xml:space="preserve">
- <value>Attempt to put a avatar of a non-existent user failed.</value>
- </data>
-</root>
\ No newline at end of file diff --git a/BackEnd/Timeline/Resources/Controllers/UserController.Designer.cs b/BackEnd/Timeline/Resources/Controllers/UserController.Designer.cs deleted file mode 100644 index c8067614..00000000 --- a/BackEnd/Timeline/Resources/Controllers/UserController.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Controllers {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class UserController {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal UserController() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Controllers.UserController", typeof(UserController).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Unknown PutResult..
- /// </summary>
- internal static string ExceptionUnknownPutResult {
- get {
- return ResourceManager.GetString("ExceptionUnknownPutResult", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to change password with wrong old password failed..
- /// </summary>
- internal static string LogChangePasswordBadPassword {
- get {
- return ResourceManager.GetString("LogChangePasswordBadPassword", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to change a user's username to a existent one failed..
- /// </summary>
- internal static string LogChangeUsernameConflict {
- get {
- return ResourceManager.GetString("LogChangeUsernameConflict", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to change a username of a user that does not exist failed..
- /// </summary>
- internal static string LogChangeUsernameNotExist {
- get {
- return ResourceManager.GetString("LogChangeUsernameNotExist", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to retrieve info of a user that does not exist failed..
- /// </summary>
- internal static string LogGetUserNotExist {
- get {
- return ResourceManager.GetString("LogGetUserNotExist", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Attempt to patch a user that does not exist failed..
- /// </summary>
- internal static string LogPatchUserNotExist {
- get {
- return ResourceManager.GetString("LogPatchUserNotExist", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Controllers/UserController.resx b/BackEnd/Timeline/Resources/Controllers/UserController.resx deleted file mode 100644 index 0bdf4845..00000000 --- a/BackEnd/Timeline/Resources/Controllers/UserController.resx +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="ExceptionUnknownPutResult" xml:space="preserve">
- <value>Unknown PutResult.</value>
- </data>
- <data name="LogChangePasswordBadPassword" xml:space="preserve">
- <value>Attempt to change password with wrong old password failed.</value>
- </data>
- <data name="LogChangeUsernameConflict" xml:space="preserve">
- <value>Attempt to change a user's username to a existent one failed.</value>
- </data>
- <data name="LogChangeUsernameNotExist" xml:space="preserve">
- <value>Attempt to change a username of a user that does not exist failed.</value>
- </data>
- <data name="LogGetUserNotExist" xml:space="preserve">
- <value>Attempt to retrieve info of a user that does not exist failed.</value>
- </data>
- <data name="LogPatchUserNotExist" xml:space="preserve">
- <value>Attempt to patch a user that does not exist failed.</value>
- </data>
-</root>
\ No newline at end of file diff --git a/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs b/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs index 37b55199..4fc20ecb 100644 --- a/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs +++ b/BackEnd/Timeline/Services/Api/BookmarkTimelineService.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore;
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -10,74 +9,6 @@ using Timeline.Services.User; namespace Timeline.Services.Api
{
- [Serializable]
- public class InvalidBookmarkException : Exception
- {
- public InvalidBookmarkException() { }
- public InvalidBookmarkException(string message) : base(message) { }
- public InvalidBookmarkException(string message, Exception inner) : base(message, inner) { }
- protected InvalidBookmarkException(
- System.Runtime.Serialization.SerializationInfo info,
- System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
- }
-
- /// <summary>
- /// Service interface that manages timeline bookmarks.
- /// </summary>
- public interface IBookmarkTimelineService
- {
- /// <summary>
- /// Get bookmarks of a user.
- /// </summary>
- /// <param name="userId">User id of bookmark owner.</param>
- /// <returns>Id of Bookmark timelines in order.</returns>
- /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
- Task<List<long>> GetBookmarks(long userId);
-
- /// <summary>
- /// Check if a timeline is a bookmark.
- /// </summary>
- /// <param name="userId">The user id.</param>
- /// <param name="timelineId">Timeline id.</param>
- /// <param name="checkUserExistence">If true it will throw when user does not exist.</param>
- /// <param name="checkTimelineExistence">If true it will throw when timeline does not exist.</param>
- /// <returns>True if timeline is a bookmark. Otherwise false.</returns>
- /// <exception cref="UserNotExistException">Throw if user does not exist and <paramref name="checkUserExistence"/> is true.</exception>
- /// <exception cref="TimelineNotExistException">Thrown if timeline does not exist and <paramref name="checkTimelineExistence"/> is true.</exception>
- Task<bool> IsBookmark(long userId, long timelineId, bool checkUserExistence = true, bool checkTimelineExistence = true);
-
- /// <summary>
- /// Add a bookmark to tail to a user.
- /// </summary>
- /// <param name="userId">User id of bookmark owner.</param>
- /// <param name="timelineId">Timeline id.</param>
- /// <returns>True if timeline is added to bookmark. False if it already is.</returns>
- /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
- /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist.</exception>
- Task<bool> AddBookmark(long userId, long timelineId);
-
- /// <summary>
- /// Remove a bookmark from a user.
- /// </summary>
- /// <param name="userId">User id of bookmark owner.</param>
- /// <param name="timelineId">Timeline id.</param>
- /// <returns>True if deletion is performed. False if bookmark does not exist.</returns>
- /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
- /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist.</exception>
- Task<bool> RemoveBookmark(long userId, long timelineId);
-
- /// <summary>
- /// Move bookmark to a new position.
- /// </summary>
- /// <param name="userId">User id of bookmark owner.</param>
- /// <param name="timelineId">Timeline name.</param>
- /// <param name="newPosition">New position. Starts at 1.</param>
- /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
- /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist.</exception>
- /// <exception cref="InvalidBookmarkException">Thrown when the timeline is not a bookmark.</exception>
- Task MoveBookmark(long userId, long timelineId, long newPosition);
- }
-
public class BookmarkTimelineService : IBookmarkTimelineService
{
private readonly DatabaseContext _database;
@@ -91,7 +22,7 @@ namespace Timeline.Services.Api _timelineService = timelineService;
}
- public async Task<bool> AddBookmark(long userId, long timelineId)
+ public async Task<bool> AddBookmarkAsync(long userId, long timelineId)
{
if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
@@ -113,7 +44,7 @@ namespace Timeline.Services.Api return true;
}
- public async Task<List<long>> GetBookmarks(long userId)
+ public async Task<List<long>> GetBookmarksAsync(long userId)
{
if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
@@ -123,7 +54,7 @@ namespace Timeline.Services.Api return entities.Select(e => e.TimelineId).ToList();
}
- public async Task<bool> IsBookmark(long userId, long timelineId, bool checkUserExistence = true, bool checkTimelineExistence = true)
+ public async Task<bool> IsBookmarkAsync(long userId, long timelineId, bool checkUserExistence = true, bool checkTimelineExistence = true)
{
if (checkUserExistence && !await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
@@ -134,7 +65,7 @@ namespace Timeline.Services.Api return await _database.BookmarkTimelines.AnyAsync(b => b.TimelineId == timelineId && b.UserId == userId);
}
- public async Task MoveBookmark(long userId, long timelineId, long newPosition)
+ public async Task MoveBookmarkAsync(long userId, long timelineId, long newPosition)
{
if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
@@ -176,7 +107,7 @@ namespace Timeline.Services.Api await transaction.CommitAsync();
}
- public async Task<bool> RemoveBookmark(long userId, long timelineId)
+ public async Task<bool> RemoveBookmarkAsync(long userId, long timelineId)
{
if (!await _userService.CheckUserExistenceAsync(userId))
throw new UserNotExistException(userId);
diff --git a/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs b/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs index 8224f1fe..a9d831ab 100644 --- a/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs +++ b/BackEnd/Timeline/Services/Api/HighlightTimelineService.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore;
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -9,72 +8,6 @@ using Timeline.Services.User; namespace Timeline.Services.Api
{
-
- [Serializable]
- public class InvalidHighlightTimelineException : Exception
- {
- public InvalidHighlightTimelineException() { }
- public InvalidHighlightTimelineException(string message) : base(message) { }
- public InvalidHighlightTimelineException(string message, Exception inner) : base(message, inner) { }
- protected InvalidHighlightTimelineException(
- System.Runtime.Serialization.SerializationInfo info,
- System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
- }
-
- /// <summary>
- /// Service that controls highlight timeline.
- /// </summary>
- public interface IHighlightTimelineService
- {
- /// <summary>
- /// Get all highlight timelines in order.
- /// </summary>
- /// <returns>Id list of all highlight timelines.</returns>
- Task<List<long>> GetHighlightTimelines();
-
- /// <summary>
- /// Check if a timeline is highlight timeline.
- /// </summary>
- /// <param name="timelineId">Timeline id.</param>
- /// <param name="checkTimelineExistence">If true it will throw if timeline does not exist.</param>
- /// <returns>True if timeline is highlight. Otherwise false.</returns>
- /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist and <paramref name="checkTimelineExistence"/> is true.</exception>
- Task<bool> IsHighlightTimeline(long timelineId, bool checkTimelineExistence = true);
-
- /// <summary>
- /// Add a timeline to highlight list.
- /// </summary>
- /// <param name="timelineId">The timeline id.</param>
- /// <param name="operatorId">The user id of operator.</param>
- /// <returns>True if timeline is actually added to highligh. False if it already is.</returns>
- /// <exception cref="TimelineNotExistException">Thrown when timeline with given id does not exist.</exception>
- /// <exception cref="UserNotExistException">Thrown when user with given operator id does not exist.</exception>
- Task<bool> AddHighlightTimeline(long timelineId, long? operatorId);
-
- /// <summary>
- /// Remove a timeline from highlight list.
- /// </summary>
- /// <param name="timelineId">The timeline id.</param>
- /// <param name="operatorId">The user id of operator.</param>
- /// <returns>True if deletion is actually performed. Otherwise false (timeline was not in the list).</returns>
- /// <exception cref="TimelineNotExistException">Thrown when timeline with given id does not exist.</exception>
- /// <exception cref="UserNotExistException">Thrown when user with given operator id does not exist.</exception>
- Task<bool> RemoveHighlightTimeline(long timelineId, long? operatorId);
-
- /// <summary>
- /// Move a highlight timeline to a new position.
- /// </summary>
- /// <param name="timelineId">The timeline name.</param>
- /// <param name="newPosition">The new position. Starts at 1.</param>
- /// <exception cref="TimelineNotExistException">Thrown when timeline with given id does not exist.</exception>
- /// <exception cref="InvalidHighlightTimelineException">Thrown when given timeline is not a highlight timeline.</exception>
- /// <remarks>
- /// If <paramref name="newPosition"/> is smaller than 1. Then move the timeline to head.
- /// If <paramref name="newPosition"/> is bigger than total count. Then move the timeline to tail.
- /// </remarks>
- Task MoveHighlightTimeline(long timelineId, long newPosition);
- }
-
public class HighlightTimelineService : IHighlightTimelineService
{
private readonly DatabaseContext _database;
@@ -90,7 +23,7 @@ namespace Timeline.Services.Api _clock = clock;
}
- public async Task<bool> AddHighlightTimeline(long timelineId, long? operatorId)
+ public async Task<bool> AddHighlightTimelineAsync(long timelineId, long? operatorId)
{
if (!await _timelineService.CheckTimelineExistenceAsync(timelineId))
throw new TimelineNotExistException(timelineId);
@@ -109,14 +42,14 @@ namespace Timeline.Services.Api return true;
}
- public async Task<List<long>> GetHighlightTimelines()
+ public async Task<List<long>> GetHighlightTimelinesAsync()
{
var entities = await _database.HighlightTimelines.OrderBy(t => t.Order).Select(t => new { t.TimelineId }).ToListAsync();
return entities.Select(e => e.TimelineId).ToList();
}
- public async Task<bool> RemoveHighlightTimeline(long timelineId, long? operatorId)
+ public async Task<bool> RemoveHighlightTimelineAsync(long timelineId, long? operatorId)
{
if (!await _timelineService.CheckTimelineExistenceAsync(timelineId))
throw new TimelineNotExistException(timelineId);
@@ -144,7 +77,7 @@ namespace Timeline.Services.Api return true;
}
- public async Task MoveHighlightTimeline(long timelineId, long newPosition)
+ public async Task MoveHighlightTimelineAsync(long timelineId, long newPosition)
{
if (!await _timelineService.CheckTimelineExistenceAsync(timelineId))
throw new TimelineNotExistException(timelineId);
@@ -183,7 +116,7 @@ namespace Timeline.Services.Api await transaction.CommitAsync();
}
- public async Task<bool> IsHighlightTimeline(long timelineId, bool checkTimelineExistence = true)
+ public async Task<bool> IsHighlightTimelineAsync(long timelineId, bool checkTimelineExistence = true)
{
if (checkTimelineExistence && !await _timelineService.CheckTimelineExistenceAsync(timelineId))
throw new TimelineNotExistException(timelineId);
diff --git a/BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs b/BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs new file mode 100644 index 00000000..18feee54 --- /dev/null +++ b/BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic;
+using System.Threading.Tasks;
+using Timeline.Services.Timeline;
+using Timeline.Services.User;
+
+namespace Timeline.Services.Api
+{
+ /// <summary>
+ /// Service interface that manages timeline bookmarks.
+ /// </summary>
+ public interface IBookmarkTimelineService
+ {
+ /// <summary>
+ /// Get bookmarks of a user.
+ /// </summary>
+ /// <param name="userId">User id of bookmark owner.</param>
+ /// <returns>Id of Bookmark timelines in order.</returns>
+ /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
+ Task<List<long>> GetBookmarksAsync(long userId);
+
+ /// <summary>
+ /// Check if a timeline is a bookmark.
+ /// </summary>
+ /// <param name="userId">The user id.</param>
+ /// <param name="timelineId">Timeline id.</param>
+ /// <param name="checkUserExistence">If true it will throw when user does not exist.</param>
+ /// <param name="checkTimelineExistence">If true it will throw when timeline does not exist.</param>
+ /// <returns>True if timeline is a bookmark. Otherwise false.</returns>
+ /// <exception cref="UserNotExistException">Throw if user does not exist and <paramref name="checkUserExistence"/> is true.</exception>
+ /// <exception cref="TimelineNotExistException">Thrown if timeline does not exist and <paramref name="checkTimelineExistence"/> is true.</exception>
+ Task<bool> IsBookmarkAsync(long userId, long timelineId, bool checkUserExistence = true, bool checkTimelineExistence = true);
+
+ /// <summary>
+ /// Add a bookmark to tail to a user.
+ /// </summary>
+ /// <param name="userId">User id of bookmark owner.</param>
+ /// <param name="timelineId">Timeline id.</param>
+ /// <returns>True if timeline is added to bookmark. False if it already is.</returns>
+ /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist.</exception>
+ Task<bool> AddBookmarkAsync(long userId, long timelineId);
+
+ /// <summary>
+ /// Remove a bookmark from a user.
+ /// </summary>
+ /// <param name="userId">User id of bookmark owner.</param>
+ /// <param name="timelineId">Timeline id.</param>
+ /// <returns>True if deletion is performed. False if bookmark does not exist.</returns>
+ /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist.</exception>
+ Task<bool> RemoveBookmarkAsync(long userId, long timelineId);
+
+ /// <summary>
+ /// Move bookmark to a new position.
+ /// </summary>
+ /// <param name="userId">User id of bookmark owner.</param>
+ /// <param name="timelineId">Timeline name.</param>
+ /// <param name="newPosition">New position. Starts at 1.</param>
+ /// <exception cref="UserNotExistException">Thrown when user does not exist.</exception>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist.</exception>
+ /// <exception cref="InvalidBookmarkException">Thrown when the timeline is not a bookmark.</exception>
+ Task MoveBookmarkAsync(long userId, long timelineId, long newPosition);
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs b/BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs new file mode 100644 index 00000000..4f14d19b --- /dev/null +++ b/BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic;
+using System.Threading.Tasks;
+using Timeline.Services.Timeline;
+using Timeline.Services.User;
+
+namespace Timeline.Services.Api
+{
+ /// <summary>
+ /// Service that controls highlight timeline.
+ /// </summary>
+ public interface IHighlightTimelineService
+ {
+ /// <summary>
+ /// Get all highlight timelines in order.
+ /// </summary>
+ /// <returns>Id list of all highlight timelines.</returns>
+ Task<List<long>> GetHighlightTimelinesAsync();
+
+ /// <summary>
+ /// Check if a timeline is highlight timeline.
+ /// </summary>
+ /// <param name="timelineId">Timeline id.</param>
+ /// <param name="checkTimelineExistence">If true it will throw if timeline does not exist.</param>
+ /// <returns>True if timeline is highlight. Otherwise false.</returns>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline does not exist and <paramref name="checkTimelineExistence"/> is true.</exception>
+ Task<bool> IsHighlightTimelineAsync(long timelineId, bool checkTimelineExistence = true);
+
+ /// <summary>
+ /// Add a timeline to highlight list.
+ /// </summary>
+ /// <param name="timelineId">The timeline id.</param>
+ /// <param name="operatorId">The user id of operator.</param>
+ /// <returns>True if timeline is actually added to highligh. False if it already is.</returns>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline with given id does not exist.</exception>
+ /// <exception cref="UserNotExistException">Thrown when user with given operator id does not exist.</exception>
+ Task<bool> AddHighlightTimelineAsync(long timelineId, long? operatorId);
+
+ /// <summary>
+ /// Remove a timeline from highlight list.
+ /// </summary>
+ /// <param name="timelineId">The timeline id.</param>
+ /// <param name="operatorId">The user id of operator.</param>
+ /// <returns>True if deletion is actually performed. Otherwise false (timeline was not in the list).</returns>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline with given id does not exist.</exception>
+ /// <exception cref="UserNotExistException">Thrown when user with given operator id does not exist.</exception>
+ Task<bool> RemoveHighlightTimelineAsync(long timelineId, long? operatorId);
+
+ /// <summary>
+ /// Move a highlight timeline to a new position.
+ /// </summary>
+ /// <param name="timelineId">The timeline name.</param>
+ /// <param name="newPosition">The new position. Starts at 1.</param>
+ /// <exception cref="TimelineNotExistException">Thrown when timeline with given id does not exist.</exception>
+ /// <exception cref="InvalidHighlightTimelineException">Thrown when given timeline is not a highlight timeline.</exception>
+ /// <remarks>
+ /// If <paramref name="newPosition"/> is smaller than 1. Then move the timeline to head.
+ /// If <paramref name="newPosition"/> is bigger than total count. Then move the timeline to tail.
+ /// </remarks>
+ Task MoveHighlightTimelineAsync(long timelineId, long newPosition);
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/ISearchService.cs b/BackEnd/Timeline/Services/Api/ISearchService.cs new file mode 100644 index 00000000..d8b4bb44 --- /dev/null +++ b/BackEnd/Timeline/Services/Api/ISearchService.cs @@ -0,0 +1,33 @@ +using System;
+using System.Threading.Tasks;
+using Timeline.Entities;
+
+namespace Timeline.Services.Api
+{
+ public interface ISearchService
+ {
+ /// <summary>
+ /// Search timelines whose name or title contains query string.
+ /// </summary>
+ /// <param name="query">String to contain.</param>
+ /// <returns>Search results.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="query"/> is null.</exception>
+ /// <exception cref="ArgumentException">Thrown when <paramref name="query"/> is empty.</exception>
+ /// <remarks>
+ /// Implementation should promise high score is at first.
+ /// </remarks>
+ Task<SearchResult<TimelineEntity>> SearchTimelineAsync(string query);
+
+ /// <summary>
+ /// Search users whose username or nickname contains query string.
+ /// </summary>
+ /// <param name="query">String to contain.</param>
+ /// <returns>Search results.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="query"/> is null.</exception>
+ /// <exception cref="ArgumentException">Thrown when <paramref name="query"/> is empty.</exception>
+ /// <remarks>
+ /// Implementation should promise high score is at first.
+ /// </remarks>
+ Task<SearchResult<UserEntity>> SearchUserAsync(string query);
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/InvalidBookmarkException.cs b/BackEnd/Timeline/Services/Api/InvalidBookmarkException.cs new file mode 100644 index 00000000..39572b38 --- /dev/null +++ b/BackEnd/Timeline/Services/Api/InvalidBookmarkException.cs @@ -0,0 +1,15 @@ +using System;
+
+namespace Timeline.Services.Api
+{
+ [Serializable]
+ public class InvalidBookmarkException : Exception
+ {
+ public InvalidBookmarkException() { }
+ public InvalidBookmarkException(string message) : base(message) { }
+ public InvalidBookmarkException(string message, Exception inner) : base(message, inner) { }
+ protected InvalidBookmarkException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/InvalidHighlightTimelineException.cs b/BackEnd/Timeline/Services/Api/InvalidHighlightTimelineException.cs new file mode 100644 index 00000000..13b04a6b --- /dev/null +++ b/BackEnd/Timeline/Services/Api/InvalidHighlightTimelineException.cs @@ -0,0 +1,15 @@ +using System;
+
+namespace Timeline.Services.Api
+{
+ [Serializable]
+ public class InvalidHighlightTimelineException : Exception
+ {
+ public InvalidHighlightTimelineException() { }
+ public InvalidHighlightTimelineException(string message) : base(message) { }
+ public InvalidHighlightTimelineException(string message, Exception inner) : base(message, inner) { }
+ protected InvalidHighlightTimelineException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/SearchResult.cs b/BackEnd/Timeline/Services/Api/SearchResult.cs new file mode 100644 index 00000000..7c95ae5d --- /dev/null +++ b/BackEnd/Timeline/Services/Api/SearchResult.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic;
+
+namespace Timeline.Services.Api
+{
+ public class SearchResult<TItem>
+ {
+#pragma warning disable CA2227 // Collection properties should be read only
+ public List<SearchResultItem<TItem>> Items { get; set; } = new();
+#pragma warning restore CA2227 // Collection properties should be read only
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/SearchResultItem.cs b/BackEnd/Timeline/Services/Api/SearchResultItem.cs new file mode 100644 index 00000000..ac40281f --- /dev/null +++ b/BackEnd/Timeline/Services/Api/SearchResultItem.cs @@ -0,0 +1,18 @@ +namespace Timeline.Services.Api
+{
+ public class SearchResultItem<TItem>
+ {
+ public SearchResultItem(TItem item, int score)
+ {
+ Item = item;
+ Score = score;
+ }
+
+ public TItem Item { get; set; } = default!;
+
+ /// <summary>
+ /// Bigger is better.
+ /// </summary>
+ public int Score { get; set; }
+ }
+}
diff --git a/BackEnd/Timeline/Services/Api/SearchService.cs b/BackEnd/Timeline/Services/Api/SearchService.cs index eec5001f..037f0490 100644 --- a/BackEnd/Timeline/Services/Api/SearchService.cs +++ b/BackEnd/Timeline/Services/Api/SearchService.cs @@ -1,62 +1,11 @@ using Microsoft.EntityFrameworkCore;
using System;
-using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Timeline.Entities;
namespace Timeline.Services.Api
{
- public class SearchResultItem<TItem>
- {
- public SearchResultItem(TItem item, int score)
- {
- Item = item;
- Score = score;
- }
-
- public TItem Item { get; set; } = default!;
-
- /// <summary>
- /// Bigger is better.
- /// </summary>
- public int Score { get; set; }
- }
-
- public class SearchResult<TItem>
- {
-#pragma warning disable CA2227 // Collection properties should be read only
- public List<SearchResultItem<TItem>> Items { get; set; } = new();
-#pragma warning restore CA2227 // Collection properties should be read only
- }
-
- public interface ISearchService
- {
- /// <summary>
- /// Search timelines whose name or title contains query string.
- /// </summary>
- /// <param name="query">String to contain.</param>
- /// <returns>Search results.</returns>
- /// <exception cref="ArgumentNullException">Thrown when <paramref name="query"/> is null.</exception>
- /// <exception cref="ArgumentException">Thrown when <paramref name="query"/> is empty.</exception>
- /// <remarks>
- /// Implementation should promise high score is at first.
- /// </remarks>
- Task<SearchResult<TimelineEntity>> SearchTimeline(string query);
-
- /// <summary>
- /// Search users whose username or nickname contains query string.
- /// </summary>
- /// <param name="query">String to contain.</param>
- /// <returns>Search results.</returns>
- /// <exception cref="ArgumentNullException">Thrown when <paramref name="query"/> is null.</exception>
- /// <exception cref="ArgumentException">Thrown when <paramref name="query"/> is empty.</exception>
- /// <remarks>
- /// Implementation should promise high score is at first.
- /// </remarks>
- Task<SearchResult<UserEntity>> SearchUser(string query);
- }
-
public class SearchService : ISearchService
{
private readonly DatabaseContext _database;
@@ -66,7 +15,7 @@ namespace Timeline.Services.Api _database = database;
}
- public async Task<SearchResult<TimelineEntity>> SearchTimeline(string query)
+ public async Task<SearchResult<TimelineEntity>> SearchTimelineAsync(string query)
{
if (query is null)
throw new ArgumentNullException(nameof(query));
@@ -83,7 +32,7 @@ namespace Timeline.Services.Api return searchResult;
}
- public async Task<SearchResult<UserEntity>> SearchUser(string query)
+ public async Task<SearchResult<UserEntity>> SearchUserAsync(string query)
{
if (query is null)
throw new ArgumentNullException(nameof(query));
diff --git a/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs b/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs index 5ee90a8f..d3159423 100644 --- a/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs +++ b/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs @@ -85,8 +85,8 @@ namespace Timeline.Services.Mapper color: entity.Color,
createTime: entity.CreateTime,
lastModified: entity.LastModified,
- isHighlight: await _highlightTimelineService.IsHighlightTimeline(entity.Id),
- isBookmark: userId is not null && await _bookmarkTimelineService.IsBookmark(userId.Value, entity.Id, false, false),
+ isHighlight: await _highlightTimelineService.IsHighlightTimelineAsync(entity.Id),
+ isBookmark: userId is not null && await _bookmarkTimelineService.IsBookmarkAsync(userId.Value, entity.Id, false, false),
manageable: manageable,
postable: postable,
links: new HttpTimelineLinks(
diff --git a/BackEnd/Timeline/Timeline.csproj b/BackEnd/Timeline/Timeline.csproj index f77631c2..ace1aab5 100644 --- a/BackEnd/Timeline/Timeline.csproj +++ b/BackEnd/Timeline/Timeline.csproj @@ -15,7 +15,7 @@ <GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
- <NoWarn>1701;1702;1591</NoWarn>
+ <NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
@@ -58,31 +58,6 @@ <AutoGen>True</AutoGen>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
- <Compile Update="Resources\Controllers\ControllerAuthExtensions.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>ControllerAuthExtensions.resx</DependentUpon>
- </Compile>
- <Compile Update="Resources\Controllers\TimelineController.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>TimelineController.resx</DependentUpon>
- </Compile>
- <Compile Update="Resources\Controllers\TokenController.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>TokenController.resx</DependentUpon>
- </Compile>
- <Compile Update="Resources\Controllers\UserAvatarController.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>UserAvatarController.resx</DependentUpon>
- </Compile>
- <Compile Update="Resources\Controllers\UserController.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>UserController.resx</DependentUpon>
- </Compile>
<Compile Update="Resources\Entities.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
@@ -184,27 +159,6 @@ <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
- <EmbeddedResource Update="Resources\Controllers\ControllerAuthExtensions.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>ControllerAuthExtensions.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <EmbeddedResource Update="Resources\Controllers\TimelineController.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>TimelineController.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <EmbeddedResource Update="Resources\Controllers\TokenController.resx">
- <SubType>Designer</SubType>
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>TokenController.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <EmbeddedResource Update="Resources\Controllers\UserAvatarController.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>UserAvatarController.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <EmbeddedResource Update="Resources\Controllers\UserController.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>UserController.Designer.cs</LastGenOutput>
- </EmbeddedResource>
<EmbeddedResource Update="Resources\Entities.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Entities.Designer.cs</LastGenOutput>
|