import { httpPostJson } from "@/utils/http"; export interface GetChatsResult { messageId?: string; lastMessageTime?: string; companyId: string; companyName: string; companyAvatar?: string; isRollback?: number; // 0 正常,1撤回 noReadNumber?: number; // 0 未读 1已读 lastContent?: string; lastContentType?: string; } export const getChatsApi = () => { return httpPostJson(`/imMessage/chats`); }; export interface GetHistoryParams { chatCompanyId: string; } export interface GetHistoryResult { messageId: string; sendId: string; acceptId: string; messageContent: string; messageContentType: string; isRollback: number; quoteMessageId: string; sendMessageTime: string; } export const getHistoryApi = (params: GetHistoryParams) => { return httpPostJson(`/imMessage/history`, params); }; export interface UpdateIsReadParams { companyId: string; } export const updateIsReadApi = (params: UpdateIsReadParams) => { return httpPostJson(`/imMessage/updateIsRead`, params); }; export interface GetAllNoReadNumberParams {} export interface GetAllNoReadNumberResult { noReadNumber: number; } export const getAllNoReadNumberApi = (params: GetAllNoReadNumberParams) => { return httpPostJson(`/imMessage/getAllNoReadNumber`, params); };