import request from '@/utils/request'

export function fetchShopTypeList(query) {
  return request({
    url: '/shop/types',
    method: 'get',
    params: query
  })
}

export function changeShopSetting(shopSettingValue) {
  return request({
    url: '/shop/add/setting',
    method: 'post',
    data: {
      shopSettingValue: shopSettingValue
    }
  })
}

export function addShopType(listQuery) {
  return request({
    url: '/shop/add/type',
    method: 'post',
    data: listQuery
  })
}

export function addShop(listQuery) {
  return request({
    url: '/shop/add',
    method: 'post',
    data: listQuery
  })
}

export function getShopType(id) {
  return request({
    url: '/shop/get/type/' + id,
    method: 'get'
  })
}

export function getShop(id) {
  return request({
    url: '/shop/get/' + id,
    method: 'get'
  })
}

export function updateShopType(listQuery) {
  return request({
    url: '/shop/update/type',
    method: 'post',
    data: listQuery
  })
}

export function updateShop(listQuery) {
  return request({
    url: '/shop/update',
    method: 'post',
    data: listQuery
  })
}

export function deleteShopType(ids) {
  return request({
    url: '/shop/delete/type',
    method: 'delete',
    data: {
      idArray: ids
    }
  })
}

export function obtainedShop(ids) {
  return request({
    url: '/shop/obtained',
    method: 'post',
    data: {
      idArray: ids
    }
  })
}

export function shelfShop(ids) {
  return request({
    url: '/shop/shelf',
    method: 'post',
    data: {
      idArray: ids
    }
  })
}

export function fetchShopList(query) {
  return request({
    url: '/shops',
    method: 'get',
    params: query
  })
}

export function fetchShopTypeSelect(query) {
  return request({
    url: '/shop/type/select',
    method: 'get'
  })
}

