Browse Source

合并冲突

master
shanji 3 years ago
parent
commit
3a6011b046
  1. 6
      Binance.TradeRobot.API/Binance.TradeRobot.API.xml
  2. 1
      Binance.TradeRobot.API/Controllers/RobotController.cs
  3. 2
      Binance.TradeRobot.API/Controllers/UserController.cs
  4. 5
      Binance.TradeRobot.API/Program.cs
  5. 2
      Binance.TradeRobot.API/Properties/launchSettings.json
  6. 8
      Binance.TradeRobot.Business/Binance.TradeRobot.Business.xml
  7. 100
      Binance.TradeRobot.Model/Binance.TradeRobot.Model.xml
  8. 14
      Binance.TradeRobot.Model/Db/Exchange/ExchangeAPIKey.cs
  9. 26
      Binance.TradeRobot.Model/Db/Exchange/ExchangeAccount.cs
  10. 8
      Binance.TradeRobot.Model/Db/Order/ExecutionLog.cs
  11. 18
      Binance.TradeRobot.Model/Db/Order/LoanOrder.cs
  12. 26
      Binance.TradeRobot.Model/Db/Order/SpotOrder.cs
  13. 15
      Binance.TradeRobot.Model/Db/Policy/Spot/D21Policy.cs
  14. 9
      Binance.TradeRobot.Model/Db/Policy/UPrep/PyramidPolicy.cs
  15. 15
      Binance.TradeRobot.Model/Db/Robot/Robot.cs
  16. 12
      Binance.TradeRobot.Model/Db/Robot/RobotAccount.cs
  17. 8
      Binance.TradeRobot.Model/Db/User/User.cs
  18. 17
      Binance.TradeRobot.Model/Db/User/UserAccountFundChangeRecord.cs
  19. 20
      Binance.TradeRobot.Model/Db/User/UserAccountProfitLossRecord.cs
  20. 32
      Binance.TradeRobot.Model/Db/代码生成/Exchangeaccount.cs
  21. 35
      Binance.TradeRobot.Model/Db/代码生成/Exchangeapikey.cs
  22. 3
      Binance.TradeRobot.Model/Dto/Request/Exchange/AddExchangeAccountRequest.cs

6
Binance.TradeRobot.API/Binance.TradeRobot.API.xml

@ -43,6 +43,12 @@
</summary>
<param name="addD21PolicyRobotRequest"></param>
</member>
<member name="M:Binance.TradeRobot.API.Controllers.RobotController.GetD21PolicyRobotList">
<summary>
获取动2.1机器人列表
</summary>
<returns></returns>
</member>
<member name="M:Binance.TradeRobot.API.Controllers.UserController.Login(Binance.TradeRobot.Model.Dto.LoginRequest)">
<summary>
用户登录

1
Binance.TradeRobot.API/Controllers/RobotController.cs

@ -31,6 +31,7 @@ namespace Binance.TradeRobot.API.Controllers
/// 创建动2.1策略机器人
/// </summary>
/// <param name="addD21PolicyRobotRequest"></param>
[HttpPost]
public void AddD21PolicyRobot([FromBody] AddD21PolicyRobotRequest addD21PolicyRobotRequest)
{
robotBusiness.AddD21PolicyRobot(addD21PolicyRobotRequest);

2
Binance.TradeRobot.API/Controllers/UserController.cs

@ -40,7 +40,7 @@ namespace Binance.TradeRobot.API.Controllers
/// <summary>
/// 获取用户资金变更记录
/// </summary>
[HttpGet]
[HttpPost]
public UserAccountChangeRecordListResponse GetUserAccountFundChangeRecordList([FromBody] QueryUserAccountRequest queryUserAccountRequest)
{
return userBusiness.GetUserAccountFundChangeRecordList(queryUserAccountRequest);

5
Binance.TradeRobot.API/Program.cs

@ -18,6 +18,11 @@ namespace Binance.TradeRobot.API
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder =>
{
if (args != null && args.Length > 0)
builder.AddCommandLine(args);
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();

2
Binance.TradeRobot.API/Properties/launchSettings.json

@ -21,7 +21,7 @@
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

8
Binance.TradeRobot.Business/Binance.TradeRobot.Business.xml

@ -20,6 +20,14 @@
<param name="exchangeAPIKey"></param>
<exception cref="T:Binance.TradeRobot.Model.Base.BusinessException"></exception>
</member>
<member name="M:Binance.TradeRobot.Business.RobotBusiness.AddRobotWithTran(Binance.TradeRobot.Model.Dto.AddRobotRequest,System.Data.Common.DbTransaction)">
<summary>
添加机器人和账户
</summary>
<param name="addRobotRequest"></param>
<param name="tran"></param>
<returns>机器人Id</returns>
</member>
<member name="M:Binance.TradeRobot.Business.RobotBusiness.AddPyramidPolicyRobot(Binance.TradeRobot.Model.Dto.AddPyramidPolicyRobotRequest)">
<summary>
添加金字塔策略机器人

100
Binance.TradeRobot.Model/Binance.TradeRobot.Model.xml

@ -109,26 +109,6 @@
信号周期 1m=0,3m=1,5m=2,15m=3,30m=4,1h=5,2h=6,4h=7,6h=8,8h=9,12h=10,1d=11,3d=12,1w=13,1M=14
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.ExchangeAccount.BusinessType">
<summary>
业务类型
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.ExchangeAccount.LoginName">
<summary>
账号登录名
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.ExchangeAccount.TradePolicy">
<summary>
交易策略
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.ExchangeAPIKey.AccountId">
<summary>
交易所账号Id
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.LoanOrder.ExchangeId">
<summary>
交易所Id
@ -254,6 +234,71 @@
运行时长(s)
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.ClosePositionCount">
<summary>
平仓次数
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.SoptCurrentcyAmount">
<summary>
现货/杠杆持仓金额
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.SpotCurrencyQuantity">
<summary>
现货/杠杆持仓数量
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.TotalProfit">
<summary>
总收益
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.WinCount">
<summary>
盈利次数
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.LoanAmount">
<summary>
总借币金额
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21ExecutionMode">
<summary>
执行模式
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21IsEnabledIncreasePurchase">
<summary>
是否开启增购
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21IsEnableRemedyForErrorCrossSignal">
<summary>
是否开启错误信号补救
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21MaxFollowPurchaseRatio">
<summary>
最大追高比例
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21PeriodicSignal">
<summary>
信号周期
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21Position">
<summary>
仓位
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.Robot.D21StopLossRatio">
<summary>
止损比例
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.RobotAccount.ClosePositionCount">
<summary>
平仓次数
@ -284,6 +329,11 @@
总借币金额
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.RobotAccount.SpotCurrencyAcgPrice">
<summary>
现货持仓均价
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Db.User.CostAmount">
<summary>
投资本金
@ -344,6 +394,11 @@
用户投资收益
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Dto.AddExchangeAccountRequest.Id">
<summary>
交易所UID
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Dto.AddExchangeAccountRequest.TradePolicy">
<summary>
交易策略
@ -439,6 +494,11 @@
逐仓杠杆USDT资产
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Dto.RobotResponse.RunningTime">
<summary>
运行时长(s)
</summary>
</member>
<member name="P:Binance.TradeRobot.Model.Dto.UserAccountFundChangeRecordResponse.UserName">
<summary>
资金变更用户名

14
Binance.TradeRobot.Model/Db/Exchange/ExchangeAPIKey.cs

@ -3,16 +3,20 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true, Name = "exchangeapikey")]
[Table(Name = "exchangeapikey", DisableSyncStructure = true)]
public partial class ExchangeAPIKey
{
[Column(IsPrimary = true, DbType = "bigint")]
public ExchangeAPIKey()
{
CreateTime = DateTime.Now;
}
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
/// 交易所账号UID
/// 交易所账号UID
/// </summary>
[Column(DbType = "bigint")]
public long AccountId { get; set; }
@ -24,7 +28,7 @@ namespace Binance.TradeRobot.Model.Db
public DateTime CreateTime { get; set; }
/// <summary>
/// 关联机器人Id
/// 关联机器人Id
/// </summary>
[Column(DbType = "bigint")]
public long? RobotId { get; set; }

26
Binance.TradeRobot.Model/Db/Exchange/ExchangeAccount.cs

@ -5,41 +5,29 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true, Name = "exchangeaccount")]
[Table(Name = "exchangeaccount", DisableSyncStructure = true)]
public partial class ExchangeAccount
{
public ExchangeAccount()
{
CreateTime = DateTime.Now;
}
public ExchangeAccount() { CreateTime = DateTime.Now; }
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Column(MapType = typeof(int))]
[Column(DbType = "int", MapType = typeof(int))]
public Enums.BusinessType BusinessType { get; set; }
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 账号登录名
/// </summary>
[Column(DbType = "int", MapType = typeof(int))]
public Enums.Exchange ExchangeId { get; set; }
[Column(StringLength = 50, IsNullable = false)]
public string LoginName { get; set; }
/// <summary>
/// 交易策略
/// </summary>
[Column(MapType = typeof(int))]
[Column(DbType = "int", MapType = typeof(int))]
public Enums.TradePolicy TradePolicy { get; set; }
[Column(MapType = typeof(int))]
public Enums.Exchange ExchangeId { get; set; }
}
}

8
Binance.TradeRobot.Model/Db/Order/ExecutionLog.cs

@ -4,19 +4,19 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "executionlog", DisableSyncStructure = true)]
public partial class ExecutionLog {
[ Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(StringLength = 250, IsNullable = false)]
public string Content { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
[Column(DbType = "bigint")]
public long RobotId { get; set; }
}

18
Binance.TradeRobot.Model/Db/Order/LoanOrder.cs

@ -5,24 +5,24 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "loanorder", DisableSyncStructure = true)]
public partial class LoanOrder
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 交易所Id
/// </summary>
[Column(DbType = "int", MapType = typeof(int))]
public Enums.Exchange ExchangeId { get; set; }
public int ExchangeId { get; set; }
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.LoanState LoadState { get; set; } = Enums.LoanState.Loaning;
/// <summary>
@ -40,13 +40,13 @@ namespace Binance.TradeRobot.Model.Db
[Column(StringLength = 50, IsNullable = false)]
public string LoanOrderId { get; set; }
[Column(DbType = "datetime")]
public DateTime ReturnTime { get; set; }
[Column(DbType = "bigint")]
public long RobotId { get; set; }
[Column(DbType = "bigint")]
public long SpotOrderId { get; set; }
}

26
Binance.TradeRobot.Model/Db/Order/SpotOrder.cs

@ -5,21 +5,21 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "spotorder", DisableSyncStructure = true)]
public partial class SpotOrder
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 交易所Id
/// </summary>
public int ExchangeId { get; set; }
[Column(DbType = "int", MapType = typeof(int))]
public Enums.Exchange ExchangeId { get; set; }
/// <summary>
/// 历史利润
@ -30,14 +30,14 @@ namespace Binance.TradeRobot.Model.Db
/// <summary>
/// 最后交易时间
/// </summary>
[Column(DbType = "datetime")]
public DateTime? LastTradeTime { get; set; }
/// <summary>
/// 交易策略
/// </summary>
public int PolicyType { get; set; }
[Column(DbType = "int", MapType = typeof(int))]
public Enums.TradePolicy PolicyType { get; set; }
/// <summary>
/// 订单利润
@ -45,14 +45,14 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal Profit { get; set; } = 0.0M;
[Column(DbType = "bigint")]
public long RobotId { get; set; }
[Column(MapType = typeof(int))]
public Enums.OrderState States { get; set; }
[Column(MapType = typeof(int), DbType = "int")]
public Enums.OrderState State { get; set; }
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.TradeDirection TradeDirection { get; set; }
[Column(StringLength = 50, IsNullable = false)]
@ -67,7 +67,7 @@ namespace Binance.TradeRobot.Model.Db
/// <summary>
/// 交易次数
/// </summary>
[Column(DbType = "int")]
public int TradeCount { get; set; } = 0;
/// <summary>

15
Binance.TradeRobot.Model/Db/Policy/Spot/D21Policy.cs

@ -5,20 +5,20 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "d21policy", DisableSyncStructure = true)]
public partial class D21Policy
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 执行模式
/// </summary>
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.ExecutionMode ExecutionMode { get; set; } = Enums.ExecutionMode.Both;
/// <summary>
@ -42,7 +42,7 @@ namespace Binance.TradeRobot.Model.Db
/// <summary>
/// 信号周期
/// </summary>
[Column(DbType = "int", MapType = typeof(int))]
public Enums.SignalPeriod PeriodicSignal { get; set; }
/// <summary>
@ -51,13 +51,14 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal Position { get; set; } = 0.0M;
[Column(DbType = "bigint")]
public long RobotId { get; set; }
/// <summary>
/// 止损比例
/// </summary>
public decimal StopLossRatio { get; set; }
[Column(DbType = "decimal(18,2)")]
public decimal StopLossRatio { get; set; } = 0.0M;
}
}

9
Binance.TradeRobot.Model/Db/Policy/UPrep/PyramidPolicy.cs

@ -3,20 +3,22 @@ using FreeSql.DataAnnotations;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "pyramidpolicy", DisableSyncStructure = true)]
public partial class PyramidPolicy
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.SignalPeriod SignalPeriod { get; set; }
[Column(DbType = "bigint")]
public long RobotId { get; set; }
/// <summary>
/// 杠杆倍数(1-125整数)
/// </summary>
[Column(DbType = "int")]
public int Leverage { get; set; } = 1;
/// <summary>
@ -28,6 +30,7 @@ namespace Binance.TradeRobot.Model.Db
/// <summary>
/// 金字塔
/// </summary>
[Column(DbType = "int")]
public int Pyramid { get; set; } = 0;
}

15
Binance.TradeRobot.Model/Db/Robot/Robot.cs

@ -5,34 +5,35 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "robot", DisableSyncStructure = true)]
public partial class Robot
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
[Column(MapType = (typeof(int)))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.TradePolicy TradePolicy { get; set; }
/// <summary>
/// 运行时长(s)
/// </summary>
[Column(DbType = "bigint")]
public long RunningTime { get; set; } = 0;
[Column(MapType = (typeof(int)))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.RobotState State { get; set; }
[Column(StringLength = 50, IsNullable = false)]
public string Symbol { get; set; }
[Column(MapType = (typeof(int)))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.BusinessType BusinessType { get; set; }
[Column(MapType = (typeof(int)))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.Exchange ExchangeId { get; set; }
#region RobotAccount Extension

12
Binance.TradeRobot.Model/Db/Robot/RobotAccount.cs

@ -3,19 +3,20 @@ using FreeSql.DataAnnotations;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "robotaccount", DisableSyncStructure = true)]
public partial class RobotAccount
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
/// 平仓次数
/// </summary>
public long ClosePositionCount { get; set; } = 0;
[Column(DbType = "int")]
public int ClosePositionCount { get; set; } = 0;
[Column(DbType = "bigint")]
public long RobotId { get; set; }
/// <summary>
@ -39,7 +40,8 @@ namespace Binance.TradeRobot.Model.Db
/// <summary>
/// 盈利次数
/// </summary>
public long WinCount { get; set; } = 0;
[Column(DbType = "int")]
public int WinCount { get; set; } = 0;
/// <summary>
/// 总借币金额

8
Binance.TradeRobot.Model/Db/User/User.cs

@ -4,10 +4,10 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "user", DisableSyncStructure = true)]
public partial class User {
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
@ -16,7 +16,7 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal CostAmount { get; set; } = 0.0M;
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
@ -28,7 +28,7 @@ namespace Binance.TradeRobot.Model.Db
[Column(StringLength = 20)]
public string Pwd { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime? UpdateTime { get; set; }
[Column(StringLength = 20)]

17
Binance.TradeRobot.Model/Db/User/UserAccountFundChangeRecord.cs

@ -5,11 +5,15 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "useraccountfundchangerecord", DisableSyncStructure = true)]
public partial class UserAccountFundChangeRecord
{
public UserAccountFundChangeRecord()
{
CreateTime = DateTime.Now;
}
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
@ -18,28 +22,31 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal ChangeAmount { get; set; }
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime? CreateTime { get; set; }
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.FundDirection Direction { get; set; }
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.CapitalChangeType OperationType { get; set; }
/// <summary>
/// 操作者Id
/// </summary>
[Column(DbType = "bigint")]
public long OperationUserId { get; set; }
/// <summary>
/// 用户Id
/// </summary>
[Column(DbType = "bigint")]
public long UserId { get; set; }
/// <summary>
/// 对端用户Id
/// </summary>
[Column(DbType = "bigint")]
public long? ToUserId { get; set; }
[Column(StringLength = 100)]

20
Binance.TradeRobot.Model/Db/User/UserAccountProfitLossRecord.cs

@ -5,14 +5,17 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "useraccountprofitlossrecord", DisableSyncStructure = true)]
public partial class UserAccountProfitLossRecord
{
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Column(MapType = typeof(int))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.BusinessType BusinessType { get; set; }
/// <summary>
@ -21,7 +24,7 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal ChangeAmount { get; set; } = 0.0M;
[Column(InsertValueSql = "getdate()")]
[Column(DbType = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
@ -30,10 +33,7 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,2)")]
public decimal DividendRatio { get; set; } = 0.0M;
[Column(IsPrimary = true)]
public long Id { get; set; }
[Column(DbType = "bigint")]
public long OrderId { get; set; }
/// <summary>
@ -42,10 +42,10 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal OrderProfit { get; set; } = 0.0M;
[Column(DbType = "bigint")]
public long RobotId { get; set; }
[Column(DbType = "bigint")]
public long UserId { get; set; }
/// <summary>
@ -54,7 +54,7 @@ namespace Binance.TradeRobot.Model.Db
[Column(DbType = "decimal(18,8)")]
public decimal UserProfit { get; set; } = 0.0M;
[Column(MapType = (typeof(int)))]
[Column(MapType = typeof(int), DbType = "int")]
public Enums.Exchange ExchangeId { get; set; }
}

32
Binance.TradeRobot.Model/Db/代码生成/Exchangeaccount.cs

@ -1,32 +0,0 @@
using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;
namespace Binance.TradeRobot.Model.Db {
[JsonObject(MemberSerialization.OptIn), Table(Name = "exchangeaccount", DisableSyncStructure = true)]
public partial class Exchangeaccount {
[JsonProperty, Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[JsonProperty, Column(DbType = "int")]
public int? BusinessType { get; set; }
[JsonProperty, Column(DbType = "datetime")]
public DateTime? CreateTime { get; set; }
[JsonProperty, Column(StringLength = 50)]
public string LoginName { get; set; }
[JsonProperty, Column(DbType = "int")]
public int? TradePolicy { get; set; }
}
}

35
Binance.TradeRobot.Model/Db/代码生成/Exchangeapikey.cs

@ -1,35 +0,0 @@
using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;
namespace Binance.TradeRobot.Model.Db {
[JsonObject(MemberSerialization.OptIn), Table(Name = "exchangeapikey", DisableSyncStructure = true)]
public partial class Exchangeapikey {
[JsonProperty, Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[JsonProperty, Column(DbType = "bigint")]
public long AccountId { get; set; }
[JsonProperty, Column(StringLength = 100, IsNullable = false)]
public string APIKey { get; set; }
[JsonProperty, Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
[JsonProperty, Column(DbType = "bigint")]
public long? RobotId { get; set; }
[JsonProperty, Column(StringLength = 100, IsNullable = false)]
public string SecretKey { get; set; }
}
}

3
Binance.TradeRobot.Model/Dto/Request/Exchange/AddExchangeAccountRequest.cs

@ -4,6 +4,9 @@ namespace Binance.TradeRobot.Model.Dto
{
public class AddExchangeAccountRequest
{
/// <summary>
/// 交易所UID
/// </summary>
public long Id { get; set; }
public string LoginName { get; set; }

Loading…
Cancel
Save