import request from '@/utils/request'
import type { CustomerServiceInfo } from './model'

/** 获取客服信息 */
export function getCustomerServiceInfo() {
  return request.post<CustomerServiceInfo>('/shopCustomerService/getInfo', {})
}

/** 发送消息 */
export function sendMessage(data: { content: string; type: 'text' | 'image' }) {
  return request.post<{ success: boolean }>('/shopCustomerService/sendMessage', data)
}

/** 获取聊天记录 */
export function getChatHistory(params: { page?: number; pageSize?: number } = {}) {
  return request.post<{ items: any[]; total: number }>('/shopCustomerService/getHistory', params)
}
