初始化游戏小组管理系统后端项目
- 基于 NestJS + TypeScript + MySQL + Redis 架构 - 完整的模块化设计(认证、用户、小组、游戏、预约等) - JWT 认证和 RBAC 权限控制系统 - Docker 容器化部署支持 - 添加 CLAUDE.md 项目开发指南 - 配置 .gitignore 忽略文件 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
71
src/modules/honors/dto/honor.dto.ts
Normal file
71
src/modules/honors/dto/honor.dto.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import {
|
||||
IsString,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsArray,
|
||||
IsDateString,
|
||||
MaxLength,
|
||||
} from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CreateHonorDto {
|
||||
@ApiProperty({ description: '小组ID' })
|
||||
@IsString()
|
||||
@IsNotEmpty({ message: '小组ID不能为空' })
|
||||
groupId: string;
|
||||
|
||||
@ApiProperty({ description: '荣誉标题', example: '首次五连胜' })
|
||||
@IsString()
|
||||
@IsNotEmpty({ message: '标题不能为空' })
|
||||
@MaxLength(100)
|
||||
title: string;
|
||||
|
||||
@ApiProperty({ description: '荣誉描述', required: false })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
description?: string;
|
||||
|
||||
@ApiProperty({ description: '媒体文件URL列表(图片/视频)', required: false })
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
mediaUrls?: string[];
|
||||
|
||||
@ApiProperty({ description: '荣誉获得日期', required: false })
|
||||
@IsDateString()
|
||||
@IsOptional()
|
||||
achievedDate?: Date;
|
||||
}
|
||||
|
||||
export class UpdateHonorDto {
|
||||
@ApiProperty({ description: '荣誉标题', required: false })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@MaxLength(100)
|
||||
title?: string;
|
||||
|
||||
@ApiProperty({ description: '荣誉描述', required: false })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
description?: string;
|
||||
|
||||
@ApiProperty({ description: '媒体文件URL列表', required: false })
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
mediaUrls?: string[];
|
||||
|
||||
@ApiProperty({ description: '事件日期', required: false })
|
||||
@IsDateString()
|
||||
@IsOptional()
|
||||
eventDate?: Date;
|
||||
}
|
||||
|
||||
export class QueryHonorsDto {
|
||||
@ApiProperty({ description: '小组ID', required: false })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
groupId?: string;
|
||||
|
||||
@ApiProperty({ description: '年份筛选', required: false, example: 2024 })
|
||||
@IsOptional()
|
||||
year?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user