import http from '@/utils/request'

// 获取价格码列表
export const getOTATicketSaleList = (params) => {
  return http.post('/tenant/otaProduct', { data: params })
}
// 添加价格码
export const addOTATicketSale = (params) => {
  return http.post('/tenant/otaProduct/add', { data: params })
}
// 删除价格码
export const deleteOTATicketSale = (params) => {
  return http.post('/tenant/otaProduct/delete', { data: params })
}

// 编辑价格码
export const updateOTATicketSale = (params) => {
  return http.post('/tenant/otaProduct/update', { data: params })
}

// 场次查询
export const getBatchConfigList = (params) => {
  return http.post('/tenant/batchConfig/getBatchConfigList', { data: params })
}

// 票种价格方案
export function getPricePlan (params) {
  return http.post('/tenant/otaticketsale/getPricePlan', { data: params })
}

export function setPricePlan (params) {
  return http.post('/tenant/otaticketsale/setPricePlan', { data: params })
}

export function syncDatePriceModify (params) {
  return http.post('/tenant/otaticketsale/syncDatePriceModify', { data: params })
}

export function syncDateInventoryModify (params) {
  return http.post('/tenant/otaticketsale/syncDateInventoryModify', { data: params })
}

// 获得节目与场次
export const getPerformList = (params) => {
  return http.post(`perform/list/${params}`)
}

// 请求快手创建日历票产品
export function ksSaveProduct (params, poiId) {
  return http.post(`/otaks/saveProduct/${poiId}`,
    {
      'apiMethodName': 'string',
      'apiParams': {
        'additionalProp1': 'string',
        'additionalProp2': 'string',
        'additionalProp3': 'string'
      },
      'apiReqJson': 'string',
      'businessParams': {
        'additionalProp1': 'string',
        'additionalProp2': 'string',
        'additionalProp3': 'string'
      },
      'headerParams': {
        'additionalProp1': 'string',
        'additionalProp2': 'string',
        'additionalProp3': 'string'
      },
      'httpRequestMethod': 'POST',
      'requestSpecialPath': 'string',
      'ticket': {
        ...params
      }
    }
  )
}
// 请求快手更新价格库存
export function ksUpdatePriceOrStock (params, poiId) {
  return http.post(`/otaks/updatePriceOrStock/${poiId}`,
    params
  )
}

// 快手 商品类目查询
export function ksCategoryQuery (poiId, categoryId) {
  return http.post(`/otaks/categoryQuery/${poiId}`, {
    'category_id': categoryId
  })
}

// 快手 上传图片
export function picUpload (poiId, { data: params }) {
  return http.post(`/otaks/picUpload/${poiId}`, {image_list: params})
}
