feat: 完成股票价格生成job

This commit is contained in:
chenchun
2025-03-11 13:43:26 +08:00
parent ccaebb8ec2
commit 8ef91ebd03

View File

@@ -0,0 +1,26 @@
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.BackgroundWorkers.Hangfire;
using Yi.Framework.Stock.Domain.Managers;
namespace Yi.Abp.Web.Jobs.ai_stock
{
public class GenerateStockPricesJob : HangfireBackgroundWorkerBase
{
private readonly StockMarketManager _stockMarketManager;
public GenerateStockPricesJob(StockMarketManager stockMarketManager)
{
_stockMarketManager = stockMarketManager;
RecurringJobId = "AI股票价格生成";
//每天凌晨1点执行一次
CronExpression = "0 0 1 * * ?";
}
public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
{
await _stockMarketManager.GenerateStocksAsync();
}
}
}