diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-25 23:03:36 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-25 23:03:36 +0800 |
commit | 181b53e270ff7c0558edec75b8b255d487e796c3 (patch) | |
tree | 5315d3339e3fcb43c22b0e39c761ab46d45f9b9c /Timeline/Entities | |
parent | a175f8328d7a6c36464676d54fc50d03e64be0af (diff) | |
download | timeline-181b53e270ff7c0558edec75b8b255d487e796c3.tar.gz timeline-181b53e270ff7c0558edec75b8b255d487e796c3.tar.bz2 timeline-181b53e270ff7c0558edec75b8b255d487e796c3.zip |
Add user detail service.
Diffstat (limited to 'Timeline/Entities')
-rw-r--r-- | Timeline/Entities/DatabaseContext.cs | 1 | ||||
-rw-r--r-- | Timeline/Entities/User.cs | 2 | ||||
-rw-r--r-- | Timeline/Entities/UserDetail.cs | 21 |
3 files changed, 24 insertions, 0 deletions
diff --git a/Timeline/Entities/DatabaseContext.cs b/Timeline/Entities/DatabaseContext.cs index e1b98e7d..6c005b30 100644 --- a/Timeline/Entities/DatabaseContext.cs +++ b/Timeline/Entities/DatabaseContext.cs @@ -19,5 +19,6 @@ namespace Timeline.Entities public DbSet<User> Users { get; set; } = default!;
public DbSet<UserAvatar> UserAvatars { get; set; } = default!;
+ public DbSet<UserDetail> UserDetails { get; set; } = default!;
}
}
diff --git a/Timeline/Entities/User.cs b/Timeline/Entities/User.cs index 6e8e4967..02352b03 100644 --- a/Timeline/Entities/User.cs +++ b/Timeline/Entities/User.cs @@ -28,5 +28,7 @@ namespace Timeline.Entities public long Version { get; set; }
public UserAvatar? Avatar { get; set; }
+
+ public UserDetail? Detail { get; set; }
}
}
diff --git a/Timeline/Entities/UserDetail.cs b/Timeline/Entities/UserDetail.cs new file mode 100644 index 00000000..45f87e2b --- /dev/null +++ b/Timeline/Entities/UserDetail.cs @@ -0,0 +1,21 @@ +using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Timeline.Entities
+{
+ [Table("user_details")]
+ public class UserDetail
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("nickname"), MaxLength(26)]
+ public string? Nickname { get; set; }
+
+ public long UserId { get; set; }
+ }
+}
|