login.dto.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { IsNotEmpty, IsString, IsOptional } from 'class-validator';
  2. import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
  3. export class LoginDto {
  4. @ApiProperty({
  5. description: '设备唯一标识符(Device ID)',
  6. example: 'device-123-abc-xyz',
  7. })
  8. @IsNotEmpty()
  9. @IsString()
  10. uid: string;
  11. @ApiPropertyOptional({
  12. description: '渠道ID(仅首次登录可能提供)',
  13. example: 'channel-123',
  14. required: false,
  15. })
  16. @IsOptional()
  17. @IsString()
  18. channelId?: string;
  19. @ApiPropertyOptional({
  20. description: '机器型号(可能缺失)',
  21. example: 'iPhone 12 Pro xxxx',
  22. required: false,
  23. })
  24. @IsOptional()
  25. @IsString()
  26. machine?: string;
  27. @ApiPropertyOptional({
  28. description: '应用版本号',
  29. example: '1.0.0',
  30. required: false,
  31. })
  32. @IsOptional()
  33. @IsString()
  34. appVersion?: string;
  35. @ApiPropertyOptional({
  36. description: '操作系统类型',
  37. example: 'Android',
  38. required: false,
  39. })
  40. @IsOptional()
  41. @IsString()
  42. os?: string;
  43. // plus account/password etc.
  44. }