feat: add sms send chain phase
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { TenantId } from '../common/tenant-id.decorator';
|
||||
import { CreateBatchTaskDto, SendChainService } from './send-chain.service';
|
||||
|
||||
@ApiTags('client-send-chain')
|
||||
@Controller('client/send')
|
||||
export class ClientSendChainController {
|
||||
constructor(private readonly sendChain: SendChainService) {}
|
||||
|
||||
@Post('batch-tasks')
|
||||
createBatchTask(@Body() body: CreateBatchTaskDto) {
|
||||
return this.sendChain.createBatchTask(body);
|
||||
}
|
||||
|
||||
@Get('batch-tasks')
|
||||
listBatchTasks(@TenantId() tenantId?: string, @Query('status') status?: string) {
|
||||
return this.sendChain.listBatchTasks(tenantId, status);
|
||||
}
|
||||
|
||||
@Get('batch-tasks/:id')
|
||||
getBatchTask(@Param('id') taskId: string) {
|
||||
return this.sendChain.getBatchTask(taskId);
|
||||
}
|
||||
|
||||
@Get('batch-tasks/:id/messages')
|
||||
listTaskMessages(@Param('id') taskId: string) {
|
||||
return this.sendChain.listMessages(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user