video-list-request.dto.ts 976 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // apps/box-app-api/src/feature/video/dto/video-list-request.dto.ts
  2. import { ApiProperty } from '@nestjs/swagger';
  3. import { IsNumber, IsString, IsOptional, Min, Max, IsBoolean } from 'class-validator';
  4. export class VideoListRequestDto {
  5. @ApiProperty({
  6. description: '页码,从1开始',
  7. example: 1,
  8. minimum: 1,
  9. })
  10. @IsNumber()
  11. @Min(1)
  12. page?: number;
  13. @ApiProperty({
  14. description: '每页数量,最多100条',
  15. example: 20,
  16. minimum: 1,
  17. maximum: 100,
  18. })
  19. @IsNumber()
  20. @Min(1)
  21. @Max(100)
  22. size: number;
  23. @ApiProperty({
  24. description: '关键词',
  25. required: false,
  26. })
  27. @IsOptional()
  28. @IsString()
  29. keyword?: string;
  30. @ApiProperty({
  31. required: false,
  32. description: '标签名称(可选,用于过滤)',
  33. example: '推荐',
  34. })
  35. @IsOptional()
  36. @IsString()
  37. tag?: string;
  38. @ApiProperty({
  39. required: false,
  40. description: '是否随机',
  41. })
  42. @IsOptional()
  43. @IsBoolean()
  44. random?: boolean;
  45. }