修复会话安全与实时消息
This commit is contained in:
+13
-2
@@ -23,6 +23,14 @@ export interface Tenant {
|
||||
contact_name: string; contact_phone: string; contact_email: string
|
||||
}
|
||||
|
||||
export interface StatisticsKpis {
|
||||
total_sessions: number
|
||||
avg_response_time: number
|
||||
satisfaction_avg: number
|
||||
first_resolve_rate: number
|
||||
total_messages: number
|
||||
}
|
||||
|
||||
// Auth
|
||||
export const login = (params: LoginParams) => post<LoginResult>('/login', params)
|
||||
|
||||
@@ -58,8 +66,11 @@ export const getKnowledgeEntries = (params?: { category_id?: string; search?: st
|
||||
}
|
||||
|
||||
// Statistics
|
||||
export const getKPIs = () => get<Record<string, number>>('/statistics/kpi')
|
||||
export const getSessionTrend = () => get<{ date: string; count: number }[]>('/statistics/trend')
|
||||
export const getKPIs = () => get<StatisticsKpis>('/statistics/kpi')
|
||||
export const getSessionTrend = (period: 'today' | 'day' | 'month' = 'day') => get<{ date: string; count: number }[]>(`/statistics/trend?period=${period}`)
|
||||
export const getResponseDistribution = () => get<{ range: string; count: number }[]>('/statistics/response-distribution')
|
||||
export const getChannelDistribution = () => get<{ type: string; value: number }[]>('/statistics/channels')
|
||||
export const getAgentPerformance = () => get<{ name: string; conversations: number; avg_response: number; satisfaction: number }[]>('/statistics/performance')
|
||||
|
||||
// Admin
|
||||
export const getTenants = (params?: { search?: string; status?: string; page?: number }) => {
|
||||
|
||||
Reference in New Issue
Block a user