feat(notification): 新增全部标记已读接口

This commit is contained in:
2026-09-16 02:45:36 +08:00
parent c2519c4b6d
commit 89b59c7b91
5 changed files with 76 additions and 2 deletions
+16
View File
@@ -77,6 +77,22 @@ func (h *NotificationHandler) Get(c *gin.Context) {
response.ToResponse(out)
}
// ReadAll 将当前用户全部通知标记为已读(前端进入通知页时调用)。
func (h *NotificationHandler) ReadAll(c *gin.Context) {
response := app.NewResponse(c)
userID, ok := middleware.GetUserID(c.Request.Context())
if !ok {
response.ToErrorResponse(errcode.Unauthorized)
return
}
out, e := h.svc.ReadAll(c.Request.Context(), userID)
if e != nil {
response.ToErrorResponse(e)
return
}
response.ToResponse(out)
}
// Read 标记通知已读(uuid 来自路径参数)。
func (h *NotificationHandler) Read(c *gin.Context) {
response := app.NewResponse(c)