import { request } from '@umijs/max';

export async function getWebsiteList(params?: API.Website.ListParams) {
  return request<API.Website.WebsitePageResult>(`/api/cms/website/getList`, {
    method: 'GET',
    params: params,
  });
}

export async function getWebsiteSingle(websiteId: string) {
  return request<API.Website.WebsiteIdResult>(`/api/cms/website/getSingle/${websiteId}`, {
    method: 'GET',
  });
}

export async function saveWebsite(params?: API.Website.AddParams) {
  return request(`/api/cms/website/save`, {
    method: 'POST',
    data: params,
  });
}

export async function updateWebsite(params?: API.Website.UpdateParams) {
  return request(`/api/cms/website/update`, {
    method: 'POST',
    data: params,
  });
}

export async function deleteWebsite(params?: API.Website.DeleteParams) {
  return request(`/api/cms/website/delete`, {
    method: 'POST',
    data: params,
  });
}
