feat: add sms send chain phase
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user