feat: filter SMS routes by channel sensitive words

This commit is contained in:
hectorzhao
2026-09-10 15:50:56 +08:00
parent 86947827cc
commit 8e4bc5a20e
26 changed files with 1615 additions and 41 deletions
@@ -0,0 +1,29 @@
import { request, withQuery } from '../core/httpClient';
import type { PagedResult } from '../types';
export type ChannelWord = {
id: string;
channelId: string;
word: string;
status: string;
remark: string;
version: number;
updatedAt: string;
channel: { id: string; name: string; status: string };
};
export type ChannelWordForm = { channelId: string; word: string; status: string; remark: string };
export type ChannelWordQuery = { channelId: string; keyword: string; status: string; page: number; pageSize: number };
const path = '/admin/dictionaries/channel-sensitive-words';
export const channelWordsApi = {
list: (query: ChannelWordQuery) => request<PagedResult<ChannelWord>>(withQuery(path, query)),
save: (form: ChannelWordForm, item?: ChannelWord) =>
request<ChannelWord>(item ? `${path}/${encodeURIComponent(item.id)}` : path, {
method: item ? 'PATCH' : 'POST',
body: JSON.stringify({ ...form, ...(item ? { version: item.version } : {}) }),
}),
remove: (item: ChannelWord) =>
request<{ deleted: boolean }>(`${path}/${encodeURIComponent(item.id)}`, {
method: 'DELETE',
body: JSON.stringify({ version: item.version }),
}),
};
+14
View File
@@ -118,6 +118,20 @@ export type SendQualityResponse = {
};
export type SmsMessageRecord = {
channelWordDecisions?: Array<{
id: string;
decidedAt: string;
snapshot: {
selectedChannelId: string | null;
reason: string | null;
hits: Array<{
channelId: string;
channelName?: string;
count: number;
samples: Array<{ id: string; word: string; version: number }>;
}>;
};
}>;
id: string;
tenantId?: string | null;
batchTaskId?: string | null;