import request from '@/utils/request'

// 查询系统通知列表
export function listNotification(query) {
  return request({
    url: '/system/notification/list',
    method: 'get',
    params: query
  })
}

// 获取所有系统通知
export function getAllNotifications() {
  return request({
    url: '/system/notification/public/list',
    method: 'get'
  })
}

// 获取未读通知数
export function getUnreadCount() {
  return request({
    url: '/system/notification/unread-count',
    method: 'get'
  })
}

// 标记通知为已读
export function markNotificationAsRead(notificationId) {
  return request({
    url: '/system/notification/mark-read/' + notificationId,
    method: 'post'
  })
}

// 查询系统通知详细
export function getNotification(notificationId) {
  return request({
    url: '/system/notification/' + notificationId,
    method: 'get'
  })
}

// 新增系统通知
export function addNotification(data) {
  return request({
    url: '/system/notification',
    method: 'post',
    data: data
  })
}

// 修改系统通知
export function updateNotification(data) {
  return request({
    url: '/system/notification',
    method: 'put',
    data: data
  })
}

// 删除系统通知
export function delNotification(notificationId) {
  return request({
    url: '/system/notification/' + notificationId,
    method: 'delete'
  })
}
