You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
3 years ago
|
using Binance.TradeRobot.Common.DI;
|
||
|
using Binance.TradeRobot.Model.Db;
|
||
|
using Binance.TradeRobot.Model.Dto;
|
||
|
using Microsoft.Extensions.Caching.Memory;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
using System.Collections.Generic;
|
||
|
using Yitter.IdGenerator;
|
||
|
|
||
|
namespace Binance.TradeRobot.Business
|
||
|
{
|
||
|
[BatchRegistration(ServiceLifetime.Singleton, RegistrationType.Self)]
|
||
|
public class OrderBusiness : BaseBusiness
|
||
|
{
|
||
|
public OrderBusiness(IFreeSql fsql, NLogManager logManager, IIdGenerator idGenerator, IMemoryCache memoryCache) : base(fsql, logManager, idGenerator, memoryCache)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
public IList<SpotOrderResponse> GetSpotOrderList(long robotId)
|
||
|
{
|
||
|
return fsql.Select<SpotOrder>().Where(o => o.RobotId == robotId).OrderByDescending(o => o.CreateTime).Page(1, 20).ToList<SpotOrderResponse>();
|
||
|
}
|
||
|
|
||
|
public IList<ExecutionLogResponse> GetExecutionLogList(long robotId)
|
||
|
{
|
||
|
return fsql.Select<ExecutionLog>().Where(l => l.RobotId == robotId).OrderByDescending(l => l.CreateTime).Page(1, 50).ToList<ExecutionLogResponse>();
|
||
|
}
|
||
|
}
|
||
|
}
|