All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 41s
- apple-auth.service.ts: verifyIdentityToken 增加 NODE_ENV 检查, 生产环境缺 APPLE_BUNDLE_ID 时运行时返回 401,不再走 mock - 新增 CAPIErrorCode 语义错误码体系 (src/common/errors/) - 新增 CapiException 携带 errorCode 的 HttpException 子类 - GlobalExceptionFilter 响应自动包含 errorCode 字段 - AuthService/JwtAuthGuard/AppleAuthService 全部改用 CapiException - 新增 LoginResponseDto/RefreshResponseDto/LogoutResponseDto/UserDto - Auth controller Swagger 添加 type 参数 - 新增 docs/ios-auth-api-contract.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
||
|
||
export class UserDto {
|
||
@ApiProperty({ example: 'clx...' })
|
||
id: string;
|
||
|
||
@ApiProperty({ example: 'user@example.com', nullable: true })
|
||
email: string | null;
|
||
|
||
@ApiProperty({ example: '张三', nullable: true })
|
||
nickname: string | null;
|
||
|
||
@ApiProperty({ example: null, nullable: true })
|
||
avatarUrl: string | null;
|
||
|
||
@ApiProperty({ example: 'user' })
|
||
role: string;
|
||
|
||
@ApiProperty({ example: 'active' })
|
||
status: string;
|
||
|
||
@ApiProperty({ example: false })
|
||
onboardingCompleted: boolean;
|
||
}
|
||
|
||
export class AuthTokensDto {
|
||
@ApiProperty({ description: 'JWT access token,有效期 1h', example: 'eyJhbG...' })
|
||
accessToken: string;
|
||
|
||
@ApiProperty({ description: '96 位十六进制 refresh token,一次性轮换', example: 'a1b2c3...' })
|
||
refreshToken: string;
|
||
}
|
||
|
||
export class LoginResponseDto extends AuthTokensDto {
|
||
@ApiProperty({ type: UserDto })
|
||
user: UserDto;
|
||
}
|
||
|
||
export class RefreshResponseDto extends AuthTokensDto {
|
||
@ApiProperty({ type: UserDto })
|
||
user: UserDto;
|
||
}
|
||
|
||
export class LogoutResponseDto {
|
||
@ApiProperty({ example: true })
|
||
success: boolean;
|
||
|
||
@ApiProperty({ example: '已退出登录' })
|
||
message: string;
|
||
}
|