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

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

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

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

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

/** 分页获取角色列表 POST /post/getPostFkSelect */
export async function postPostGetPostFkSelect(
  body: API.GetFkSelect,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.FkResult; msg?: string }>(
    `/api/v1/post/getPostFkSelect`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

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

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

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