fix: close admin channel test sms loop

This commit is contained in:
hectorzhao
2026-07-09 11:49:20 +08:00
parent a4a638208e
commit c58a010951
12 changed files with 582 additions and 17 deletions
+18
View File
@@ -69,6 +69,7 @@ export type AdminChannel = {
enterpriseCode?: string | null;
account: string;
srcId: string;
cmppVersion?: '2.0' | '3.0' | string | null;
rateLimitPerSecond: number;
unitPrice: number;
status: string;
@@ -89,6 +90,21 @@ export type ChannelConnectionLogResponse = {
}>;
};
export type ChannelTestResponse = {
channelId: string;
status: string;
batchTaskId: string;
taskNo: string;
submitted: number;
messages: Array<{
phoneNumber: string;
messageRecordId: string;
submitId: string;
streamMessageId?: string;
}>;
queuedAt: string;
};
export type EnterpriseCertification = {
id: string;
tenantId: string;
@@ -784,6 +800,8 @@ export const adminApi = {
method: 'POST',
body: JSON.stringify(body),
}),
testChannel: (id: string, body: { phoneNumber?: string; phones?: string[] | string; content: string; accessNo?: string }) =>
request<ChannelTestResponse>(`/admin/channels/${id}/test`, { method: 'POST', body: JSON.stringify(body) }),
changeChannelStatus: (id: string, status: string, reason?: string) => request<AdminChannel>(`/admin/channels/${id}/status`, {
method: 'POST',
body: JSON.stringify({ status, reason }),