tiny server.
This commit is contained in:
46
App/Data/Model/RecordItem.cs
Normal file
46
App/Data/Model/RecordItem.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using SQLite;
|
||||
|
||||
namespace Blahblah.FlowerStory.Data.Model;
|
||||
|
||||
[Table("records")]
|
||||
public class RecordItem
|
||||
{
|
||||
[Column("rid"), PrimaryKey, AutoIncrement]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("eid")]
|
||||
public int EventId { get; set; }
|
||||
|
||||
private string eventName;
|
||||
public string EventName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (eventName == null)
|
||||
{
|
||||
if (Constants.Events.TryGetValue(EventId, out var @event))
|
||||
{
|
||||
eventName = @event.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
eventName = Constants.EventUnknown;
|
||||
}
|
||||
// TODO: i18n
|
||||
}
|
||||
return eventName;
|
||||
}
|
||||
}
|
||||
|
||||
[Column("date")]
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
[Column("byuid")]
|
||||
public int? ByUserId { get; set; }
|
||||
|
||||
[Column("byname")]
|
||||
public string ByUserName { get; set; }
|
||||
|
||||
[Column("photo")]
|
||||
public byte[] Photo { get; set; }
|
||||
}
|
Reference in New Issue
Block a user