|
|
|
using Binance.TradeRobot.Business;
|
|
|
|
using Binance.TradeRobot.Model.Dto;
|
|
|
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace Binance.TradeRobot.API.Controllers
|
|
|
|
{
|
|
|
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
|
|
|
public class RobotController : BaseApiController
|
|
|
|
{
|
|
|
|
private RobotBusiness robotBusiness;
|
|
|
|
|
|
|
|
public RobotController(RobotBusiness robotBusiness)
|
|
|
|
{
|
|
|
|
this.robotBusiness = robotBusiness;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 创建金字塔策略机器人
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="addPyramidPolicyRobotRequest"></param>
|
|
|
|
[HttpPost]
|
|
|
|
public void AddPyramidPolicyRobot([FromBody] AddPyramidPolicyRobotRequest addPyramidPolicyRobotRequest)
|
|
|
|
{
|
|
|
|
robotBusiness.AddPyramidPolicyRobot(addPyramidPolicyRobotRequest);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 创建动2.1策略机器人
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="addD21PolicyRobotRequest"></param>
|
|
|
|
[HttpPost]
|
|
|
|
public void AddD21PolicyRobot([FromBody] AddD21PolicyRobotRequest addD21PolicyRobotRequest)
|
|
|
|
{
|
|
|
|
robotBusiness.AddD21PolicyRobot(addD21PolicyRobotRequest);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取动2.1机器人列表
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
public IList<D21PolicyRobotResponse> GetD21PolicyRobotList()
|
|
|
|
{
|
|
|
|
return robotBusiness.GetD21PolicyRobotList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|