1、有更新,还没测完,暂时归档
This commit is contained in:
@ -9,20 +9,20 @@ type LineApiUser struct {
|
||||
|
||||
ExchangeType string `json:"exchangeType" gorm:"type:varchar(20);comment:交易所类型(字典 exchange_type)"`
|
||||
UserId int64 `json:"userId" gorm:"type:int unsigned;comment:用户id"`
|
||||
JysId int64 `json:"jysId" gorm:"type:int;comment:关联交易所账号id"`
|
||||
ApiName string `json:"apiName" gorm:"type:varchar(255);comment:api用户名"`
|
||||
ApiKey string `json:"apiKey" gorm:"type:varchar(255);comment:apiKey"`
|
||||
ApiSecret string `json:"apiSecret" gorm:"type:varchar(255);comment:apiSecret"`
|
||||
Passphrase string `json:"passphrase" gorm:"type:varchar(255);comment:api密码"`
|
||||
IpAddress string `json:"ipAddress" gorm:"type:varchar(255);comment:代理地址"`
|
||||
UserPass string `json:"userPass" gorm:"type:varchar(255);comment:代码账号密码"`
|
||||
AdminId int64 `json:"adminId" gorm:"type:int unsigned;comment:管理员id"`
|
||||
Affiliation int64 `json:"affiliation" gorm:"type:int;comment:归属:1=现货,2=合约,3=现货合约"`
|
||||
AdminShow int64 `json:"adminShow" gorm:"type:int;comment:是否超管可见:1=是,0=否"`
|
||||
Site string `json:"site" gorm:"type:enum('1','2','3');comment:允许下单的方向:1=多;2=空;3=多空"`
|
||||
Subordinate string `json:"subordinate" gorm:"type:enum('0','1','2');comment:从属关系:0=未绑定关系;1=主账号;2=副帐号"`
|
||||
GroupId int64 `json:"groupId" gorm:"type:int unsigned;comment:所属组id"`
|
||||
OpenStatus int64 `json:"openStatus" gorm:"type:int unsigned;comment:开启状态 0=关闭 1=开启"`
|
||||
// JysId int64 `json:"jysId" gorm:"type:int;comment:关联交易所账号id"`
|
||||
ApiName string `json:"apiName" gorm:"type:varchar(255);comment:api用户名"`
|
||||
ApiKey string `json:"apiKey" gorm:"type:varchar(255);comment:apiKey"`
|
||||
ApiSecret string `json:"apiSecret" gorm:"type:varchar(255);comment:apiSecret"`
|
||||
Passphrase string `json:"passphrase" gorm:"type:varchar(255);comment:api密码"`
|
||||
IpAddress string `json:"ipAddress" gorm:"type:varchar(255);comment:代理地址"`
|
||||
UserPass string `json:"userPass" gorm:"type:varchar(255);comment:代码账号密码"`
|
||||
// AdminId int64 `json:"adminId" gorm:"type:int unsigned;comment:管理员id"`
|
||||
Affiliation int64 `json:"affiliation" gorm:"type:int;comment:归属:1=现货,2=合约,3=现货合约"`
|
||||
AdminShow int64 `json:"adminShow" gorm:"type:int;comment:是否超管可见:1=是,0=否"`
|
||||
Site string `json:"site" gorm:"type:enum('1','2','3');comment:允许下单的方向:1=多;2=空;3=多空"`
|
||||
Subordinate string `json:"subordinate" gorm:"type:enum('0','1','2');comment:从属关系:0=未绑定关系;1=主账号;2=副帐号"`
|
||||
GroupId int64 `json:"groupId" gorm:"type:int unsigned;comment:所属组id"`
|
||||
OpenStatus int64 `json:"openStatus" gorm:"type:int unsigned;comment:开启状态 0=关闭 1=开启"`
|
||||
|
||||
SpotLastTime string `json:"spotLastTime" gorm:"-"` //现货websocket最后通信时间
|
||||
FuturesLastTime string `json:"futuresLastTime" gorm:"-"` //合约websocket最后通信时间
|
||||
|
||||
@ -66,13 +66,13 @@ func (s *LineApiUserInsertReq) Generate(model *models.LineApiUser) {
|
||||
}
|
||||
model.ExchangeType = s.ExchangeType
|
||||
model.UserId = s.UserId
|
||||
model.JysId = s.JysId
|
||||
// model.JysId = s.JysId
|
||||
model.ApiName = s.ApiName
|
||||
model.ApiKey = s.ApiKey
|
||||
model.ApiSecret = s.ApiSecret
|
||||
model.IpAddress = s.IpAddress
|
||||
model.UserPass = s.UserPass
|
||||
model.AdminId = s.AdminId
|
||||
// model.AdminId = s.AdminId
|
||||
model.Affiliation = s.Affiliation
|
||||
model.AdminShow = s.AdminShow
|
||||
model.Site = s.Site
|
||||
@ -112,13 +112,13 @@ func (s *LineApiUserUpdateReq) Generate(model *models.LineApiUser) {
|
||||
}
|
||||
model.ExchangeType = s.ExchangeType
|
||||
model.UserId = s.UserId
|
||||
model.JysId = s.JysId
|
||||
// model.JysId = s.JysId
|
||||
model.ApiName = s.ApiName
|
||||
model.ApiKey = s.ApiKey
|
||||
model.ApiSecret = s.ApiSecret
|
||||
model.IpAddress = s.IpAddress
|
||||
model.UserPass = s.UserPass
|
||||
model.AdminId = s.AdminId
|
||||
// model.AdminId = s.AdminId
|
||||
model.Affiliation = s.Affiliation
|
||||
model.AdminShow = s.AdminShow
|
||||
model.Site = s.Site
|
||||
|
||||
@ -300,7 +300,7 @@ func (req LineAddPreOrderReq) Valid() error {
|
||||
}
|
||||
|
||||
//减仓100%
|
||||
if req.ReduceNumRatio.Cmp(decimal.NewFromInt(100)) == 0 {
|
||||
if req.ReduceNumRatio.Cmp(decimal.NewFromInt(100)) == 0 && len(req.Ext) > 0 {
|
||||
return errors.New("减仓数量百分百,后面的节点不需要添加")
|
||||
}
|
||||
|
||||
@ -599,6 +599,20 @@ type StopLossRedisList struct {
|
||||
ApiId int `json:"api_id"`
|
||||
}
|
||||
|
||||
type TakeProfitRedisList struct {
|
||||
Id int `json:"id"`
|
||||
PId int `json:"pid"` //父级id
|
||||
MainId int `json:"mainId"` //主单id
|
||||
OrderTye int `json:"orderType"`
|
||||
SymbolType int `json:"symbolType"`
|
||||
OrderCategory int `json:"orderCategory"`
|
||||
Symbol string `json:"symbol"`
|
||||
Price decimal.Decimal `json:"price"` //触发价(根据主单价格触发)
|
||||
Site string `json:"site"`
|
||||
ApiId int `json:"api_id"`
|
||||
OrderSn string `json:"订单编号" comment:"订单编号"`
|
||||
}
|
||||
|
||||
// ManuallyCover 手动加仓请求体
|
||||
type ManuallyCover struct {
|
||||
ApiId int `json:"api_id"` //主账号id
|
||||
|
||||
Reference in New Issue
Block a user