feat: complete cmpp platform phases 0-5

This commit is contained in:
hectorzhao
2026-07-01 13:22:04 +08:00
parent 824a8b334f
commit ee926fea04
86 changed files with 10490 additions and 14 deletions
+110
View File
@@ -0,0 +1,110 @@
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import {
ChannelsService,
CreateChannelDto,
CreateChannelGroupDto,
CreateChannelGroupItemDto,
CreateReceiptImportDto,
CreateReportExportDto,
CreateReportFieldDto,
CreateReportMaterialDto,
CreateReportTaskDto,
CreateRouteRuleDto,
} from './channels.service';
@ApiTags('channels')
@Controller('admin')
export class ChannelsController {
constructor(private readonly channels: ChannelsService) {}
@Get('channels')
listChannels() {
return this.channels.listChannels();
}
@Post('channels')
createChannel(@Body() body: CreateChannelDto) {
return this.channels.createChannel(body);
}
@Post('channels/:id/test')
testChannel(@Param('id') channelId: string) {
return this.channels.testChannel(channelId);
}
@Get('channels/:id/metrics')
listChannelMetrics(@Param('id') channelId: string) {
return this.channels.listChannelMetrics(channelId);
}
@Get('channel-groups')
listGroups() {
return this.channels.listGroups();
}
@Post('channel-groups')
createGroup(@Body() body: CreateChannelGroupDto) {
return this.channels.createGroup(body);
}
@Post('channel-groups/items')
addGroupItem(@Body() body: CreateChannelGroupItemDto) {
return this.channels.addGroupItem(body);
}
@Get('channel-route-rules')
listRouteRules() {
return this.channels.listRouteRules();
}
@Post('channel-route-rules')
createRouteRule(@Body() body: CreateRouteRuleDto) {
return this.channels.createRouteRule(body);
}
@Get('channel-report-fields')
listReportFields(@Query('channelId') channelId?: string) {
return this.channels.listReportFields(channelId);
}
@Post('channel-report-fields')
createReportField(@Body() body: CreateReportFieldDto) {
return this.channels.createReportField(body);
}
@Get('signature-report-materials')
listReportMaterials(@Query('signatureId') signatureId?: string, @Query('channelId') channelId?: string) {
return this.channels.listReportMaterials(signatureId, channelId);
}
@Post('signature-report-materials')
upsertReportMaterial(@Body() body: CreateReportMaterialDto) {
return this.channels.upsertReportMaterial(body);
}
@Get('report-tasks')
listReportTasks(@Query('tenantId') tenantId?: string, @Query('status') status?: string) {
return this.channels.listReportTasks(tenantId, status);
}
@Post('report-tasks/generate')
createReportTask(@Body() body: CreateReportTaskDto) {
return this.channels.createReportTask(body);
}
@Post('report-tasks/:id/export')
createReportExport(@Param('id') taskId: string, @Body() body: CreateReportExportDto) {
return this.channels.createReportExport(taskId, body);
}
@Post('report-tasks/:id/receipt-import')
importReportReceipt(@Param('id') taskId: string, @Body() body: CreateReceiptImportDto) {
return this.channels.importReportReceipt(taskId, body);
}
@Get('report-records')
listReportRecords(@Query('taskId') taskId?: string, @Query('channelId') channelId?: string) {
return this.channels.listReportRecords(taskId, channelId);
}
}