新增训练计划模块,包括控制器、服务、模型及数据传输对象,更新应用模块以引入新模块,同时在AI教练模块中添加体态评估功能,支持体重识别与更新,优化用户体重历史记录管理。
This commit is contained in:
@@ -18,7 +18,7 @@ import { Logger as WinstonLogger } from 'winston';
|
||||
import { UsersService } from './users.service';
|
||||
import { CreateUserDto } from './dto/create-user.dto';
|
||||
import { UserResponseDto } from './dto/user-response.dto';
|
||||
import { ApiOperation, ApiBody, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiOperation, ApiBody, ApiResponse, ApiTags, ApiQuery } from '@nestjs/swagger';
|
||||
import { UpdateUserDto, UpdateUserResponseDto } from './dto/update-user.dto';
|
||||
import { AppleLoginDto, AppleLoginResponseDto, RefreshTokenDto, RefreshTokenResponseDto } from './dto/apple-login.dto';
|
||||
import { DeleteAccountDto, DeleteAccountResponseDto } from './dto/delete-account.dto';
|
||||
@@ -54,6 +54,19 @@ export class UsersController {
|
||||
return this.usersService.getProfile(user);
|
||||
}
|
||||
|
||||
// 获取历史体重记录
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/weight-history')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOperation({ summary: '获取历史体重记录(按时间倒序)' })
|
||||
@ApiQuery({ name: 'limit', required: false, description: '返回条数,默认200,最大1000' })
|
||||
async getWeightHistory(
|
||||
@CurrentUser() user: AccessTokenPayload,
|
||||
) {
|
||||
const data = await this.usersService.getWeightHistory(user.sub, {});
|
||||
return { code: ResponseCode.SUCCESS, message: 'success', data };
|
||||
}
|
||||
|
||||
|
||||
// 更新用户昵称、头像
|
||||
@UseGuards(JwtAuthGuard)
|
||||
|
||||
Reference in New Issue
Block a user