import { request } from '/@/utils/service';


const apiPrefix = '/api/assets/shop/';

export function getCardData(query: any) {
  return request({
    url: apiPrefix + 'card/',
    method: 'GET',
    params: query,
  });
}

export function getTableData(query: any) {
  return request({
    url: apiPrefix,
    method: 'GET',
    params: query,
  });
}

export function getPlatformDetailOverview(query: any) {
  return request({
    url: apiPrefix + 'platform/',
    method: 'GET',
    params: query,
  });
}

export function getShopDetailOverview(query: any) {
  return request({
    url: apiPrefix + 'detail/',
    method: 'GET',
    params: query,
  });
}

export function getCurrentInfo(query: any) {
  return request({
    url: apiPrefix + 'current/',
    method: 'GET',
    params: query,
  });
}

export function getHistoryInfo(query: any) {
  return request({
    url: apiPrefix + 'past/',
    method: 'GET',
    params: query,
  });
}

export function getComputerInfo(query: any) {
  return request({
    url: apiPrefix + 'computer/',
    method: 'GET',
    params: query,
  });
}

export function getShopSelect() {
  return request({
    url: apiPrefix + 'box/',
    method: 'GET',
  });
}
export function getCompanySelect() {
  return request({
    url: '/api/assets/company/box/',
    method: 'GET',
  });
}

export function updateShopDetail(body: any) {
  return request({
    url: apiPrefix + `${body.id}/`,
    method: 'POST',
    params: { partial: body.partial },
    data: body.formData,
  });
}
