refactor(notification): migrate cursor pagination to use unified cursor package
- Add new GetByReceiverIDCursor method with context support and generic cursor types - Rename old implementation to GetByReceiverIDCursorLegacy for backward compatibility - Update handler to use legacy interface temporarily during migration - Use CursorBuilder pattern for consistent pagination across services
This commit is contained in:
@@ -82,8 +82,8 @@ func (h *SystemMessageHandler) GetSystemMessagesByCursor(c *gin.Context) {
|
||||
cursorStr := c.Query("cursor")
|
||||
pageSize, _ := strconv.Atoi(c.DefaultQuery("page_size", "20"))
|
||||
|
||||
// 获取当前用户的系统通知
|
||||
notifications, nextCursor, hasMore, err := h.notifyRepo.GetByReceiverIDCursor(userID, cursorStr, pageSize)
|
||||
// 获取当前用户的系统通知(使用兼容旧版接口)
|
||||
notifications, nextCursor, hasMore, err := h.notifyRepo.GetByReceiverIDCursorLegacy(userID, cursorStr, pageSize)
|
||||
if err != nil {
|
||||
response.InternalServerError(c, "failed to get system messages")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user