feat: Introduce DTOs for API validation and new deployment features, including a Git controller and UI components.

This commit is contained in:
2025-11-23 12:03:11 +08:00
parent 02b7c3edb2
commit 378070179f
24 changed files with 809 additions and 302 deletions

View File

@@ -0,0 +1,19 @@
import { z } from 'zod';
export const listDeploymentsQuerySchema = z.object({
page: z.coerce.number().int().min(1).optional().default(1),
pageSize: z.coerce.number().int().min(1).max(100).optional().default(10),
projectId: z.coerce.number().int().positive().optional(),
});
export const createDeploymentSchema = z.object({
projectId: z.number().int().positive({ message: '项目ID必须是正整数' }),
pipelineId: z.number().int().positive({ message: '流水线ID必须是正整数' }),
branch: z.string().min(1, { message: '分支不能为空' }),
commitHash: z.string().min(1, { message: '提交哈希不能为空' }),
commitMessage: z.string().min(1, { message: '提交信息不能为空' }),
env: z.string().optional(),
});
export type ListDeploymentsQuery = z.infer<typeof listDeploymentsQuerySchema>;
export type CreateDeploymentInput = z.infer<typeof createDeploymentSchema>;