diff options
author | crupest <crupest@outlook.com> | 2020-01-30 20:26:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-30 20:26:52 +0800 |
commit | 52acf41e331ddbd66befed4692c804b754ba7d5c (patch) | |
tree | 538ceea06640f501d2a950cac813c10561036e4d /Timeline/Services/User.cs | |
parent | abde51b167f17301c25e32ae247e7909c0dc9367 (diff) | |
download | timeline-52acf41e331ddbd66befed4692c804b754ba7d5c.tar.gz timeline-52acf41e331ddbd66befed4692c804b754ba7d5c.tar.bz2 timeline-52acf41e331ddbd66befed4692c804b754ba7d5c.zip |
...
Diffstat (limited to 'Timeline/Services/User.cs')
-rw-r--r-- | Timeline/Services/User.cs | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/Timeline/Services/User.cs b/Timeline/Services/User.cs index f63a374e..09a472e5 100644 --- a/Timeline/Services/User.cs +++ b/Timeline/Services/User.cs @@ -1,14 +1,9 @@ -using Microsoft.AspNetCore.Mvc;
-using System;
-using Timeline.Controllers;
-
-namespace Timeline.Services
+namespace Timeline.Services
{
public class User
{
public string? Username { get; set; }
public string? Nickname { get; set; }
- public string? AvatarUrl { get; set; }
#region adminsecret
public bool? Administrator { get; set; }
@@ -20,30 +15,4 @@ namespace Timeline.Services public long? Version { get; set; }
#endregion secret
}
-
- public static class UserExtensions
- {
- public static User EraseSecretAndFinalFill(this User user, IUrlHelper urlHelper, bool adminstrator)
- {
- if (user == null)
- throw new ArgumentNullException(nameof(user));
-
- var result = new User
- {
- Username = user.Username,
- Nickname = user.Nickname,
- AvatarUrl = urlHelper.ActionLink(action: nameof(UserAvatarController.Get), controller: nameof(UserAvatarController), values: new
- {
- user.Username
- })
- };
-
- if (adminstrator)
- {
- result.Administrator = user.Administrator;
- }
-
- return result;
- }
- }
}
|