AssetManager.API/AssetManager.Models/DTOs/PortfolioDTO.cs
niannian zheng d39a6347cd feat: 实现微信登录和用户信息管理功能
- 添加微信登录功能,支持通过微信小程序登录
- 实现用户信息管理接口,包括获取用户信息和统计数据
- 新增投资组合列表和总资产统计接口
- 完善JWT令牌生成逻辑,支持可选用户名
- 添加数据库初始化配置和连接字符串
- 移除传统登录和注册功能,专注微信登录方案
2026-02-26 11:56:14 +08:00

142 lines
3.9 KiB
C#

namespace AssetManager.Models.DTOs;
public class CreatePortfolioRequest
{
public string name { get; set; }
public string strategyId { get; set; }
public string currency { get; set; }
public List<StockItem> stocks { get; set; }
}
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 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; }
}
public class PortfolioDetailResponse
{
public string id { get; set; }
public string name { get; set; }
public string currency { get; set; }
public StrategyInfo strategy { get; set; }
public double portfolioValue { get; set; }
public double totalReturn { get; set; }
public double todayProfit { get; set; }
public string todayProfitCurrency { get; set; }
public List<PositionItem> positions { get; set; }
public List<TransactionItem> transactions { get; set; }
}
public class StrategyInfo
{
public string id { get; set; }
public string name { get; set; }
public string description { get; set; }
}
public class PositionItem
{
public string id { get; set; }
public string stockCode { get; set; }
public string stockName { 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 string currency { get; set; }
}
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 double amount { get; set; }
public string currency { get; set; }
public string status { get; set; }
public string remark { get; set; }
}
public class GetTransactionsRequest
{
public string portfolioId { get; set; }
public int limit { get; set; }
public int offset { get; set; }
}
public class GetTransactionsResponse
{
public List<TransactionItem> items { get; set; }
public int total { get; set; }
public int page { get; set; }
public int pageSize { get; set; }
}
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 class CreateTransactionResponse
{
public string id { get; set; }
public double totalAmount { get; set; }
public string status { get; set; }
public string createdAt { get; set; }
}
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 class GetPortfoliosResponse
{
public List<PortfolioListItem> items { get; set; }
}
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; }
}