|
|
@ -3,7 +3,6 @@ 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 |
|
|
@ -16,14 +15,34 @@ namespace Binance.TradeRobot.Business |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public IList<SpotOrderResponse> GetSpotOrderList(long robotId) |
|
|
|
public SpotOrderPageResponse GetSpotOrderList(QueryOrderRequest queryOrderRequest) |
|
|
|
{ |
|
|
|
return fsql.Select<SpotOrder>().Where(o => o.RobotId == robotId).OrderByDescending(o => o.CreateTime).Page(1, 20).ToList<SpotOrderResponse>(); |
|
|
|
if (queryOrderRequest.PageSize > 100) |
|
|
|
queryOrderRequest.PageSize = 100; |
|
|
|
return new SpotOrderPageResponse() |
|
|
|
{ |
|
|
|
Items = fsql.Select<SpotOrder>().Where(o => o.RobotId == queryOrderRequest.RobotId) |
|
|
|
.OrderByDescending(o => o.CreateTime) |
|
|
|
.Page(queryOrderRequest.PageIndex, queryOrderRequest.PageSize) |
|
|
|
.Count(out long totalCount) |
|
|
|
.ToList<SpotOrderResponse>(), |
|
|
|
TotalCount = totalCount |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
public IList<ExecutionLogResponse> GetExecutionLogList(long robotId) |
|
|
|
public ExecutionLogPageResponse GetExecutionLogList(QueryLogRequest queryLogRequest) |
|
|
|
{ |
|
|
|
if (queryLogRequest.PageSize > 100) |
|
|
|
queryLogRequest.PageSize = 100; |
|
|
|
return new ExecutionLogPageResponse() |
|
|
|
{ |
|
|
|
return fsql.Select<ExecutionLog>().Where(l => l.RobotId == robotId).OrderByDescending(l => l.CreateTime).Page(1, 50).ToList<ExecutionLogResponse>(); |
|
|
|
Items = fsql.Select<ExecutionLog>().Where(l => l.RobotId == queryLogRequest.RobotId) |
|
|
|
.OrderByDescending(l => l.CreateTime) |
|
|
|
.Page(queryLogRequest.PageIndex, queryLogRequest.PageSize) |
|
|
|
.Count(out long totalCount) |
|
|
|
.ToList<ExecutionLogResponse>(), |
|
|
|
TotalCount = totalCount |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|