feat: harden platform workflows and UI governance

This commit is contained in:
hectorzhao
2026-07-22 14:14:55 +08:00
parent ef957f7daa
commit 0f223f7f91
80 changed files with 4958 additions and 764 deletions
+5 -3
View File
@@ -1,6 +1,8 @@
import { Body, Controller, Delete, Get, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { RequireRecentAuthentication } from '../auth/require-recent-authentication.decorator';
import { CurrentSessionUserId } from '../auth/current-session-user.decorator';
import { DeleteTargetDto, DeletionGovernanceService } from '../deletion-governance/deletion-governance.service';
import {
ChannelsService,
ChangeChannelStatusDto,
@@ -25,7 +27,7 @@ import {
@ApiTags('channels')
@Controller('admin')
export class ChannelsController {
constructor(private readonly channels: ChannelsService) {}
constructor(private readonly channels: ChannelsService, private readonly deletions: DeletionGovernanceService) {}
@Get('channels')
listChannels() {
@@ -64,8 +66,8 @@ export class ChannelsController {
@Delete('channels/:id')
@RequireRecentAuthentication()
deleteChannel(@Param('id') channelId: string, @Body() body: ChangeChannelStatusDto) {
return this.channels.deleteChannel(channelId, body);
deleteChannel(@Param('id') channelId: string, @Body() body: DeleteTargetDto, @CurrentSessionUserId() operatorId?: string) {
return this.deletions.delete('channel', channelId, { ...body, operatorId });
}
@Get('channels/:id/metrics')
+2
View File
@@ -1,8 +1,10 @@
import { Module } from '@nestjs/common';
import { ChannelsController } from './channels.controller';
import { ChannelsService } from './channels.service';
import { DeletionGovernanceModule } from '../deletion-governance/deletion-governance.module';
@Module({
imports: [DeletionGovernanceModule],
controllers: [ChannelsController],
providers: [ChannelsService],
exports: [ChannelsService],