import http from '@/utils/request'

// 获取支付渠道
export function getPayChannel ({ keyWords = '', payType = '', status = '', pageNum = 1, pageSize = 10 }) {
  return http.post('/admin/payChannel', {
    data: {
      export: false,
      pageSize,
      pageNum,
      name: keyWords,
      status,
      payType
    }
  })
}

// 创建
export function addPayChannel ({ name = '', status = 1 }) {
  return http.post('/admin/payChannel/add', { data: { name, status } })
}

// 删除
export function deletePayChannel (id) {
  return http.post(`paychannel/delete/${id}`)
}

// 更新
export function updatePayChannel ({ status, id }) {
  return http.post(`/admin/payChannel/updateStatus`, { data: { status, id } })
}

// 更新
export function updatePayChannel2 (params) {
  return http.post(`/admin/payChannel/update`, params)
}

// 获取工行子商户列表
export function getGhSubMerchantList () {
  return http.post('/admin/gonghang/subMerchantList', { data: {} })
}

// 保存工行子商户
export function saveGhSubMerchant (params) {
  return http.post('/admin/gonghang/saveSubMerchant', { data: params })
}

// 删除工行子商户
export function deleteGhSubMerchant (id) {
  return http.post(`/admin/gonghang/deleteSubMerchant`, { data: { idList: [id] } })
}

// 更新工行子商户
export function updateGhSubMerchant (params) {
  return http.post('/admin/gonghang/updateSubMerchant', { data: params })
}
