import request from '@/utils/request'

// 查询LinePreOrder列表
export function listLinePreOrder(query) {
  return request({
    url: '/api/v1/line-pre-order',
    method: 'get',
    params: query
  })
}

// 查询LinePreOrder详细
export function getLinePreOrder(id) {
  return request({
    url: '/api/v1/line-pre-order/' + id,
    method: 'get'
  })
}

// 新增LinePreOrder
export function addLinePreOrder(data) {
  return request({
    url: '/api/v1/line-pre-order',
    method: 'post',
    data: data
  })
}

// 修改LinePreOrder
export function updateLinePreOrder(data) {
  return request({
    url: '/api/v1/line-pre-order/' + data.id,
    method: 'put',
    data: data
  })
}

// 删除LinePreOrder
export function delLinePreOrder(data) {
  return request({
    url: '/api/v1/line-pre-order',
    method: 'delete',
    data: data
  })
}

// 子数据
export function getChildOrder(data) {
  return request({
    url: '/api/v1/line-pre-order/getChildOrder',
    method: 'post',
    data
  })
}
// 委托管理新增
export function addOrder(data) {
  return request({
    url: '/api/v1/line-pre-order/addOrder',
    method: 'post',
    data
  })
}
// 批量添加
export function batchAddOrder(data) {
  return request({
    url: '/api/v1/line-pre-order/batchAddOrder',
    method: 'post',
    data
  })
}
export function orderLever(data) {
  return request({
    url: '/api/v1/line-pre-order/lever',
    method: 'post',
    data
  })
}
export function orderMarginType(data) {
  return request({
    url: '/api/v1/line-pre-order/marginType',
    method: 'post',
    data
  })
}
export function manuallyCover(data) {
  return request({
    url: '/api/v1/line-pre-order/manuallyCover',
    method: 'post',
    data
  })
}
export function closePosition(data) {
  return request({
    url: '/api/v1/line-pre-order/closePosition',
    method: 'post',
    data
  })
}
// 一键下单
export function quickAddPreOrder(data) {
  return request({
    url: '/api/v1/line-pre-order/quickAddPreOrder',
    method: 'post',
    data: data
  })
}
export function cancelOpenOrder(data) {
  return request({
    url: '/api/v1/line-pre-order/cancelOpenOrder',
    method: 'post',
    data: data
  })
}
// 一键清除
export function clearAll() {
  return request({
    url: '/api/v1/line-pre-order/clearAll',
    method: 'post'
  })
}
export function clearUnTriggered() {
  return request({
    url: '/api/v1/line-pre-order/clearUnTriggered',
    method: 'post'
  })
}

// 订单列表
export function getOrderPage(params) {
  return request({
    url: '/api/v1/line-pre-order/getOrderPage',
    method: 'get',
    params
  })
}

// aicoin买入点
export function aiCoinPrice(data) {
  return request({
    url: '/api/v1/line-pre-order/aiCoinPrice',
    method: 'post',
    data
  })
}
// aicoin交易对
export function aicoinSymbol(params) {
  return request({
    url: '/api/v1/line-direction/symbol',
    method: 'get',
    params
  })
}

