fix(mpc-service): 添加 DTO 验证装饰器
添加 class-validator 装饰器到 CreateKeygenDto 和 CreateSigningDto, 修复 NestJS ValidationPipe 的 forbidNonWhitelisted 验证错误。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9b3f33ea42
commit
6eb4b6b153
|
|
@ -28,6 +28,7 @@ import {
|
|||
ApiResponse,
|
||||
ApiParam,
|
||||
} from '@nestjs/swagger';
|
||||
import { IsString, IsNumber, IsBoolean, IsOptional } from 'class-validator';
|
||||
import { Public } from '../../shared/decorators/public.decorator';
|
||||
import { MPCCoordinatorService } from '../../application/services/mpc-coordinator.service';
|
||||
|
||||
|
|
@ -36,15 +37,28 @@ import { MPCCoordinatorService } from '../../application/services/mpc-coordinato
|
|||
// ============================================
|
||||
|
||||
export class CreateKeygenDto {
|
||||
@IsString()
|
||||
username: string;
|
||||
|
||||
@IsNumber()
|
||||
thresholdN: number;
|
||||
|
||||
@IsNumber()
|
||||
thresholdT: number;
|
||||
|
||||
@IsBoolean()
|
||||
requireDelegate: boolean;
|
||||
}
|
||||
|
||||
export class CreateSigningDto {
|
||||
@IsString()
|
||||
username: string;
|
||||
|
||||
@IsString()
|
||||
messageHash: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
userShare?: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue