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

export async function getJobIndexList(params?: API.JobIndex.ListParams) {
  return request<API.JobIndex.JobIndexPageResult>(`/api/cms/jobIndex/getList`, {
    method: 'GET',
    params: params,
  });
}

export async function getJobIndexSingle(indexId: string) {
  return request<API.JobIndex.JobIndexIdResult>(`/api/cms/jobIndex/getSingle/${indexId}`, {
    method: 'GET',
  });
}

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

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

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