import request from '@/config/axios'

export interface MessageSessionVO {
  id: number
  userId: number
  sessionId: string
  connectedAt: Date
  lastActivityAt: Date
}

// 查询用户记录列表
export const getMessageSessionPage = async (params) => {
  return await request.get({ url: `/member/message-session/page`, params })
}

// 查询用户记录详情
export const getMessageSession = async (id: number) => {
  return await request.get({ url: `/member/message-session/get?id=` + id })
}

// 新增用户记录
export const createMessageSession = async (data: MessageSessionVO) => {
  return await request.post({ url: `/member/message-session/create`, data })
}

// 修改用户记录
export const updateMessageSession = async (data: MessageSessionVO) => {
  return await request.put({ url: `/member/message-session/update`, data })
}

// 删除用户记录
export const deleteMessageSession = async (id: number) => {
  return await request.delete({ url: `/member/message-session/delete?id=` + id })
}

// 导出用户记录 Excel
export const exportMessageSession = async (params) => {
  return await request.download({ url: `/member/message-session/export-excel`, params })
}
