import { get, post } from '@/core/http/http-client'

/** 获取商家聊天信息（含在线状态） */
export async function getShopChat(params) {
  return post('/wanlshop/chat/getShopChat', params)
}

/** 获取聊天历史记录 */
export async function getChatHistory(params) {
  return post('/wanlshop/chat/history', params)
}

/** 会话列表 */
export async function getChatLists(params = {}) {
  return post('/wanlshop/chat/lists', params)
}

/** 删除会话 */
export async function delChatSession(params) {
  return post('/wanlshop/chat/del', params)
}

/** 清空某会话未读 */
export async function clearChatUnread(params) {
  return post('/wanlshop/chat/clear', params)
}

/** 全部已读 */
export async function readAllChat(params = {}) {
  return post('/wanlshop/chat/read', params)
}

/** 获取浏览过的商品（发给商家） */
export async function getBrowsingToShop(params) {
  return post('/wanlshop/product/getBrowsingToShop', params)
}

/** 获取购买过的订单（发给商家） */
export async function getOrderListToShop(params) {
  return post('/wanlshop/order/getOrderListToShop', params)
}

/** 获取文件上传配置 */
export async function getUploadConfig() {
  const { data } = await get('/wanlshop/common/uploadData')
  return data
}
