Browse Source

实体更新

master
shanji 3 years ago
parent
commit
b7079ed944
  1. 36
      Binance.TradeRobot.Model/Db/Exchange/ExchangeAPIKey.cs
  2. 25
      Binance.TradeRobot.Model/Db/Exchange/ExchangeAccount.cs
  3. 8
      Binance.TradeRobot.Model/Db/Order/ExecutionLog.cs
  4. 18
      Binance.TradeRobot.Model/Db/Order/LoanOrder.cs
  5. 26
      Binance.TradeRobot.Model/Db/Order/SpotOrder.cs
  6. 15
      Binance.TradeRobot.Model/Db/Policy/Spot/D21Policy.cs
  7. 9
      Binance.TradeRobot.Model/Db/Policy/UPrep/PyramidPolicy.cs
  8. 15
      Binance.TradeRobot.Model/Db/Robot/Robot.cs
  9. 12
      Binance.TradeRobot.Model/Db/Robot/RobotAccount.cs
  10. 10
      Binance.TradeRobot.Model/Db/User/User.cs
  11. 13
      Binance.TradeRobot.Model/Db/User/UserAccountFundChangeRecord.cs
  12. 20
      Binance.TradeRobot.Model/Db/User/UserAccountProfitLossRecord.cs
  13. 32
      Binance.TradeRobot.Model/Db/代码生成/Exchangeaccount.cs
  14. 35
      Binance.TradeRobot.Model/Db/代码生成/Exchangeapikey.cs

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

@ -3,32 +3,28 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(Name = "exchangeapikey", DisableSyncStructure = true)]
public partial class ExchangeAPIKey
{
[Table(DisableSyncStructure = true, Name = "exchangeapikey")]
public partial class ExchangeAPIKey
{
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
[Column(IsPrimary = true, DbType = "bigint")]
public long Id { get; set; }
[Column(DbType = "bigint")]
public long AccountId { get; set; }
/// <summary>
/// 交易所账号Id
/// </summary>
[Column(DbType = "bigint")]
public long AccountId { get; set; }
[Column(StringLength = 100, IsNullable = false)]
public string APIKey { get; set; }
[Column(StringLength = 100, IsNullable = false)]
public string APIKey { get; set; }
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
[Column(DbType = "datetime")]
public DateTime CreateTime { get; set; }
[Column(DbType = "bigint")]
public long? RobotId { get; set; }
[Column(DbType = "bigint")]
public long? RobotId { get; set; }
[Column(StringLength = 100, IsNullable = false)]
public string SecretKey { get; set; }
[Column(StringLength = 100, IsNullable = false)]
public string SecretKey { get; set; }
}
}
}

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

@ -5,41 +5,28 @@ 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;
}
[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>
/// 总借币金额

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

@ -4,19 +4,19 @@ 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>
/// 投资本金
/// </summary>
[ Column(DbType = "decimal(18,8)")]
[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)]

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

@ -5,11 +5,11 @@ using System;
namespace Binance.TradeRobot.Model.Db
{
[Table(DisableSyncStructure = true)]
[Table(Name = "useraccountfundchangerecord", DisableSyncStructure = true)]
public partial class UserAccountFundChangeRecord
{
[Column(IsPrimary = true)]
[Column(DbType = "bigint", IsPrimary = true)]
public long Id { get; set; }
/// <summary>
@ -18,28 +18,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; }
}
}
Loading…
Cancel
Save