feat: aggregate cmpp template mismatch reviews

This commit is contained in:
hectorzhao
2026-07-12 13:25:19 +08:00
parent c8b6d0aa7c
commit 8b6ec92f4f
17 changed files with 523 additions and 38 deletions
@@ -1,5 +1,6 @@
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { SendChainService } from '../send-chain/send-chain.service';
import {
CreateRiskRuleDto,
ReviewSmsTaskDto,
@@ -9,7 +10,7 @@ import {
@ApiTags('risk-review')
@Controller('admin/risk-review')
export class AdminRiskReviewController {
constructor(private readonly riskReview: RiskReviewService) {}
constructor(private readonly riskReview: RiskReviewService, private readonly sendChain: SendChainService) {}
@Get('rules')
listRules(@Query('tenantId') tenantId?: string) {
@@ -37,13 +38,16 @@ export class AdminRiskReviewController {
}
@Post('tasks/:id/approve')
approveTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
return this.riskReview.approveTask(taskId, body);
async approveTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
const task = await this.riskReview.approveTask(taskId, body);
await this.sendChain.handleReviewDecision(taskId, 'approved', body.reason ?? '运营审核通过');
return task;
}
@Post('tasks/:id/reject')
rejectTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
return this.riskReview.rejectTask(taskId, body);
async rejectTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
const task = await this.riskReview.rejectTask(taskId, body);
await this.sendChain.handleReviewDecision(taskId, 'rejected', body.reason ?? task.rejectReason ?? '运营审核驳回');
return task;
}
}