diff --git a/AssetManager.Data/DatabaseService.cs b/AssetManager.Data/DatabaseService.cs index 9a55f30..0c45506 100644 --- a/AssetManager.Data/DatabaseService.cs +++ b/AssetManager.Data/DatabaseService.cs @@ -18,7 +18,8 @@ public class DatabaseService typeof(Strategy), typeof(Portfolio), typeof(Position), - typeof(Transaction) + typeof(Transaction), + typeof(TiingoTicker) ); } diff --git a/AssetManager.Data/TiingoTicker.cs b/AssetManager.Data/TiingoTicker.cs new file mode 100644 index 0000000..255c349 --- /dev/null +++ b/AssetManager.Data/TiingoTicker.cs @@ -0,0 +1,62 @@ +using SqlSugar; + +namespace AssetManager.Data; + +/// +/// Tiingo 股票代码字典表 +/// +[SugarTable("tiingo_tickers")] +public class TiingoTicker +{ + /// + /// 主键 ID + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 标的代码(ticker) + /// + [SugarColumn(ColumnDataType = "varchar(50)")] + public string? Ticker { get; set; } + + /// + /// 交易所(exchange) + /// + [SugarColumn(ColumnDataType = "varchar(50)")] + public string? Exchange { get; set; } + + /// + /// 资产类型(assetType) + /// + [SugarColumn(ColumnDataType = "varchar(50)")] + public string? AssetType { get; set; } + + /// + /// 计价货币(priceCurrency) + /// + [SugarColumn(ColumnDataType = "varchar(10)")] + public string? PriceCurrency { get; set; } + + /// + /// 数据开始日期(startDate) + /// + [SugarColumn(IsNullable = true)] + public DateTime? StartDate { get; set; } + + /// + /// 数据结束日期(endDate) + /// + [SugarColumn(IsNullable = true)] + public DateTime? EndDate { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreatedAt { get; set; } = DateTime.Now; + + /// + /// 更新时间 + /// + public DateTime UpdatedAt { get; set; } = DateTime.Now; +}