import request from '@/utils/request'
// 分页查询
export const pageList = (query) => {
  return request({
    url: '/thirdapi/douyin/product/list',
    method: 'post',
    data: query
  })
}

// 分页查询
export const goodsList = (query) => {
  return request({
    url: '/thirdapi/otaGoods/goodsList',
    method: 'get',
    params: query
  })
}

// 获取OTA配置
export const getOtaConfig = (query) => {
  return request({
    url: '/thirdapi/otaConfig/getInfo',
    method: 'get',
    params: query
  })
}

// 保存OTA
export const otaSave = (data) => {
  return request({
    url: '/thirdapi/otaConfig/save',
    method: 'post',
    data: data
  })
}

// 新增/修改
export const saveAndEdit = (data) => {
  return request({
    url: '/thirdapi/otaGoods/save',
    method: 'post',
    data: data
  })
}

// 删除模板
export const deleteById = (id) => {
  return request({
    url: '/thirdapi/otaGoods/deleteById',
    method: 'delete',
    params: {id:id}
  })
}

/** 系统-抖音-ota-(商品推送)  */
export const pushById = (data) => {
    return request({
        url: '/thirdapi/douyin/product/push',
        method: 'post',
        data: data
    })
}

/** 系统-抖音(商品上下架)  */
export const updateById = (data) => {
  return request({
      url: '/thirdapi/douyin/product/update',
      method: 'post',
      data: data
  })
}

/** 系统-抖音(商品批量更新库存)  */
export const stockUpdateById = (data) => {
  return request({
      url: '/thirdapi/douyin/product/stock/update',
      method: 'post',
      data: data
  })
}