import { get, post, put } from './request'

export function getNoticeList(pageNum = 1, pageSize = 10, type?: string) {
  return get('/notice/list', { pageNum, pageSize, type })
}

export function getNoticeDetail(noticeId: number) {
  return get(`/notice/${noticeId}`)
}

export function getMessageList(pageNum = 1, pageSize = 10) {
  return get('/message/list', { pageNum, pageSize })
}

export function getMessageDetail(messageId: number) {
  return get(`/message/${messageId}`)
}

export function markNoticeRead(noticeId: number) {
  return put(`/notice/${noticeId}/read`)
}

export function markAllRead() {
  return put('/notice/read-all')
}

export function getUnreadCount() {
  return get('/notice/unread-count')
}
