import request from '@/utils/request'

// 查询支付商户列表
export function listMerchant(query) {
  return request({
    url: '/pay/payMerchant/list',
    method: 'get',
    params: query
  })
}

// 查询支付商户详细
export function getMerchant(id) {
  return request({
    url: '/pay/payMerchant/' + id,
    method: 'get'
  })
}

// 查询支付商户详细
export function getMerchantByCode(code) {
  return request({
    url: '/pay/payMerchant/getByCode/' + code,
    method: 'get'
  })
}

// 新增支付商户
export function addMerchant(data) {
  return request({
    url: '/pay/payMerchant',
    method: 'post',
    data: data
  })
}

// 锁定支付商户
export function lockMerchant(id) {
  return request({
    url: '/pay/payMerchant/lock/' + id,
    method: 'post'
  })
}

// 修改支付商户
export function updateMerchant(data) {
  return request({
    url: '/pay/payMerchant',
    method: 'put',
    data: data
  })
}
// 修改支付商户
export function updateMerchantSync(data) {
  return request({
    url: '/pay/payMerchant/syncEdit',
    method: 'put',
    data: data
  })
}

// 删除支付商户
export function delMerchant(id) {
  return request({
    url: '/pay/payMerchant/' + id,
    method: 'delete'
  })
}
