mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-12 20:03:40 +08:00
@@ -887,7 +887,9 @@ func (h *Handler) ShowUserSummary(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
userSummary, err := h.service.ShowUserSummary(username)
|
||||
ctx := c.Request.Context()
|
||||
|
||||
userSummary, err := h.service.ShowUserSummary(ctx, username)
|
||||
if err != nil {
|
||||
if errors.Is(err, common.ErrUserNotFound) {
|
||||
common.ErrorWithCode(c, common.CodeNotFound, "User not found")
|
||||
@@ -927,7 +929,9 @@ func (h *Handler) ShowUserQuota(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
userQuota, err := h.service.ShowUserQuota(username)
|
||||
ctx := c.Request.Context()
|
||||
|
||||
userQuota, err := h.service.ShowUserQuota(ctx, username)
|
||||
if err != nil {
|
||||
if errors.Is(err, common.ErrUserNotFound) {
|
||||
common.ErrorWithCode(c, common.CodeNotFound, "User not found")
|
||||
@@ -1923,7 +1927,9 @@ func (h *Handler) GetTokenStats(c *gin.Context) {
|
||||
}
|
||||
granularity = strings.ToLower(granularity)
|
||||
|
||||
stats, err := h.service.GetTokenStats(userName, fromDate, toDate, granularity)
|
||||
ctx := c.Request.Context()
|
||||
|
||||
stats, err := h.service.GetTokenStats(ctx, userName, fromDate, toDate, granularity)
|
||||
if err != nil {
|
||||
common.ErrorWithCode(c, common.CodeDataError, err.Error())
|
||||
return
|
||||
@@ -1990,8 +1996,9 @@ func (h *Handler) ListLogs(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeBadRequest, "Invalid days")
|
||||
return
|
||||
}
|
||||
ctx := c.Request.Context()
|
||||
|
||||
stats, err := h.service.ListLogs(userName, daysInt)
|
||||
stats, err := h.service.ListLogs(ctx, userName, daysInt)
|
||||
if err != nil {
|
||||
common.ErrorWithCode(c, common.CodeDataError, err.Error())
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user