28 lines
707 B
TypeScript
28 lines
707 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import {
|
|
IsString,
|
|
IsNotEmpty,
|
|
MaxLength,
|
|
ArrayMinSize,
|
|
ArrayMaxSize,
|
|
IsArray,
|
|
} from 'class-validator';
|
|
|
|
export class CreateShareDto {
|
|
@ApiProperty({ description: '分享标题', example: '我的挑战' })
|
|
@IsString()
|
|
@IsNotEmpty({ message: '标题不能为空' })
|
|
@MaxLength(100, { message: '标题不能超过100个字符' })
|
|
title: string;
|
|
|
|
@ApiProperty({
|
|
description: '6个关卡ID',
|
|
example: ['id1', 'id2', 'id3', 'id4', 'id5', 'id6'],
|
|
})
|
|
@IsArray()
|
|
@ArrayMinSize(6, { message: '需要恰好6个关卡' })
|
|
@ArrayMaxSize(6, { message: '需要恰好6个关卡' })
|
|
@IsString({ each: true })
|
|
levelIds: string[];
|
|
}
|