chore(history): import initial web product snapshot

This commit is contained in:
wmq
2026-07-25 00:30:00 +08:00
commit cf0eed46c3
131 changed files with 15693 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { http } from './client'
import type { Conversation, Customer, Message, SendMessagePayload } from '@/types'
export type ConversationListItem = Conversation & { customer: Customer }
export interface ConversationQuery {
filter?: string
channel?: string
keyword?: string
userId?: string
}
/** GET /api/conversations */
export function getConversations(query: ConversationQuery = {}) {
return http.get<{ list: ConversationListItem[]; total: number }>('/api/conversations', { ...query })
}
/** GET /api/conversations/:id */
export function getConversation(id: string) {
return http.get<{ conversation: Conversation; customer: Customer }>(`/api/conversations/${id}`)
}
/** GET /api/conversations/:id/messages */
export function getMessages(id: string) {
return http.get<Message[]>(`/api/conversations/${id}/messages`)
}
/** POST /api/conversations/:id/messages */
export function sendMessage(id: string, payload: SendMessagePayload & { translatedText?: string }) {
return http.post<Message>(`/api/conversations/${id}/messages`, payload)
}
/** PATCH /api/conversations/:id(标记已读/分配/状态) */
export function updateConversation(id: string, payload: { assigneeId?: string | null; markRead?: boolean; status?: string }) {
return http.patch<Conversation>(`/api/conversations/${id}`, payload)
}