import { ApiProperty } from '@nestjs/swagger'; import { IsString, IsNotEmpty, Length, Matches } from 'class-validator'; export class JoinByShareCodeDto { @ApiProperty({ description: '分享码(6-12位字符)', example: 'A3K9P2', minLength: 6, maxLength: 12 }) @IsString() @IsNotEmpty() @Length(6, 12) @Matches(/^[A-Z0-9]+$/, { message: '分享码只能包含大写字母和数字' }) shareCode: string; }