import request from '@/utils/request'

// 查询会员列表
export function listMember(query) {
  return request({
    url: '/agri/member/list',
    method: 'get',
    params: query
  })
}

// 平台添加会员
export function addMember(data) {
  return request({
    url: '/agri/member',
    method: 'post',
    data: data
  })
}

// 查询会员详情
export function getMember(memberId) {
  return request({
    url: '/agri/member/' + memberId,
    method: 'get'
  })
}

// 修改会员启用状态
export function updateMemberStatus(memberId, data) {
  return request({
    url: '/agri/member/' + memberId + '/status',
    method: 'put',
    data: data
  })
}

// 查询会员订单列表（只读）
export function listMemberOrders(memberId, query) {
  return request({
    url: '/agri/member/' + memberId + '/orders',
    method: 'get',
    params: query
  })
}

// 查询会员订单详情（只读）
export function getMemberOrder(memberId, orderId) {
  return request({
    url: '/agri/member/' + memberId + '/orders/' + orderId,
    method: 'get'
  })
}
