refactor: clean up project structure
- Remove old review reports (keep latest only) - Move docs/ to deploy/docs-backup/ - Move performance-testing/ to deploy/ - Clean up test output files - Organize root directory
This commit is contained in:
@@ -370,13 +370,20 @@ func (h *GroupHandler) GetStats(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Get API key count
|
||||
// Get API key counts
|
||||
totalAPIKeys, err := h.adminService.GetGroupAPIKeyCount(ctx, groupID)
|
||||
if err != nil {
|
||||
response.ErrorFrom(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
// Get active API key count (status = active)
|
||||
activeAPIKeys, err := h.adminService.GetGroupActiveAPIKeyCount(ctx, groupID)
|
||||
if err != nil {
|
||||
response.ErrorFrom(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
// Get today's usage stats
|
||||
now := time.Now()
|
||||
startOfDay := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
|
||||
@@ -399,7 +406,7 @@ func (h *GroupHandler) GetStats(c *gin.Context) {
|
||||
"id": group.ID,
|
||||
"name": group.Name,
|
||||
"total_api_keys": totalAPIKeys,
|
||||
"active_api_keys": totalAPIKeys, // All keys in group are considered active
|
||||
"active_api_keys": activeAPIKeys,
|
||||
"total_requests": totalRequests,
|
||||
"total_cost": totalCost,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user