新增会话管理功能,包括获取会话列表、获取会话详情和删除会话的API,更新AI教练模块以支持会话模型,调整相关服务和数据传输对象。
This commit is contained in:
@@ -80,18 +80,19 @@ export class UsersService {
|
||||
};
|
||||
}
|
||||
|
||||
const profile = await this.userProfileModel.findByPk(existingUser.id);
|
||||
const [profile] = await this.userProfileModel.findOrCreate({
|
||||
where: { userId: existingUser.id },
|
||||
defaults: { userId: existingUser.id },
|
||||
});
|
||||
const returnData = {
|
||||
...existingUser.toJSON(),
|
||||
maxUsageCount: DEFAULT_FREE_USAGE_COUNT,
|
||||
isVip: existingUser.isVip,
|
||||
profile: profile ? {
|
||||
dailyStepsGoal: profile.dailyStepsGoal,
|
||||
dailyCaloriesGoal: profile.dailyCaloriesGoal,
|
||||
pilatesPurposes: profile.pilatesPurposes,
|
||||
weight: profile.weight,
|
||||
height: profile.height,
|
||||
} : undefined,
|
||||
dailyStepsGoal: profile?.dailyStepsGoal,
|
||||
dailyCaloriesGoal: profile?.dailyCaloriesGoal,
|
||||
pilatesPurposes: profile?.pilatesPurposes,
|
||||
weight: profile?.weight,
|
||||
height: profile?.height,
|
||||
}
|
||||
|
||||
this.logger.log(`getProfile returnData: ${JSON.stringify(returnData, null, 2)}`);
|
||||
|
||||
Reference in New Issue
Block a user