1. 新增Cover实体类并注册到数据库模块 2. 为剧集添加总集数字段及自动创建集数槽功能 3. 新增管理员更新剧集集数接口 4. 优化发布剧集列表:支持标题过滤与默认分页大小10 5. 扩展MediaUploadJob实体字段,完善媒体上传流程 6. 重构订单与媒体服务,新增数据库持久化支持 7. 新增剧集标题过滤的端到端测试用例
105 lines
1.7 KiB
TypeScript
105 lines
1.7 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import {
|
|
IsArray,
|
|
IsBoolean,
|
|
IsEnum,
|
|
IsInt,
|
|
IsOptional,
|
|
IsString,
|
|
IsUrl,
|
|
Max,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { PublishStatus } from '../drama-status.enum';
|
|
|
|
export class CreateDramaDto {
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
tiktokAlbumId?: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
title: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@ApiProperty()
|
|
@IsOptional()
|
|
@IsUrl({ require_tld: false })
|
|
coverUrl: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(1)
|
|
coverId?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsUrl({ require_tld: false })
|
|
portraitCoverUrl?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsUrl({ require_tld: false })
|
|
landscapeCoverUrl?: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
type: string;
|
|
|
|
@ApiPropertyOptional({ type: [String] })
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
tags?: string[];
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
region?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
language?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(1900)
|
|
year?: number;
|
|
|
|
@ApiPropertyOptional({ enum: PublishStatus })
|
|
@IsOptional()
|
|
@IsEnum(PublishStatus)
|
|
status?: PublishStatus;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsInt()
|
|
sortOrder?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isRecommended?: boolean;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(500)
|
|
totalEpisodes?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(1)
|
|
onlineVersion?: number;
|
|
}
|