diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-23 20:41:19 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-23 20:41:19 +0800 |
commit | 9a163719b76958374d1c27616393368e54e8b8a5 (patch) | |
tree | b005aa3d8bc34d8e710ce7fae30236c62dcbe712 /Timeline/Entities/User.cs | |
parent | 3ddb38839ac07de4edf071faeb753b62acb0bed1 (diff) | |
download | timeline-9a163719b76958374d1c27616393368e54e8b8a5.tar.gz timeline-9a163719b76958374d1c27616393368e54e8b8a5.tar.bz2 timeline-9a163719b76958374d1c27616393368e54e8b8a5.zip |
...
Diffstat (limited to 'Timeline/Entities/User.cs')
-rw-r--r-- | Timeline/Entities/User.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Timeline/Entities/User.cs b/Timeline/Entities/User.cs new file mode 100644 index 00000000..6e8e4967 --- /dev/null +++ b/Timeline/Entities/User.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ public static class UserRoles
+ {
+ public const string Admin = "admin";
+ public const string User = "user";
+ }
+
+ [Table("users")]
+ public class User
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("name"), MaxLength(26), Required]
+ public string Name { get; set; } = default!;
+
+ [Column("password"), Required]
+ public string EncryptedPassword { get; set; } = default!;
+
+ [Column("roles"), Required]
+ public string RoleString { get; set; } = default!;
+
+ [Column("version"), Required]
+ public long Version { get; set; }
+
+ public UserAvatar? Avatar { get; set; }
+ }
+}
|