feat: add details demo
ci-api / test (push) Has been cancelled

This commit is contained in:
Nuxgrid
2026-07-28 14:44:48 +02:00
parent 65ca24b6eb
commit 4b3a5720a3
8 changed files with 143 additions and 38 deletions
+12
View File
@@ -14,6 +14,7 @@ type Store interface {
ListByUsername(username string) ([]Demo, error)
Update(d Demo) (Demo, error)
CountActive() (int, error)
GetDemoByUsername(username string) (Demo, error)
}
// GormStore : Store adossé à PostgreSQL via GORM.
@@ -68,3 +69,14 @@ func (s *GormStore) CountActive() (int, error) {
Count(&n).Error
return int(n), err
}
func (s *GormStore) GetDemoByUsername(username string) (Demo, error) {
var demo Demo
err := s.db.
Where("username = ?", username).
First(&demo).
Error
return demo, err
}