feat(api): add cursor-based pagination for system messages
Some checks failed
Build Backend / build-docker (push) Has been cancelled
Build Backend / build (push) Has been cancelled

- Add SystemMessageCursorPageResponse DTO for cursor pagination
- Implement GetSystemMessagesByCursor handler method
- Add GetByReceiverIDCursor repository method with cursor decoding
- Maintain backward compatibility with existing offset-based pagination
This commit is contained in:
lafay
2026-03-21 02:48:06 +08:00
parent 687ac92aea
commit 1a48bb440c
3 changed files with 88 additions and 0 deletions

View File

@@ -528,6 +528,14 @@ type SystemUnreadCountResponse struct {
UnreadCount int64 `json:"unread_count"`
}
// SystemMessageCursorPageResponse 系统消息游标分页响应
type SystemMessageCursorPageResponse struct {
Items []*SystemMessageResponse `json:"items"`
NextCursor string `json:"next_cursor"`
PrevCursor string `json:"prev_cursor"`
HasMore bool `json:"has_more"`
}
// ==================== 时间格式化 ====================
// FormatTime 格式化时间