P0 - 安全修复: - 移除硬编码 API Key,启动时校验必填环境变量 P1 - 高优先级: - Entity 拆分:Position.cs, Transaction.cs 独立文件 - Controller Facade 封装:IPortfolioFacade 减少依赖注入 P2 - 中优先级: - Repository 抽象:IPortfolioRepository, IMarketDataRepository - MarketDataService 拆分:组合模式整合 Tencent/Tiingo/OKX P3 - 低优先级: - DTO 命名规范:统一 PascalCase - 单元测试框架:xUnit + Moq + FluentAssertions
133 lines
3.3 KiB
C#
Executable File
133 lines
3.3 KiB
C#
Executable File
namespace AssetManager.Models.DTOs;
|
|
|
|
/// <summary>
|
|
/// 策略列表响应
|
|
/// </summary>
|
|
public class StrategyListResponse
|
|
{
|
|
public List<StrategyItem>? Items { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 策略项
|
|
/// </summary>
|
|
public class StrategyItem
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? IconChar { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? Tag { get; set; }
|
|
public string? Desc { get; set; }
|
|
public string? BgClass { get; set; }
|
|
public string? TagClass { get; set; }
|
|
public string? BtnText { get; set; }
|
|
public string? BtnClass { get; set; }
|
|
public string[]? Tags { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 策略详情
|
|
/// </summary>
|
|
public class StrategyDetail
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? IconChar { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? Tag { get; set; }
|
|
public string? Desc { get; set; }
|
|
public string? BgClass { get; set; }
|
|
public string? TagClass { get; set; }
|
|
public string[]? Tags { get; set; }
|
|
public string? BtnText { get; set; }
|
|
public string? BtnClass { get; set; }
|
|
public object? Parameters { get; set; }
|
|
public object? Backtest { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 策略详情响应
|
|
/// </summary>
|
|
public class StrategyDetailResponse
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? IconChar { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? RiskLevel { get; set; }
|
|
public string? Description { get; set; }
|
|
public List<string>? Tags { get; set; }
|
|
public List<ParameterItem>? Parameters { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 参数项
|
|
/// </summary>
|
|
public class ParameterItem
|
|
{
|
|
public string? Name { get; set; }
|
|
public string? DisplayName { get; set; }
|
|
public string? Type { get; set; }
|
|
public string? Value { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建策略请求
|
|
/// </summary>
|
|
public class CreateStrategyRequest
|
|
{
|
|
public string? Name { get; set; }
|
|
public string? Type { get; set; }
|
|
public string? Description { get; set; }
|
|
public string? RiskLevel { get; set; }
|
|
public List<string>? Tags { get; set; }
|
|
public object? Parameters { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 策略响应
|
|
/// </summary>
|
|
public class StrategyResponse
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? Status { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新策略请求
|
|
/// </summary>
|
|
public class UpdateStrategyRequest
|
|
{
|
|
public string? Name { get; set; }
|
|
public string? Type { get; set; }
|
|
public string? Description { get; set; }
|
|
public string? RiskLevel { get; set; }
|
|
public List<string>? Tags { get; set; }
|
|
public object? Parameters { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除策略响应
|
|
/// </summary>
|
|
public class DeleteStrategyResponse
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? Status { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 策略列表项 DTO
|
|
/// </summary>
|
|
public class StrategyListItemDto
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? UserId { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Type { get; set; }
|
|
public string? Description { get; set; }
|
|
public List<string>? Tags { get; set; }
|
|
public string? RiskLevel { get; set; }
|
|
public string? Config { get; set; }
|
|
public DateTime CreatedAt { get; set; }
|
|
public DateTime UpdatedAt { get; set; }
|
|
}
|