import request from '@/utils/request'

// 查询店铺列表
export function listShop(query) {
  return request({
    url: '/agri/shop/list',
    method: 'get',
    params: query
  })
}

// 查询店铺详情
export function getShop(shopId) {
  return request({
    url: '/agri/shop/' + shopId,
    method: 'get'
  })
}

// 新增店铺
export function addShop(data) {
  return request({
    url: '/agri/shop',
    method: 'post',
    data: data
  })
}

// 修改店铺
export function updateShop(data) {
  return request({
    url: '/agri/shop',
    method: 'put',
    data: data
  })
}

// 删除预检
export function deleteShopCheck(shopId) {
  return request({
    url: '/agri/shop/' + shopId + '/deleteCheck',
    method: 'get'
  })
}

// 删除店铺
export function delShop(shopIds) {
  return request({
    url: '/agri/shop/' + shopIds,
    method: 'delete'
  })
}

// 查询商户经营账号
export function getShopAccount(merchantId) {
  return request({
    url: '/agri/shop/merchant/' + merchantId + '/account',
    method: 'get'
  })
}

// 修改商户经营账号
export function updateShopAccount(merchantId, data) {
  return request({
    url: '/agri/shop/merchant/' + merchantId + '/account',
    method: 'put',
    data: data
  })
}
