feat: harden platform workflows and UI governance
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Controller, Get, Param, Query } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { CurrentSessionUserId } from '../auth/current-session-user.decorator';
|
||||
import { TenantId } from '../common/tenant-id.decorator';
|
||||
import { OperationsService } from './operations.service';
|
||||
|
||||
@@ -10,12 +11,12 @@ export class ClientOperationsController {
|
||||
|
||||
@Get('batch-tasks')
|
||||
listBatchTasks(@TenantId() tenantId?: string, @Query('status') status?: string) {
|
||||
return this.operations.listBatchTasks({ tenantId, status });
|
||||
return this.operations.listClientBatchTasks({ tenantId, status });
|
||||
}
|
||||
|
||||
@Get('batch-tasks/:id/messages')
|
||||
listTaskMessages(@TenantId() tenantId: string | undefined, @Param('id') taskId: string, @Query('phoneNumber') phoneNumber?: string) {
|
||||
return this.operations.listMessages({ tenantId, taskId, phoneNumber });
|
||||
return this.operations.listClientMessages({ tenantId, taskId, phoneNumber });
|
||||
}
|
||||
|
||||
@Get('messages')
|
||||
@@ -27,17 +28,17 @@ export class ClientOperationsController {
|
||||
@Query('phoneNumber') phoneNumber?: string,
|
||||
@Query('status') status?: string,
|
||||
) {
|
||||
return this.operations.listMessages({ tenantId, applicationId, taskId, messageId, phoneNumber, status });
|
||||
return this.operations.listClientMessages({ tenantId, applicationId, taskId, messageId, phoneNumber, status });
|
||||
}
|
||||
|
||||
@Get('uplink-messages')
|
||||
listUplinkMessages(@TenantId() tenantId?: string, @Query('channelId') channelId?: string, @Query('applicationId') applicationId?: string, @Query('phoneNumber') phoneNumber?: string, @Query('keyword') keyword?: string, @Query('startTime') startTime?: string, @Query('endTime') endTime?: string) {
|
||||
return this.operations.listUplinkMessages({ tenantId, channelId, applicationId, phoneNumber, keyword, startTime, endTime });
|
||||
return this.operations.listClientUplinkMessages({ tenantId, applicationId, phoneNumber, keyword, startTime, endTime });
|
||||
}
|
||||
|
||||
@Get('dashboard')
|
||||
dashboard(@TenantId() tenantId?: string) {
|
||||
return this.operations.dashboard({ tenantId });
|
||||
return this.operations.clientDashboard({ tenantId });
|
||||
}
|
||||
|
||||
@Get('system-logs')
|
||||
@@ -52,4 +53,12 @@ export class ClientOperationsController {
|
||||
) {
|
||||
return this.operations.systemLogs({ tenantId, keyword, level, module, range, page: Number(page), pageSize: Number(pageSize) });
|
||||
}
|
||||
|
||||
@Post('system-logs/exports')
|
||||
exportSystemLogs(
|
||||
@CurrentSessionUserId() userId: string | undefined,
|
||||
@Body() body: { keyword?: string; level?: string; module?: string; range?: string },
|
||||
) {
|
||||
return this.operations.exportSystemLogs(body, userId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user