diff options
author | crupest <crupest@outlook.com> | 2020-10-27 19:21:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-10-27 19:21:35 +0800 |
commit | 05ccb4d8f1bbe3fb64e117136b4a89bcfb0b0b33 (patch) | |
tree | 929e514de85eb82a5acb96ecffc6e6d2d95f878f /BackEnd/Timeline/Entities/UserEntity.cs | |
parent | 986c6f2e3b858d6332eba0b42acc6861cd4d0227 (diff) | |
download | timeline-05ccb4d8f1bbe3fb64e117136b4a89bcfb0b0b33.tar.gz timeline-05ccb4d8f1bbe3fb64e117136b4a89bcfb0b0b33.tar.bz2 timeline-05ccb4d8f1bbe3fb64e117136b4a89bcfb0b0b33.zip |
Split front and back end.
Diffstat (limited to 'BackEnd/Timeline/Entities/UserEntity.cs')
-rw-r--r-- | BackEnd/Timeline/Entities/UserEntity.cs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Entities/UserEntity.cs b/BackEnd/Timeline/Entities/UserEntity.cs new file mode 100644 index 00000000..0cfaa335 --- /dev/null +++ b/BackEnd/Timeline/Entities/UserEntity.cs @@ -0,0 +1,56 @@ +using System;
+using System.Collections.Generic;
+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";
+ }
+
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "This is an entity class.")]
+ [Table("users")]
+ public class UserEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("unique_id"), Required]
+ public string UniqueId { get; set; } = default!;
+
+ [Column("username"), Required]
+ public string Username { get; set; } = default!;
+
+ [Column("username_change_time")]
+ public DateTime UsernameChangeTime { get; set; }
+
+ [Column("password"), Required]
+ public string Password { get; set; } = default!;
+
+ [Column("roles"), Required]
+ public string Roles { get; set; } = default!;
+
+ [Column("version"), Required]
+ public long Version { get; set; }
+
+ [Column("nickname")]
+ public string? Nickname { get; set; }
+
+ [Column("create_time")]
+ public DateTime CreateTime { get; set; }
+
+ [Column("last_modified")]
+ public DateTime LastModified { get; set; }
+
+ public UserAvatarEntity? Avatar { get; set; }
+
+ public List<TimelineEntity> Timelines { get; set; } = default!;
+
+ public List<TimelinePostEntity> TimelinePosts { get; set; } = default!;
+
+ public List<TimelineMemberEntity> TimelinesJoined { get; set; } = default!;
+ }
+}
|