version up

This commit is contained in:
2023-07-31 17:11:39 +08:00
parent befbc7fc9b
commit 8419c9d389
41 changed files with 1053 additions and 286 deletions

View File

@ -1,4 +1,5 @@
using SQLite;
using System.Text.Json.Serialization;
namespace Blahblah.FlowerApp.Data.Model;
@ -12,19 +13,19 @@ public class FlowerItem
public int OwnerId { get; set; }
[Column("category"), NotNull]
public int Category { get; set; }
public int CategoryId { get; set; }
[Column("Name"), NotNull]
public string Name { get; set; } = null!;
[Column("datebuy"), NotNull]
[Column("datebuy"), JsonPropertyName("dateBuy"), NotNull]
public long DateBuyUnixTime { get; set; }
[Column("cost")]
public decimal? Cost { get; set; }
[Column("purchase")]
public string? PurchaseFrom { get; set; }
public string? Purchase { get; set; }
[Column("memo")]
public string? Memo { get; set; }

View File

@ -0,0 +1,34 @@
using SQLite;
namespace Blahblah.FlowerApp.Data.Model;
[Table("logs")]
public class LogItem
{
[Column("lid"), PrimaryKey, AutoIncrement]
public int Id { get; set; }
[Column("logtime"), NotNull]
public long LogUnixTime { get; set; }
[Column("uid"), NotNull]
public int OwnerId { get; set; }
[Column("logtype"), NotNull]
public string LogType { get; set; } = null!;
[Column("category"), NotNull]
public string Category { get; set; } = null!;
[Column("message"), NotNull]
public string Message { get; set; } = null!;
[Column("source")]
public string? Source { get; set; } = null!;
[Column("description")]
public string? Description { get; set; }
[Column("client")]
public string? ClientAgent { get; set; }
}

View File

@ -5,15 +5,12 @@ namespace Blahblah.FlowerApp.Data.Model;
[Table("params")]
public class ParamItem
{
[Column("pid"), PrimaryKey, AutoIncrement]
public int Id { get; set; }
[Column("uid")]
public int? OwnerId { get; set; }
[Column("code"), NotNull]
[Column("code"), PrimaryKey, NotNull]
public string Code { get; set; } = null!;
[Column("uid"), NotNull]
public int OwnerId { get; set; } = AppResources.EmptyUserId;
[Column("value"), NotNull]
public string Value { get; set; } = null!;

View File

@ -1,4 +1,5 @@
using SQLite;
using System.Text.Json.Serialization;
namespace Blahblah.FlowerApp.Data.Model;
@ -14,8 +15,8 @@ public class PhotoItem
[Column("fid"), NotNull]
public int FlowerId { get; set; }
[Column("rid"), NotNull]
public int RecordId { get; set; }
[Column("rid")]
public int? RecordId { get; set; }
[Column("filetype"), NotNull]
public string FileType { get; set; } = null!;
@ -26,7 +27,7 @@ public class PhotoItem
[Column("path"), NotNull]
public string Path { get; set; } = null!;
[Column("dateupload"), NotNull]
[Column("dateupload"), JsonPropertyName("dateUpload"), NotNull]
public long DateUploadUnixTime { get; set; }
[Column("url")]

View File

@ -1,7 +1,9 @@
using SQLite;
using System.Text.Json.Serialization;
namespace Blahblah.FlowerApp.Data.Model;
[Table("records")]
public class RecordItem
{
[Column("rid"), PrimaryKey, NotNull]
@ -14,9 +16,9 @@ public class RecordItem
public int FlowerId { get; set; }
[Column("event"), NotNull]
public int EventType { get; set; }
public int EventId { get; set; }
[Column("date"), NotNull]
[Column("date"), JsonPropertyName("date"), NotNull]
public long DateUnixTime { get; set; }
[Column("byuid")]
@ -33,4 +35,7 @@ public class RecordItem
[Column("longitude")]
public double? Longitude { get; set; }
[Ignore]
public PhotoItem[]? Photos { get; set; }
}

View File

@ -1,7 +1,9 @@
using SQLite;
using System.Text.Json.Serialization;
namespace Blahblah.FlowerApp.Data.Model;
[Table("users")]
public class UserItem
{
[Column("uid"), PrimaryKey, NotNull]
@ -19,14 +21,9 @@ public class UserItem
[Column("level"), NotNull]
public int Level { get; set; }
[Column("regdate"), NotNull]
[Column("regdate"), JsonPropertyName("registerDate"), NotNull]
public long RegisterDateUnixTime { get; set; }
//[Column("activedate")]
//public long? ActiveDateUnixTime { get; set; }
//public DateTimeOffset? ActiveDate => ActiveDateUnixTime == null ? null : DateTimeOffset.FromUnixTimeMilliseconds(ActiveDateUnixTime.Value);
[Column("email")]
public string? Email { get; set; }
@ -35,4 +32,9 @@ public class UserItem
[Column("avatar")]
public byte[]? Avatar { get; set; }
public override string ToString()
{
return $"{{ Id: {Id}, Token: \"{Token}\", UserId: \"{UserId}\", Name: \"{Name}\", Level: {Level}, RegisterDate: \"{DateTimeOffset.FromUnixTimeMilliseconds(RegisterDateUnixTime)}\" }}";
}
}