/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 消息列表 POST /app/message/list */
export async function appMessageListPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMessageListPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMessageVo>('/app/message/list', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 消息设置为已读 POST /app/message/read */
export async function appMessageReadPost({
  body,
  options,
}: {
  body: API.AppMessageReadPostBody;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/app/message/read', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 消息全部设置为已读 POST /app/message/readAll */
export async function appMessageReadAllPost({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/app/message/readAll', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 获取未读消息数量 POST /app/message/unreadCount */
export async function appMessageUnreadCountPost({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.RLong>('/app/message/unreadCount', {
    method: 'POST',
    ...(options || {}),
  });
}
