gcx/backend/services/auth-service/src/interface/http/dto/wechat-login.dto.ts

21 lines
653 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { IsString, IsOptional, Length } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class WechatLoginDto {
@ApiProperty({ description: '微信 SDK 返回的一次性 code5 分钟有效)', example: '0b1234...' })
@IsString()
@Length(1, 200)
code: string;
@ApiPropertyOptional({ description: '推荐人的推荐码(新用户注册时使用)', example: 'ABCD1234' })
@IsOptional()
@IsString()
@Length(1, 20)
referralCode?: string;
@ApiPropertyOptional({ description: '设备信息', example: 'iPhone 15 iOS 17' })
@IsOptional()
@IsString()
deviceInfo?: string;
}