tiny server.

This commit is contained in:
2023-05-23 08:37:20 +08:00
parent 78a5d8d3fa
commit c8bf017a70
50 changed files with 1242 additions and 32 deletions

View 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; }
}