import request from '@/utils/request'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/thirdapi/otaGoods/pageList',
    method: 'get',
    params: 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}
  })
}
