feat: 支持关卡配置分享
This commit is contained in:
27
src/modules/share/dto/create-share.dto.ts
Normal file
27
src/modules/share/dto/create-share.dto.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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[];
|
||||
}
|
||||
Reference in New Issue
Block a user