diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-19 16:12:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 16:12:16 +0800 |
commit | 134173eda92de04961dc69757b257c1c547d88a4 (patch) | |
tree | bd8c0d70aac7cd4d1a6c28ae7c9b7c681dbd5613 /Timeline/Entities/UserAvatar.cs | |
parent | 24fe6340ea69321ecafb57c8c5d6cd4b72f229b4 (diff) | |
parent | 79e578e97ed252bff0dca3c89d81a395b35289d7 (diff) | |
download | timeline-134173eda92de04961dc69757b257c1c547d88a4.tar.gz timeline-134173eda92de04961dc69757b257c1c547d88a4.tar.bz2 timeline-134173eda92de04961dc69757b257c1c547d88a4.zip |
Merge pull request #45 from crupest/avatar-cache
Add 304 response for If-Modified-Since in avatar.
Diffstat (limited to 'Timeline/Entities/UserAvatar.cs')
-rw-r--r-- | Timeline/Entities/UserAvatar.cs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Timeline/Entities/UserAvatar.cs b/Timeline/Entities/UserAvatar.cs index d7c24403..b941445d 100644 --- a/Timeline/Entities/UserAvatar.cs +++ b/Timeline/Entities/UserAvatar.cs @@ -1,4 +1,5 @@ -using System.ComponentModel.DataAnnotations;
+using System;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Timeline.Entities
@@ -9,10 +10,26 @@ namespace Timeline.Entities [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
- [Column("data"), Required]
+ [Column("data")]
public byte[] Data { get; set; }
- [Column("type"), Required]
+ [Column("type")]
public string Type { get; set; }
+
+ [Column("last_modified"), Required]
+ public DateTime LastModified { get; set; }
+
+ public long UserId { get; set; }
+
+ public static UserAvatar Create(DateTime lastModified)
+ {
+ return new UserAvatar
+ {
+ Id = 0,
+ Data = null,
+ Type = null,
+ LastModified = lastModified
+ };
+ }
}
}
|