feat(medications): 实现V2版本药品AI分析功能及结构化数据支持

- 新增 V2 版药品分析服务,通过 AI 生成包含适用人群、副作用等字段的结构化 JSON 数据
- 添加 `POST :id/ai-analysis/v2` 接口,集成用户免费次数校验与自动扣费逻辑
- 在药品创建流程中增加异步触发自动 AI 分析的机制
- fix(users): 修复 Apple 登录未获取到邮箱时的报错问题,改为自动生成随机唯一邮箱
- perf(medications): 将服药提醒定时任务的检查频率调整为每 5 分钟一次
- refactor(push-notifications): 移除不再使用的 PushTestService
This commit is contained in:
richarjiang
2025-11-20 17:55:05 +08:00
parent 07fae9bdc0
commit afe6ae1c6a
6 changed files with 308 additions and 9 deletions

View File

@@ -0,0 +1,27 @@
import { ApiProperty } from '@nestjs/swagger';
/**
* AI 药品分析结果 DTO (V2)
*/
export class AiAnalysisResultDto {
@ApiProperty({ description: '适合人群', type: [String] })
suitableFor: string[];
@ApiProperty({ description: '不适合人群', type: [String] })
unsuitableFor: string[];
@ApiProperty({ description: '主要成分', type: [String] })
mainIngredients: string[];
@ApiProperty({ description: '主要用途' })
mainUsage: string;
@ApiProperty({ description: '可能的副作用', type: [String] })
sideEffects: string[];
@ApiProperty({ description: '储存和保管建议', type: [String] })
storageAdvice: string[];
@ApiProperty({ description: '健康关怀建议', type: [String] })
healthAdvice: string[];
}