283 lines
7.4 KiB
C#
Executable File
283 lines
7.4 KiB
C#
Executable File
namespace AssetManager.Models.DTOs;
|
|
|
|
/// <summary>
|
|
/// 创建投资组合请求
|
|
/// </summary>
|
|
public class CreatePortfolioRequest
|
|
{
|
|
public string? Name { get; set; }
|
|
public string? StrategyId { get; set; }
|
|
public string? Currency { get; set; }
|
|
public List<StockItem>? Stocks { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新投资组合请求
|
|
/// </summary>
|
|
public class UpdatePortfolioRequest
|
|
{
|
|
public string? Name { get; set; }
|
|
public string? StrategyId { get; set; }
|
|
public string? Status { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 股票项
|
|
/// </summary>
|
|
public class StockItem
|
|
{
|
|
public string? Name { get; set; }
|
|
public string? Code { get; set; }
|
|
public double Price { get; set; }
|
|
public int Amount { get; set; }
|
|
public string? Date { get; set; }
|
|
public string? Currency { get; set; }
|
|
public string AssetType { get; set; } = "Stock";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建投资组合响应
|
|
/// </summary>
|
|
public class CreatePortfolioResponse
|
|
{
|
|
public string? Id { get; set; }
|
|
public double TotalValue { get; set; }
|
|
public double ReturnRate { get; set; }
|
|
public string? Currency { get; set; }
|
|
public string? CreatedAt { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 投资组合详情响应
|
|
/// </summary>
|
|
public class PortfolioDetailResponse
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Currency { get; set; }
|
|
public string? Status { get; set; }
|
|
public StrategyInfo? Strategy { get; set; }
|
|
public double PortfolioValue { get; set; }
|
|
public double TotalReturn { get; set; }
|
|
public double TodayProfit { get; set; }
|
|
public double HistoricalChange { get; set; }
|
|
public double DailyVolatility { get; set; }
|
|
public string? TodayProfitCurrency { get; set; }
|
|
public string? LogicModel { get; set; }
|
|
public string? LogicModelStatus { get; set; }
|
|
public string? LogicModelDescription { get; set; }
|
|
public int TotalItems { get; set; }
|
|
public double TotalRatio { get; set; }
|
|
public List<PositionItem>? Positions { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 策略信息
|
|
/// </summary>
|
|
public class StrategyInfo
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Description { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 持仓项
|
|
/// </summary>
|
|
public class PositionItem
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? StockCode { get; set; }
|
|
public string? StockName { get; set; }
|
|
public string? Symbol { get; set; }
|
|
public int Amount { get; set; }
|
|
public double AveragePrice { get; set; }
|
|
public double CurrentPrice { get; set; }
|
|
public double TotalValue { get; set; }
|
|
public double Profit { get; set; }
|
|
public double ProfitRate { get; set; }
|
|
public double ChangeAmount { get; set; }
|
|
public double Ratio { get; set; }
|
|
public double DeviationRatio { get; set; }
|
|
public string? Currency { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 交易项
|
|
/// </summary>
|
|
public class TransactionItem
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? PortfolioId { get; set; }
|
|
public string? Date { get; set; }
|
|
public string? Time { get; set; }
|
|
public string? Type { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? StockCode { get; set; }
|
|
public double Amount { get; set; }
|
|
public string? Currency { get; set; }
|
|
public string? Status { get; set; }
|
|
public string? Remark { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取交易列表请求
|
|
/// </summary>
|
|
public class GetTransactionsRequest
|
|
{
|
|
public string? PortfolioId { get; set; }
|
|
public int Limit { get; set; }
|
|
public int Offset { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取交易列表响应
|
|
/// </summary>
|
|
public class GetTransactionsResponse
|
|
{
|
|
public List<TransactionItem>? Items { get; set; }
|
|
public int Total { get; set; }
|
|
public int Page { get; set; }
|
|
public int PageSize { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建交易请求
|
|
/// </summary>
|
|
public class CreateTransactionRequest
|
|
{
|
|
public string? PortfolioId { get; set; }
|
|
public string? Type { get; set; }
|
|
public string? StockCode { get; set; }
|
|
public int Amount { get; set; }
|
|
public double Price { get; set; }
|
|
public string? Currency { get; set; }
|
|
public string? Remark { get; set; }
|
|
public string AssetType { get; set; } = "Stock";
|
|
public string? TransactionTime { get; set; }
|
|
public string? TransactionDate { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建交易响应
|
|
/// </summary>
|
|
public class CreateTransactionResponse
|
|
{
|
|
public string? Id { get; set; }
|
|
public double TotalAmount { get; set; }
|
|
public string? Status { get; set; }
|
|
public string? CreatedAt { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 投资组合列表项
|
|
/// </summary>
|
|
public class PortfolioListItem
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Tags { get; set; }
|
|
public string? Status { get; set; }
|
|
public string? StatusType { get; set; }
|
|
public string? IconChar { get; set; }
|
|
public string? IconBgClass { get; set; }
|
|
public string? IconTextClass { get; set; }
|
|
public double Value { get; set; }
|
|
public string? Currency { get; set; }
|
|
public double ReturnRate { get; set; }
|
|
public string? ReturnType { get; set; }
|
|
public double TodayProfit { get; set; }
|
|
public string? TodayProfitCurrency { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取投资组合列表响应
|
|
/// </summary>
|
|
public class GetPortfoliosResponse
|
|
{
|
|
public List<PortfolioListItem>? Items { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 总资产响应
|
|
/// </summary>
|
|
public class TotalAssetsResponse
|
|
{
|
|
public double TotalValue { get; set; }
|
|
public string? Currency { get; set; }
|
|
public double TodayProfit { get; set; }
|
|
public string? TodayProfitCurrency { get; set; }
|
|
public double TotalReturnRate { get; set; }
|
|
}
|
|
|
|
// ===== 净值历史相关 DTO =====
|
|
|
|
/// <summary>
|
|
/// 净值历史请求
|
|
/// </summary>
|
|
public class NavHistoryRequest
|
|
{
|
|
public DateTime? StartDate { get; set; }
|
|
public DateTime? EndDate { get; set; }
|
|
public string? Interval { get; set; } = "daily";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 净值历史响应
|
|
/// </summary>
|
|
public class NavHistoryResponse
|
|
{
|
|
public string? PortfolioId { get; set; }
|
|
public string? Currency { get; set; }
|
|
public List<NavHistoryItem>? NavHistory { get; set; }
|
|
public NavStatistics? Statistics { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 净值历史项
|
|
/// </summary>
|
|
public class NavHistoryItem
|
|
{
|
|
public string? Date { get; set; }
|
|
public double Nav { get; set; }
|
|
public double TotalValue { get; set; }
|
|
public double TotalCost { get; set; }
|
|
public double DailyReturn { get; set; }
|
|
public double CumulativeReturn { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 净值统计
|
|
/// </summary>
|
|
public class NavStatistics
|
|
{
|
|
public double MaxReturn { get; set; }
|
|
public double MinReturn { get; set; }
|
|
public double MaxDrawdown { get; set; }
|
|
public double SharpeRatio { get; set; }
|
|
public double Volatility { get; set; }
|
|
public double TotalReturn { get; set; }
|
|
public int TradingDays { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 回填净值请求
|
|
/// </summary>
|
|
public class BackfillNavRequest
|
|
{
|
|
public string? PortfolioId { get; set; }
|
|
public bool Force { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 回填净值响应
|
|
/// </summary>
|
|
public class BackfillNavResponse
|
|
{
|
|
public string? PortfolioId { get; set; }
|
|
public int RecordsCreated { get; set; }
|
|
public DateTime? StartDate { get; set; }
|
|
public DateTime? EndDate { get; set; }
|
|
public string? Message { get; set; }
|
|
}
|