feat(api): 更新用户模块支持头像功能
- 更新 AuthDto 调整验证规则 - 更新 UserDto 添加头像相关字段 - 更新 UserController 支持更新用户头像 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,13 @@ export class AuthUserDto implements AuthUser {
|
|||||||
|
|
||||||
@ApiProperty({ example: '张三', description: '用户名称', nullable: true })
|
@ApiProperty({ example: '张三', description: '用户名称', nullable: true })
|
||||||
name: string | null;
|
name: string | null;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
example: 'clxxx456',
|
||||||
|
description: '用户头像文件 ID',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
avatarId: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 认证响应 DTO */
|
/** 认证响应 DTO */
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ export class UserResponseDto implements UserResponse {
|
|||||||
@ApiProperty({ example: '张三', description: '用户名称', nullable: true })
|
@ApiProperty({ example: '张三', description: '用户名称', nullable: true })
|
||||||
name: string | null;
|
name: string | null;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
example: 'clxxx456',
|
||||||
|
description: '用户头像文件 ID',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
avatarId: string | null;
|
||||||
|
|
||||||
@ApiProperty({ example: '2026-01-16T10:00:00.000Z', description: '创建时间' })
|
@ApiProperty({ example: '2026-01-16T10:00:00.000Z', description: '创建时间' })
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
|
||||||
@@ -73,6 +80,13 @@ export class UserWithRolesResponseDto implements UserWithRolesResponse {
|
|||||||
@ApiProperty({ example: '张三', description: '用户名称', nullable: true })
|
@ApiProperty({ example: '张三', description: '用户名称', nullable: true })
|
||||||
name: string | null;
|
name: string | null;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
example: 'clxxx456',
|
||||||
|
description: '用户头像文件 ID',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
avatarId: string | null;
|
||||||
|
|
||||||
@ApiProperty({ example: false, description: '是否为超级管理员' })
|
@ApiProperty({ example: false, description: '是否为超级管理员' })
|
||||||
isSuperAdmin: boolean;
|
isSuperAdmin: boolean;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
import { Controller, Get, Patch, Delete, Param, Body, Query, UseGuards } from '@nestjs/common';
|
import {
|
||||||
import { ApiTags, ApiOperation, ApiBearerAuth, ApiOkResponse } from '@nestjs/swagger';
|
Controller,
|
||||||
|
Get,
|
||||||
|
Patch,
|
||||||
|
Delete,
|
||||||
|
Param,
|
||||||
|
Body,
|
||||||
|
Query,
|
||||||
|
UseGuards,
|
||||||
|
} from '@nestjs/common';
|
||||||
|
import {
|
||||||
|
ApiTags,
|
||||||
|
ApiOperation,
|
||||||
|
ApiBearerAuth,
|
||||||
|
ApiOkResponse,
|
||||||
|
} from '@nestjs/swagger';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AssignRolesDto,
|
AssignRolesDto,
|
||||||
|
|||||||
Reference in New Issue
Block a user