import request from '@/utils/request'

// 创建站内信
export function createInternalMessage(data) {
  return request({
    url: '/ecw/internal-message/create',
    method: 'post',
    data: data
  })
}

// 更新站内信
export function updateInternalMessage(data) {
  return request({
    url: '/ecw/internal-message/update',
    method: 'put',
    data: data
  })
}

// 删除站内信
export function deleteInternalMessage(id) {
  return request({
    url: '/ecw/internal-message/delete?id=' + id,
    method: 'delete'
  })
}

// 获得站内信
export function getInternalMessage(id) {
  return request({
    url: '/ecw/internal-message/get?id=' + id,
    method: 'get'
  })
}

// 获得站内信分页
export function getInternalMessagePage(query) {
  return request({
    url: '/ecw/internal-message/page',
    method: 'get',
    params: query
  })
}

// 导出站内信 Excel
export function exportInternalMessageExcel(query) {
  return request({
    url: '/ecw/internal-message/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得我的站内信
export function getMyInternalMessagePage(query) {
  return request({
    url: '/ecw/internal-message/getMyInternalMessagePage',
    method: 'get',
    params: query
  })
}

//获取个未读消息
export  function getNotReadInternalMessageTotal(){
  return request(
    {
      url:'ecw/internal-message/getNotReadInternalMessageTotal',
      method:'get',

    }
  )
}
export function getRedInternalMessage(query){
  return request({
  url:'/ecw/internal-message/redInternalMessage',
    method:'get',
    params:query,
  })
}
