feat: 新增ai-stock模块
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockHolding
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户股票持仓DTO
|
||||
/// </summary>
|
||||
public class StockHoldingDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票ID
|
||||
/// </summary>
|
||||
public Guid StockId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票代码
|
||||
/// </summary>
|
||||
public string StockCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票名称
|
||||
/// </summary>
|
||||
public string StockName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 持有数量
|
||||
/// </summary>
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 持仓成本
|
||||
/// </summary>
|
||||
public decimal CostPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前价格
|
||||
/// </summary>
|
||||
public decimal CurrentPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 持仓市值
|
||||
/// </summary>
|
||||
public decimal MarketValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 盈亏金额
|
||||
/// </summary>
|
||||
public decimal ProfitLoss { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 盈亏百分比
|
||||
/// </summary>
|
||||
public decimal ProfitLossPercentage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockHolding
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取用户持仓列表的输入DTO
|
||||
/// </summary>
|
||||
public class StockHoldingGetListInputDto : PagedAndSortedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 股票代码
|
||||
/// </summary>
|
||||
public string? StockCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票名称
|
||||
/// </summary>
|
||||
public string? StockName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockMarket
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市信息DTO
|
||||
/// </summary>
|
||||
public class StockMarketDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市代码
|
||||
/// </summary>
|
||||
public string MarketCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股市名称
|
||||
/// </summary>
|
||||
public string MarketName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股市描述
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public bool State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockMarket
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取股市列表的输入DTO
|
||||
/// </summary>
|
||||
public class StockMarketGetListInputDto : PagedAndSortedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市代码
|
||||
/// </summary>
|
||||
public string? MarketCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股市名称
|
||||
/// </summary>
|
||||
public string? MarketName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public bool? State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockNews
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市新闻DTO
|
||||
/// </summary>
|
||||
public class StockNewsDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 新闻标题
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新闻内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
public DateTime PublishTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新闻来源
|
||||
/// </summary>
|
||||
public string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockNews
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取股市新闻列表的输入DTO
|
||||
/// </summary>
|
||||
public class StockNewsGetListInputDto : PagedAndSortedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 新闻标题关键词
|
||||
/// </summary>
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新闻来源
|
||||
/// </summary>
|
||||
public string? Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否只显示最近10天的新闻
|
||||
/// </summary>
|
||||
/// <remarks>默认为true,查询最近10天的新闻</remarks>
|
||||
public bool IsRecent { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Yi.Framework.Stock.Domain.Shared;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockPrice
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市价格记录DTO
|
||||
/// </summary>
|
||||
public class StockPriceRecordDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 股票ID
|
||||
/// </summary>
|
||||
public Guid StockId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录时间
|
||||
/// </summary>
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前价
|
||||
/// </summary>
|
||||
public decimal CurrentPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易量
|
||||
/// </summary>
|
||||
public long Volume { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易额
|
||||
/// </summary>
|
||||
public decimal Turnover { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间周期类型
|
||||
/// </summary>
|
||||
public PeriodTypeEnum PeriodType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Yi.Framework.Stock.Domain.Shared;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockPrice
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取股市价格记录的输入DTO
|
||||
/// </summary>
|
||||
public class StockPriceRecordGetListInputDto : PagedAndSortedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 股票ID
|
||||
/// </summary>
|
||||
public Guid? StockId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间周期类型
|
||||
/// </summary>
|
||||
public PeriodTypeEnum? PeriodType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Yi.Framework.Stock.Domain.Shared;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockTransaction
|
||||
{
|
||||
/// <summary>
|
||||
/// 股票交易记录DTO
|
||||
/// </summary>
|
||||
public class StockTransactionDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票ID
|
||||
/// </summary>
|
||||
public Guid StockId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票代码
|
||||
/// </summary>
|
||||
public string StockCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票名称
|
||||
/// </summary>
|
||||
public string StockName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易类型
|
||||
/// </summary>
|
||||
public TransactionTypeEnum TransactionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易价格
|
||||
/// </summary>
|
||||
public decimal Price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易数量
|
||||
/// </summary>
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易总额
|
||||
/// </summary>
|
||||
public decimal TotalAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易费用
|
||||
/// </summary>
|
||||
public decimal Fee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易时间
|
||||
/// </summary>
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Yi.Framework.Stock.Domain.Shared;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.Dtos.StockTransaction
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取交易记录的输入DTO
|
||||
/// </summary>
|
||||
public class StockTransactionGetListInputDto : PagedAndSortedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 股票代码
|
||||
/// </summary>
|
||||
public string StockCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 股票名称
|
||||
/// </summary>
|
||||
public string StockName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易类型
|
||||
/// </summary>
|
||||
public TransactionTypeEnum? TransactionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Volo.Abp.Application.Services;
|
||||
using Yi.Framework.Stock.Application.Contracts.Dtos.StockHolding;
|
||||
using Yi.Framework.Stock.Application.Contracts.Dtos.StockTransaction;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户持仓服务接口
|
||||
/// </summary>
|
||||
public interface IStockHoldingService : IApplicationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取当前用户的持仓列表
|
||||
/// </summary>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <returns>持仓列表</returns>
|
||||
Task<PagedResultDto<StockHoldingDto>> GetUserHoldingsAsync(StockHoldingGetListInputDto input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户的交易记录
|
||||
/// </summary>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <returns>交易记录列表</returns>
|
||||
Task<PagedResultDto<StockTransactionDto>> GetUserTransactionsAsync(StockTransactionGetListInputDto input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Volo.Abp.Application.Services;
|
||||
using Yi.Framework.Stock.Application.Contracts.Dtos.StockMarket;
|
||||
using Yi.Framework.Stock.Application.Contracts.Dtos.StockPrice;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市服务接口
|
||||
/// </summary>
|
||||
public interface IStockMarketService : IApplicationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取股市列表
|
||||
/// </summary>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <returns>股市列表</returns>
|
||||
Task<PagedResultDto<StockMarketDto>> GetStockMarketListAsync(StockMarketGetListInputDto input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取股市价格记录看板
|
||||
/// </summary>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <returns>股价记录列表</returns>
|
||||
Task<PagedResultDto<StockPriceRecordDto>> GetStockPriceRecordListAsync(StockPriceRecordGetListInputDto input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Volo.Abp.Application.Services;
|
||||
using Yi.Framework.Stock.Application.Contracts.Dtos.StockNews;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 股市新闻服务接口
|
||||
/// </summary>
|
||||
public interface IStockNewsService : IApplicationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取股市新闻列表
|
||||
/// </summary>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <returns>新闻列表</returns>
|
||||
Task<PagedResultDto<StockNewsDto>> GetStockNewsListAsync(StockNewsGetListInputDto input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\common.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\framework\Yi.Framework.Ddd.Application.Contracts\Yi.Framework.Ddd.Application.Contracts.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Stock.Domain.Shared\Yi.Framework.Stock.Domain.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="$(AbpVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Dtos\" />
|
||||
<Folder Include="IServices\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,17 @@
|
||||
using Volo.Abp.SettingManagement;
|
||||
using Yi.Framework.Stock.Domain.Shared;
|
||||
using Yi.Framework.Ddd.Application.Contracts;
|
||||
|
||||
namespace Yi.Framework.Stock.Application.Contracts
|
||||
{
|
||||
[DependsOn(
|
||||
typeof(YiFrameworkStockDomainSharedModule),
|
||||
|
||||
typeof(AbpSettingManagementApplicationContractsModule),
|
||||
|
||||
typeof(YiFrameworkDddApplicationContractsModule))]
|
||||
public class YiFrameworkStockApplicationContractsModule:AbpModule
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user