// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 创建基础Project POST /project/createProject */
export async function postProjectCreateProject(
  body: API.Project,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/project/createProject`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除Project DELETE /project/deleteProject */
export async function deleteProjectDeleteProject(
  body: API.Project,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/project/deleteProject`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除选中Project DELETE /project/deleteProjectByIds */
export async function deleteProjectDeleteProjectByIds(
  body: API.IdsReq,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/project/deleteProjectByIds`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据组id获得项目id和name POST /project/getProjectByGroupId */
export async function postProjectGetProjectByGroupId(
  body: API.GetById,
  options?: { [key: string]: any },
) {
  return request<any>(`/api/v1/project/getProjectByGroupId`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id获取Project POST /project/getProjectById */
export async function postProjectGetProjectById(
  body: API.GetById,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.ProjectProjectResponse }>(
    `/api/v1/project/getProjectById`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获取Project外键列表 POST /project/getProjectFkSelect */
export async function postProjectGetProjectFkSelect(
  body: API.GetFkSelect,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.FkResult; msg?: string }>(
    `/api/v1/project/getProjectFkSelect`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 分页获取Project列表 POST /project/getProjectList */
export async function postProjectGetProjectList(
  body: API.SearchProjectParams,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.PageResult; msg?: string }>(
    `/api/v1/project/getProjectList`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获得Project名称列表 POST /project/getProjectNames */
export async function postProjectGetProjectNames(
  body: API.IdsReq,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.NamesResult; msg?: string }>(
    `/api/v1/project/getProjectNames`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 修改基础Project PUT /project/updateProject */
export async function putProjectUpdateProject(body: API.Project, options?: { [key: string]: any }) {
  return request<API.Response & { msg?: string }>(`/api/v1/project/updateProject`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新项目的关联组 PUT /project/updateProjectGroup */
export async function putProjectUpdateProjectGroup(
  body: API.UpdateProjectGroupParams,
  options?: { [key: string]: any },
) {
  return request<any>(`/api/v1/project/updateProjectGroup`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
