import request from '@/utils/request'

const api = {
  page: '/message/message/page',
  read: '/message/message/setRead',
  allRead: '/message/message/all/setRead'
}
export function fetchMessagePage(params) {
  return request({
    url: api.page,
    method: 'get',
    params
  })
}

export function setRead(id) {
  return request({
    url: `${api.read}?id=${id}`,
    method: 'post'
  })
}

export function setAllRead(serviceType) {
  return request({
    url: `${api.allRead}?serviceType=${serviceType}`,
    method: 'post'
  })
}
