Go CLI: add show users plan summary (#16463)

### Summary

```
RAGFlow(admin)> show users plan summary;
+---------+----------------------------------------------------------------+
| field   | value                                                          |
+---------+----------------------------------------------------------------+
| command | show_users_plan_summary                                        |
| error   | 'Show users plan summary' is implemented in enterprise edition |
+---------+----------------------------------------------------------------+
```

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-06-29 22:28:45 +08:00
committed by GitHub
parent 5fc254eb2e
commit 6370fce3f0
6 changed files with 76 additions and 0 deletions

View File

@@ -1706,6 +1706,21 @@ func (h *Handler) ListUsersQuota(c *gin.Context) {
success(c, usersQuota, "")
}
// ShowUsersPlanSummary handle show users plan summary
func (h *Handler) ShowUsersPlanSummary(c *gin.Context) {
usersPlanSummary, err := h.service.ShowUsersPlanSummary()
if err != nil {
if errors.Is(err, common.ErrUserNotFound) {
errorResponse(c, "User not found", 404)
return
}
errorResponse(c, err.Error(), 500)
return
}
success(c, usersPlanSummary, "")
}
// ShowUsersQuotaSummary handle show users quota summary
func (h *Handler) ShowUsersQuotaSummary(c *gin.Context) {
usersQuotaSummary, err := h.service.ShowUsersQuotaSummary()

View File

@@ -904,6 +904,17 @@ func (s *Service) ListUsersQuota(pageIndex, pageSize, top int, quotaThreshold *i
return result, nil
}
// ShowUsersPlanSummary show users plan summary for enterprise edition
func (s *Service) ShowUsersPlanSummary() (map[string]interface{}, error) {
result := map[string]interface{}{
"command": "show_users_plan_summary",
"error": "'Show users plan summary' is implemented in enterprise edition",
}
return result, nil
}
// ShowUsersQuotaSummary show users quota summary for enterprise edition
func (s *Service) ShowUsersQuotaSummary() (map[string]interface{}, error) {

View File

@@ -138,6 +138,7 @@ func (r *Router) Setup(engine *gin.Engine) {
protected.GET("/users/documents", r.handler.ListUsersDocuments)
protected.GET("/users/index", r.handler.ListUsersIndex)
protected.GET("/users/quota", r.handler.ListUsersQuota)
protected.GET("/users/plan/summary", r.handler.ShowUsersPlanSummary)
protected.GET("/users/quota/summary", r.handler.ShowUsersQuotaSummary)
protected.GET("/ingestion/tasks/summary", r.handler.ShowIngestionTasksSummary)
protected.GET("/data/summary", r.handler.ShowDataSummary)