feat(calls): VoiceClipModal 只读长语音列表+播放,接入 CallList(微信+WA语音)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import type {
|
||||
SyncRun,
|
||||
SyncState,
|
||||
SyncStatus,
|
||||
VoiceClip,
|
||||
} from './types'
|
||||
|
||||
/** Drop entries whose value is `undefined`, `null`, or `''`. */
|
||||
@@ -191,6 +192,42 @@ export function getCalls(query: CallQuery = {}): Promise<Page<PhoneCall>> {
|
||||
)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Voice clips (长语音片段 — read-only mirror of 云客 /wechatweb/call/list)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface VoiceClipQuery {
|
||||
/** 员工 userId 精确过滤(modal 从 CallList 行打开时传)。 */
|
||||
user_id?: string
|
||||
/** 员工姓名模糊过滤(云客 modal 的「员工姓名」筛选项)。 */
|
||||
user_real_name?: string
|
||||
/** 本地通道标记(wechat / whatsapp),非上游筛选。 */
|
||||
channel?: string
|
||||
/** ms-epoch inclusive 窗口,与 end_time 比较(录音结束时间)。 */
|
||||
start?: number
|
||||
end?: number
|
||||
/** 企业串码。 */
|
||||
company_code?: string
|
||||
page?: number
|
||||
page_size?: number
|
||||
}
|
||||
|
||||
export function getVoiceClips(query: VoiceClipQuery = {}): Promise<Page<VoiceClip>> {
|
||||
return getJson<Page<VoiceClip>>(
|
||||
'/voice-clips',
|
||||
clean({
|
||||
user_id: query.user_id,
|
||||
user_real_name: query.user_real_name,
|
||||
channel: query.channel,
|
||||
start: query.start,
|
||||
end: query.end,
|
||||
company_code: query.company_code,
|
||||
page: query.page ?? 1,
|
||||
page_size: query.page_size ?? 10,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// SMS
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -324,4 +361,5 @@ export type {
|
||||
SyncRun,
|
||||
SyncState,
|
||||
SyncStatus,
|
||||
VoiceClip,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user