feat: extend UpdateMessageDto with traceId and stats fields

- Added optional fields `traceId` and `stats` to the `UpdateMessageDto` interface for enhanced message tracking and statistics.
- Updated `MessageService` to handle the new fields during message updates, ensuring they are correctly processed in the database.
This commit is contained in:
fullex 2026-01-03 18:52:11 +08:00
parent f558b99ca3
commit 01d8888601
2 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,10 @@ export interface UpdateMessageDto {
siblingsGroupId?: number
/** Update status */
status?: MessageStatus
/** Update trace ID */
traceId?: string | null
/** Update statistics */
stats?: MessageStats | null
}
/**

View File

@ -558,6 +558,8 @@ export class MessageService {
if (dto.parentId !== undefined) updates.parentId = dto.parentId
if (dto.siblingsGroupId !== undefined) updates.siblingsGroupId = dto.siblingsGroupId
if (dto.status !== undefined) updates.status = dto.status
if (dto.traceId !== undefined) updates.traceId = dto.traceId
if (dto.stats !== undefined) updates.stats = dto.stats
const [row] = await tx.update(messageTable).set(updates).where(eq(messageTable.id, id)).returning()