diff --git a/apps/api/src/auth/dto/auth.dto.ts b/apps/api/src/auth/dto/auth.dto.ts index aa627fb..fd00b8e 100644 --- a/apps/api/src/auth/dto/auth.dto.ts +++ b/apps/api/src/auth/dto/auth.dto.ts @@ -65,6 +65,13 @@ export class AuthUserDto implements AuthUser { @ApiProperty({ example: '张三', description: '用户名称', nullable: true }) name: string | null; + + @ApiProperty({ + example: 'clxxx456', + description: '用户头像文件 ID', + nullable: true, + }) + avatarId: string | null; } /** 认证响应 DTO */ diff --git a/apps/api/src/user/dto/user.dto.ts b/apps/api/src/user/dto/user.dto.ts index 1d566dd..cfc5799 100644 --- a/apps/api/src/user/dto/user.dto.ts +++ b/apps/api/src/user/dto/user.dto.ts @@ -52,6 +52,13 @@ export class UserResponseDto implements UserResponse { @ApiProperty({ example: '张三', description: '用户名称', nullable: true }) name: string | null; + @ApiProperty({ + example: 'clxxx456', + description: '用户头像文件 ID', + nullable: true, + }) + avatarId: string | null; + @ApiProperty({ example: '2026-01-16T10:00:00.000Z', description: '创建时间' }) createdAt: string; @@ -73,6 +80,13 @@ export class UserWithRolesResponseDto implements UserWithRolesResponse { @ApiProperty({ example: '张三', description: '用户名称', nullable: true }) name: string | null; + @ApiProperty({ + example: 'clxxx456', + description: '用户头像文件 ID', + nullable: true, + }) + avatarId: string | null; + @ApiProperty({ example: false, description: '是否为超级管理员' }) isSuperAdmin: boolean; diff --git a/apps/api/src/user/user.controller.ts b/apps/api/src/user/user.controller.ts index 4fa15cc..50d7d0a 100644 --- a/apps/api/src/user/user.controller.ts +++ b/apps/api/src/user/user.controller.ts @@ -1,5 +1,19 @@ -import { Controller, Get, Patch, Delete, Param, Body, Query, UseGuards } from '@nestjs/common'; -import { ApiTags, ApiOperation, ApiBearerAuth, ApiOkResponse } from '@nestjs/swagger'; +import { + Controller, + Get, + Patch, + Delete, + Param, + Body, + Query, + UseGuards, +} from '@nestjs/common'; +import { + ApiTags, + ApiOperation, + ApiBearerAuth, + ApiOkResponse, +} from '@nestjs/swagger'; import { AssignRolesDto,