import request from '@/config/axios'

export interface ContentVO {
  id: number
  senderId: number
  receiverId: number
  content: string
  type: number
  translatedContent: string
  language: string
  translationLanguage: string
  isRead: boolean
  isRetracted: boolean
}

// 查询消息记录列表
export const getContentPage = async (params) => {
  return await request.get({ url: `/message/content/page`, params })
}

// 查询消息记录详情
export const getContent = async (id: number) => {
  return await request.get({ url: `/message/content/get?id=` + id })
}

// 新增消息记录
export const createContent = async (data: ContentVO) => {
  return await request.post({ url: `/message/content/create`, data })
}

// 修改消息记录
export const updateContent = async (data: ContentVO) => {
  return await request.put({ url: `/message/content/update`, data })
}

// 删除消息记录
export const deleteContent = async (id: number) => {
  return await request.delete({ url: `/message/content/delete?id=` + id })
}

// 导出消息记录 Excel
export const exportContent = async (params) => {
  return await request.download({ url: `/message/content/export-excel`, params })
}
