import request from '@/utils/request'

export function list(query) {
  return request({
    url: '/course/playSourceConfig/list',
    method: 'get',
    params: query
  })
}

export function get(id) {
  return request({
    url: '/course/playSourceConfig/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/course/playSourceConfig',
    method: 'post',
    data: data
  })
}

export function update(data) {
  return request({
    url: '/course/playSourceConfig',
    method: 'put',
    data: data
  })
}

export function updateBindConfig(data) {
  return request({
    url: '/course/playSourceConfig/updateBindConfig',
    method: 'put',
    data: data
  })
}

export function updateUnbindConfig(data) {
  return request({
    url: '/course/playSourceConfig/updateUnbindConfig',
    method: 'put',
    data: data
  })
}

export function del(id) {
  return request({
    url: '/course/playSourceConfig/' + id,
    method: 'delete'
  })
}

export function listAll(companyId) {
  return request({
    url: '/course/playSourceConfig/listAll',
    method: 'get',
    params: {companyId}
  })
}

export function updateAgreementConfig(data) {
  return request({
    url: '/course/playSourceConfig/updateAgreementConfig',
    method: 'post',
    data: data
  })
}

export function queryAgreementConfig(query) {
  return request({
    url: '/course/playSourceConfig/queryAgreementConfig',
    method: 'get',
    params: query
  })
}

// 绑定商户
export function bindMerchant(data) {
  return request({
    url: '/course/playSourceConfig/bindMerchant',
    method: 'post',
    data: data
  })
}

