feat: 初始化DevOps平台后端

This commit is contained in:
湛兮
2026-06-11 20:49:59 +08:00
commit caec5a618d
88 changed files with 11893 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import { Body, Controller, Get, Post } from '@nestjs/common';
import {
ApiBody,
ApiCreatedResponse,
ApiOkResponse,
ApiTags,
} from '@nestjs/swagger';
import { ZodValidationPipe } from '../common/pipes/zod-validation.pipe';
import { AgentInvocation } from './agent.types';
import { AgentService } from './agent.service';
import {
CreateAgentInvocationDto,
CreateAgentInvocationInput,
createAgentInvocationSchema,
} from './create-agent-invocation.dto';
@ApiTags('agent')
@Controller('agent/invocations')
export class AgentController {
constructor(private readonly agentService: AgentService) {}
@Get()
@ApiOkResponse({ description: 'Agent invocation audit list.' })
listInvocations(): AgentInvocation[] {
return this.agentService.listInvocations();
}
@Post()
@ApiBody({ type: CreateAgentInvocationDto })
@ApiCreatedResponse({ description: 'Create a DevOps-scoped agent invocation.' })
async createInvocation(
@Body(new ZodValidationPipe(createAgentInvocationSchema))
body: CreateAgentInvocationInput,
): Promise<AgentInvocation> {
return this.agentService.createInvocation(body);
}
}