1.3: GET /admin/users/stats — Felhasználói statisztikák endpoint #307
Notifications
Total Time Spent: 5 minutes
kincses
5 minutes
No due date set.
Dependencies
No dependencies set.
Reference: kincses/service-finder#307
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mérföldkő: Admin User & Person Management
Cél: Dashboard statisztikák a felhasználókról: total_users, active_users, deleted_users, banned_users, new_users_today/week/month, users_by_role, users_by_plan, users_by_language, users_with_person, users_without_person, registration_trend (napi bontás), active_organizations_count, total_memberships.
🔗 Függőségek (Dependencies)
📝 Elemzés
Új GET /admin/users/stats endpoint. SQL aggregációk: COUNT, GROUP BY role/plan/language. Registration trend: DATE(created_at) GROUP BY. JOIN marketplace.organization_members a memberships számhoz.
▶️ Munka megkezdve: 2026-06-29 04:07:51
✅ Munka befejezve: 2026-06-29 04:13:01
Technikai Összefoglaló:
GET /admin/users/stats endpoint implemented: RegistrationTrendItem + UserStatsResponse Pydantic models, 8 async SQL queries (total/active/deleted/banned users, new users today/week/month, role/plan/language distribution, Person relationship, 30-day registration trend, org stats). HTTP 200 verified with 34 users, 25 active orgs.
⏱️ Az idő rögzítve.
✅ Gitea #307: GET /admin/users/stats — Completed
Implementáció
A
backend/app/api/v1/endpoints/admin_users.pyfájlban implementáltam aGET /admin/users/statsvégpontot aplans/logic_spec_admin_user_person_management.mdspecifikáció alapján.Hozzáadott komponensek:
RegistrationTrendItemPydantic modell — napi regisztrációs trend elem (date + count)UserStatsResponsePydantic modell — 15 mezős válaszstruktúraget_user_statsasync végpont — 8 SQL lekérdezés egy tranzakcióban:date_trunc-el)Teszt eredmények:
API válasz minta: