
import request from '@/utils/request'

/**
 * 获取本人接收的消息列表
 * @param {Object} query 查询参数
 * @returns {Promise}
 */
export function appGetReceiveList(query) {
  return request({
    url: '/app/message/receiveList',
    method: 'get',
    params: query
  })
}

/**
 * 标记消息已读
 * @param {number} id 消息ID
 * @returns {Promise} 
 */
export function appReadMessage(id) {
  return request({
    url: '/app/message/read',
    method: 'post',
    params: { id }
  })
}

/**
 * 查询本人未读消息数量
 * @returns {Promise}
 */
export function appGetUnreadCount() {
  return request({
    url: '/app/message/unreadCount',
    method: 'get'
  })
}
