code
This commit is contained in:
@ -581,3 +581,24 @@ func (e LinePreOrder) QueryOrder(c *gin.Context) {
|
||||
}
|
||||
e.OK(res, "操作成功")
|
||||
}
|
||||
|
||||
func (e LinePreOrder) QueryAiCoinPrice(c *gin.Context) {
|
||||
s := service.LinePreOrder{}
|
||||
req := dto.QueryAiCoinPriceReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req).
|
||||
MakeService(&s.Service).
|
||||
Errors
|
||||
if err != nil {
|
||||
e.Logger.Error(err)
|
||||
e.Error(500, err, err.Error())
|
||||
return
|
||||
}
|
||||
res, err := s.QueryAiCoinPrice(&req)
|
||||
if err != nil {
|
||||
e.Error(500, err, err.Error())
|
||||
return
|
||||
}
|
||||
e.OK(res, "操作成功")
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ func registerLinePreOrderRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTM
|
||||
r.POST("closePosition", actions.PermissionAction(), api.ClosePosition) // 平仓
|
||||
r.GET("getOrderPage", actions.PermissionAction(), api.GetOrderPage) //订单列表
|
||||
r.POST("clearUnTriggered", actions.PermissionAction(), api.ClearUnTriggered) // 清除待触发的交易对
|
||||
r.POST("aiCoinPrice", actions.PermissionAction(), api.QueryAiCoinPrice) //获取aiCoin买入点
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -437,6 +437,10 @@ type QueryOrderReq struct {
|
||||
Symbol string `json:"symbol"` //交易对
|
||||
}
|
||||
|
||||
type QueryAiCoinPriceReq struct {
|
||||
Symbol string `json:"symbol"` //交易对
|
||||
}
|
||||
|
||||
type SpotQueryOrderResp struct {
|
||||
Symbol string `json:"symbol"`
|
||||
OrderId int `json:"orderId"`
|
||||
|
||||
@ -1282,3 +1282,9 @@ func (e *LinePreOrder) QueryOrder(req *dto.QueryOrderReq) (res interface{}, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (e *LinePreOrder) QueryAiCoinPrice(req *dto.QueryAiCoinPriceReq) (models.LineDirection, error) {
|
||||
var info models.LineDirection
|
||||
err := e.Orm.Model(&models.LineDirection{}).Where("symbol = ?", req.Symbol).Find(&info).Error
|
||||
return info, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user