feat(medications): 添加药物超时提醒功能
在MedicationRecord模型中添加overdueReminderSent字段追踪超时提醒状态,在提醒服务中新增定时任务检查超过服药时间1小时的未服用记录,并向用户发送鼓励提醒。该功能每10分钟检查一次,避免重复发送提醒,帮助用户及时补服错过的药物。
This commit is contained in:
@@ -91,6 +91,14 @@ export class MedicationRecord extends Model {
|
||||
})
|
||||
declare reminderSent: boolean;
|
||||
|
||||
@Column({
|
||||
type: DataType.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false,
|
||||
comment: '是否已发送超时提醒',
|
||||
})
|
||||
declare overdueReminderSent: boolean;
|
||||
|
||||
// 关联关系
|
||||
@BelongsTo(() => Medication, 'medicationId')
|
||||
declare medication: Medication;
|
||||
|
||||
Reference in New Issue
Block a user