From 1e0ef5c5db8fb780687dc28599c3e85dc7d5f6ab Mon Sep 17 00:00:00 2001 From: admin <1297598740@qq.com> Date: Thu, 29 Jan 2026 14:44:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A8=8B=E5=BA=8F=EF=BC=8C=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E7=9A=84=E8=8E=B7=E5=8F=96=E3=80=81=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=E5=B7=B2=E8=AF=BB=E3=80=81=E5=88=A0=E9=99=A4=E3=80=81?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=92=8C=E5=B9=BF=E6=92=AD=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/handler/notification_handler.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/internal/handler/notification_handler.go b/internal/handler/notification_handler.go index 692f85e..5e6772d 100644 --- a/internal/handler/notification_handler.go +++ b/internal/handler/notification_handler.go @@ -73,23 +73,17 @@ func (h *NotificationHandler) GetNotifications(c *gin.Context) { return } - // Calculate total pages - totalPages := 0 - if result.Limit > 0 { - totalPages = int((result.Total + int64(result.Limit) - 1) / int64(result.Limit)) - } - // Calculate current page (1-indexed) currentPage := 1 if result.Limit > 0 { currentPage = (result.Offset / result.Limit) + 1 } - api.SuccessWithMeta(c, result.Notifications, &api.Meta{ - Page: currentPage, - PageSize: result.Limit, - TotalCount: result.Total, - TotalPages: totalPages, + api.Success(c, gin.H{ + "notifications": result.Notifications, + "total": result.Total, + "page": currentPage, + "limit": result.Limit, }) }