remove mock group stats endpoint
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

This commit is contained in:
2026-04-20 15:57:39 +08:00
parent b3f112005e
commit 8ce3dc4c73
5 changed files with 6 additions and 43 deletions

View File

@@ -36,7 +36,6 @@ func setupAdminRouter() (*gin.Engine, *stubAdminService) {
router.POST("/api/v1/admin/groups", groupHandler.Create)
router.PUT("/api/v1/admin/groups/:id", groupHandler.Update)
router.DELETE("/api/v1/admin/groups/:id", groupHandler.Delete)
router.GET("/api/v1/admin/groups/:id/stats", groupHandler.GetStats)
router.GET("/api/v1/admin/groups/:id/api-keys", groupHandler.GetGroupAPIKeys)
router.GET("/api/v1/admin/proxies", proxyHandler.List)
@@ -147,7 +146,7 @@ func TestGroupHandlerEndpoints(t *testing.T) {
rec = httptest.NewRecorder()
req = httptest.NewRequest(http.MethodGet, "/api/v1/admin/groups/2/stats", nil)
router.ServeHTTP(rec, req)
require.Equal(t, http.StatusOK, rec.Code)
require.Equal(t, http.StatusNotFound, rec.Code)
rec = httptest.NewRecorder()
req = httptest.NewRequest(http.MethodGet, "/api/v1/admin/groups/2/api-keys", nil)
@@ -279,6 +278,10 @@ func TestDeprecatedMockAdminEndpointsNotRegistered(t *testing.T) {
name string
url string
}{
{
name: "group stats",
url: "/api/v1/admin/groups/2/stats",
},
{
name: "user usage",
url: "/api/v1/admin/users/1/usage?period=today",