feat(health-profiles): 添加健康档案模块,支持健康史记录、家庭健康管理和档案概览功能
This commit is contained in:
@@ -631,4 +631,37 @@ export class UsersController {
|
||||
return this.usersService.updateDailyHealth(user.sub, updateDto);
|
||||
}
|
||||
|
||||
// ==================== 健康邀请码相关接口 ====================
|
||||
|
||||
/**
|
||||
* 获取用户健康邀请码
|
||||
*/
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('health-invite-code')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOperation({ summary: '获取用户健康邀请码(如果没有则自动生成)' })
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: '成功获取健康邀请码',
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'number', example: 0 },
|
||||
message: { type: 'string', example: 'success' },
|
||||
data: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
healthInviteCode: { type: 'string', example: 'ABC12345' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
async getHealthInviteCode(
|
||||
@CurrentUser() user: AccessTokenPayload,
|
||||
): Promise<{ code: ResponseCode; message: string; data: { healthInviteCode: string } }> {
|
||||
this.logger.log(`获取健康邀请码 - 用户ID: ${user.sub}`);
|
||||
return this.usersService.getHealthInviteCode(user.sub);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user