create-carousal.request.ts 564 B

1234567891011121314151617181920212223
  1. import { ApiProperty } from '@nestjs/swagger';
  2. import { IsNotEmpty } from 'class-validator';
  3. import { CarousalTargetType } from '../enum/carousal-target-type.enum';
  4. export class CreateCarousalRequest {
  5. @ApiProperty({
  6. example: 'https://example.cc/1.jpg',
  7. })
  8. @IsNotEmpty({ message: '轮播图不能为空' })
  9. imageUrl: string;
  10. @ApiProperty()
  11. @IsNotEmpty({ message: '跳转类型不能为空' })
  12. targetType: CarousalTargetType;
  13. @ApiProperty({
  14. example: 'https://example.cc',
  15. })
  16. targetUrl: string;
  17. @ApiProperty()
  18. targetId: string;
  19. }