feat: 优化AI教练聊天逻辑,增加用户聊天次数检查和响应内容

- 在AI教练控制器中添加用户聊天次数检查,若次数用完则返回相应提示信息。
- 更新AI聊天响应DTO,新增用户剩余聊天次数和AI回复文本字段,提升用户体验。
- 修改用户服务,支持初始体重和目标体重字段的更新,增强用户资料的完整性。
This commit is contained in:
richarjiang
2025-08-27 14:22:25 +08:00
parent 79aa300aa1
commit c3961150ab
7 changed files with 69 additions and 15 deletions

View File

@@ -674,7 +674,7 @@ export class AiCoachService {
const cleanText = restText.trim();
// 识别体重记录指令
if (/^记体重$|^体重$|^称重$/.test(commandPart)) {
if (/^记体重$/.test(commandPart)) {
return {
isCommand: true,
command: 'weight',
@@ -684,7 +684,7 @@ export class AiCoachService {
}
// 识别饮食记录指令
if (/^记饮食$|^饮食$|^记录饮食$/.test(commandPart)) {
if (/^记饮食$/.test(commandPart)) {
return {
isCommand: true,
command: 'diet',