mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +08:00
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:
parent
f558b99ca3
commit
01d8888601
@ -62,6 +62,10 @@ export interface UpdateMessageDto {
|
||||
siblingsGroupId?: number
|
||||
/** Update status */
|
||||
status?: MessageStatus
|
||||
/** Update trace ID */
|
||||
traceId?: string | null
|
||||
/** Update statistics */
|
||||
stats?: MessageStats | null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user