import { http } from '../http'

const mailboxApi = {
  // 信箱表-查询列表
  getMailList: (data: anyObj) =>
    http.request({
      url: '/userMessageBox/getMessageBoxListByMessageTypePage',
      method: 'POST',
      data,
    }),

  // 信箱表-id查询
  getMailDetail: (id: any) =>
    http.request({
      url: '/userMessageBox/' + id,
    }),

  // 根据信箱id一键领取信箱礼物
  delMail: (id: any) =>
    http.request({
      url: '/userMessageBox/' + id,
      method: 'DELETE',
    }),

  // 根据信箱id一键领取信箱礼物
  pickMail: (id: any) =>
    http.request({
      url: '/userMessageBox/pickUpAll/' + id,
      method: 'POST',
    }),

  // 一键已读-全部奖励聚合查询
  pickMailAllRewards: (data?: anyObj) =>
    http.request({
      url: '/userMessageBox/readWithOneButton/allRewards',
      method: 'POST',
      data,
    }),

  // 一键已读-确认录取
  pickMailAll: (data?: anyObj) =>
    http.request({
      url: '/userMessageBox/readWithOneButton',
      method: 'POST',
      data,
    }),

  // 删除已读的邮件
  delMailAll: (data?: anyObj) =>
    http.request({
      url: '/userMessageBox/removeReadMessageByMessageFlag',
      method: 'POST',
      data,
    }),

  // 信箱未读提示
  getMsgRedPoint: () =>
    http.request({
      url: '/userMessageBox/getMsgRedPoint',
    }),
}

export default mailboxApi
