tiny server.
This commit is contained in:
45
App/Data/Model/FlowerItem.cs
Normal file
45
App/Data/Model/FlowerItem.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using SQLite;
|
||||
|
||||
namespace Blahblah.FlowerStory.Data.Model;
|
||||
|
||||
[Table("flowers")]
|
||||
public class FlowerItem
|
||||
{
|
||||
[Column("fid"), PrimaryKey, AutoIncrement]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("categoryid")]
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
private string categoryName;
|
||||
public string CategoryName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (categoryName == null)
|
||||
{
|
||||
if (!Constants.Categories.TryGetValue(CategoryId, out categoryName))
|
||||
{
|
||||
categoryName = Constants.CategoryOther;
|
||||
}
|
||||
// TODO: i18n
|
||||
}
|
||||
return categoryName;
|
||||
}
|
||||
}
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Column("datebuy")]
|
||||
public DateTimeOffset DateBuy { get; set; }
|
||||
|
||||
[Column("cost")]
|
||||
public decimal? Cost { get; set; }
|
||||
|
||||
[Column("purchase")]
|
||||
public string Purchase { get; set; }
|
||||
|
||||
[Column("photo")]
|
||||
public byte[] Photo { get; set; }
|
||||
}
|
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; }
|
||||
}
|
11
App/Data/Model/UserItem.cs
Normal file
11
App/Data/Model/UserItem.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Blahblah.FlowerStory.Data.Model;
|
||||
|
||||
public class UserItem
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public int Level { get; set; }
|
||||
public DateTimeOffset RegisterDate { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Mobile { get; set; }
|
||||
}
|
Reference in New Issue
Block a user