// @ts-ignore

/* eslint-disable */
import { request } from 'umi';

import { getDataBaseUrl,getStoremanagement } from '@/global_data';

/** 获取店铺  */
export async function GetStoreInfoPageAsync() {
  return request(getStoremanagement()+'/api/shop/alllist', {
    method: 'GET'
  });
}



/** 获取广告列表  post /kitchen/api/rule */
export async function getAdvertisementList(data) {
  return request(getStoremanagement()+`/api/StoreAdvertisement/GetStoreAdvertisementPage`, {
    method: 'Post',
    data: data,
  });
}



/** 新建广告 POST /kitchen/api/rule */

export async function addAdvertisement(data) {
  // http://localhost:5000
  return request(getStoremanagement()+'/api/StoreAdvertisement/AddStoreAdvertisement', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

/** 修改广告 PUT /kitchen/api/rule */

export async function updateAdvertisement(data) {
  return request(getStoremanagement()+'/api/StoreAdvertisement/UpdateStoreAdvertisement', {
    method: 'PUT',
    data: data,
  });
}

/** 批量删除广告 DELETE /kitchen/api/rule */

export async function removeAdvertisement(data) {
  return request(getStoremanagement()+`/api/StoreAdvertisement/DelStoreAdvertisement`, {
    method: 'DELETE',
    data: data,
    // ...(options || {}),
  });
}


/** 停用/启用  */
export async function updateAdvertisementStatus(data) {
  return request(getStoremanagement()+`/api/StoreAdvertisement/UpdateStoreAdvertisementStatus`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}

/** 预览  */
export async function openHtml(data) {
  return request(getStoremanagement()+`/api/StoreAdvertisement/QueryStoreAdvertisementURL`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}


export async function GetCosRequestURL(data) {
  return request(getStoremanagement()+`/api/SysService/GetPresignUploadUrl`, {
    method: 'POST',
    data: data,
  });
}



