feat: add sms send chain phase

This commit is contained in:
hectorzhao
2026-07-01 13:39:26 +08:00
parent 56f835a00f
commit 27bb2d798a
11 changed files with 981 additions and 2 deletions
@@ -0,0 +1,45 @@
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { SendChainService, TimeoutUnknownDto } from './send-chain.service';
@ApiTags('send-chain')
@Controller('admin/send')
export class AdminSendChainController {
constructor(private readonly sendChain: SendChainService) {}
@Get('batch-tasks')
listBatchTasks(@Query('tenantId') tenantId?: string, @Query('status') status?: string) {
return this.sendChain.listBatchTasks(tenantId, status);
}
@Get('messages')
listMessages(@Query('taskId') taskId?: string, @Query('phoneNumber') phoneNumber?: string) {
return this.sendChain.listMessages(taskId, phoneNumber);
}
@Get('submit-records')
listSubmitRecords(@Query('taskId') taskId?: string) {
return this.sendChain.listSubmitRecords(taskId);
}
@Get('receipt-records')
listReceiptRecords(@Query('taskId') taskId?: string) {
return this.sendChain.listReceiptRecords(taskId);
}
@Get('uplink-messages')
listUplinkMessages(@Query('tenantId') tenantId?: string, @Query('channelId') channelId?: string) {
return this.sendChain.listUplinkMessages(tenantId, channelId);
}
@Post('batch-tasks/:id/enqueue')
enqueueTask(@Param('id') taskId: string) {
return this.sendChain.enqueueBatchTask(taskId);
}
@Post('timeouts/mark-unknown')
markUnknownTimeout(@Body() body: TimeoutUnknownDto) {
return this.sendChain.markUnknownTimeout(body);
}
}