import request from '@/utils/request';


// 查询商户代理商列表
export function listAgent(query) {
  return request({
    url: '/admin/agent/list',
    method: 'get',
    params: query
  })
}

// 查询商户代理商详细
export function getAgent(agentId) {
  return request({
    url: '/admin/agent/' + agentId,
    method: 'get'
  })
}

// 新增商户代理商
export function addAgent(data) {
  return request({
    url: '/admin/agent/add',
    method: 'post',
    data: data
  })
}

// 编辑商户代理商
export function updateAgent(data) {
  return request({
    url: '/admin/agent/edit',
    method: 'put',
    data: data
  })
}

// 删除商户代理商
export function delAgent(agentId) {
  return request({
    url: '/admin/agent/' + agentId,
    method: 'delete'
  })
}


// 逻辑删除商户代理商
export function logicalDelAgent(agentId) {
    return request({   
      url: '/admin/agent/' + agentId,
      method: 'put'
    })
  }

// 导出商户代理商
export function exportAgent(query) {
  return request({
    url: '/admin/agent/export',
    method: 'get',
    params: query
  })
}