diff options
author | crupest <crupest@outlook.com> | 2022-03-25 20:20:47 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-03-25 20:20:47 +0800 |
commit | 34305283aca89b8b2ebacd26ad3faf859a6a78b0 (patch) | |
tree | 7eb0d518111a4714056fe50b538bc0dd6311b4e3 /BackEnd/Timeline/Services/User/IUserService.cs | |
parent | 65b2e7f6984b8776e603bd8ae847c9e2a9bd5ad6 (diff) | |
download | timeline-34305283aca89b8b2ebacd26ad3faf859a6a78b0.tar.gz timeline-34305283aca89b8b2ebacd26ad3faf859a6a78b0.tar.bz2 timeline-34305283aca89b8b2ebacd26ad3faf859a6a78b0.zip |
…
Diffstat (limited to 'BackEnd/Timeline/Services/User/IUserService.cs')
-rw-r--r-- | BackEnd/Timeline/Services/User/IUserService.cs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/BackEnd/Timeline/Services/User/IUserService.cs b/BackEnd/Timeline/Services/User/IUserService.cs index 745bd524..6ea9a4d2 100644 --- a/BackEnd/Timeline/Services/User/IUserService.cs +++ b/BackEnd/Timeline/Services/User/IUserService.cs @@ -5,8 +5,33 @@ using Timeline.Entities; namespace Timeline.Services.User
{
- public interface IUserService : IBasicUserService
- {
+ public interface IUserService
+ { + /// <summary>
+ /// Check if a user exists.
+ /// </summary>
+ /// <param name="id">The id of the user.</param>
+ /// <returns>True if exists. Otherwise false.</returns>
+ Task<bool> CheckUserExistenceAsync(long id);
+
+ /// <summary>
+ /// Get the user id of given username.
+ /// </summary>
+ /// <param name="username">Username of the user.</param>
+ /// <returns>The id of the user.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="username"/> is null.</exception>
+ /// <exception cref="ArgumentException">Thrown when <paramref name="username"/> is of bad format.</exception>
+ /// <exception cref="EntityNotExistException">Thrown when the user with given username does not exist.</exception>
+ Task<long> GetUserIdByUsernameAsync(string username);
+
+ /// <summary>
+ /// Get the username modified time of a user.
+ /// </summary>
+ /// <param name="userId">User id.</param>
+ /// <returns>The time.</returns>
+ /// <exception cref="EntityNotExistException">Thrown when user does not exist.</exception>
+ Task<DateTime> GetUsernameLastModifiedTimeAsync(long userId);
+
/// <summary>
/// Try to get a user by id.
/// </summary>
|