this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

backend: add created_at in models

Clément 27e7f200 159178ce

+13 -7
+7 -4
backend/internal/models/session.go
··· 1 1 package models 2 2 3 - import "github.com/gofrs/uuid" 3 + import ( 4 + "github.com/gofrs/uuid" 5 + ) 4 6 5 7 type Session struct { 6 - ID uuid.UUID `json:"id"` 7 - UserID uuid.UUID `json:"user_id"` 8 - Token string `json:"token"` 8 + ID uuid.UUID `json:"id"` 9 + UserID uuid.UUID `json:"user_id"` 10 + Token string `json:"token"` 11 + CreatedAt string `json:"created_at"` 9 12 }
+4 -1
backend/internal/models/user.go
··· 1 1 package models 2 2 3 - import "github.com/gofrs/uuid" 3 + import ( 4 + "github.com/gofrs/uuid" 5 + ) 4 6 5 7 type User struct { 6 8 ID uuid.UUID `json:"id"` 7 9 Email string `json:"email"` 8 10 PasswordHash string `json:"password_hash"` 11 + CreatedAt string `json:"created_at"` 9 12 }
+2 -2
backend/internal/services/user.go
··· 21 21 func (s *UserService) GetFromEmail(email string) (*models.User, error) { 22 22 row := s.db.QueryRow("select * from \"users\" where email = ?", email) 23 23 var user models.User 24 - if err := row.Scan(&user.ID, &user.Email, &user.PasswordHash); err != nil { 24 + if err := row.Scan(&user.ID, &user.Email, &user.PasswordHash, &user.CreatedAt); err != nil { 25 25 return nil, err 26 26 } 27 27 return &user, nil ··· 44 44 func (s *UserService) GetFromID(userId uuid.UUID) (*models.User, error) { 45 45 row := s.db.QueryRow("select * from \"users\" where id = ?", userId) 46 46 var user models.User 47 - if err := row.Scan(&user.ID, &user.Email, &user.PasswordHash); err != nil { 47 + if err := row.Scan(&user.ID, &user.Email, &user.PasswordHash, &user.CreatedAt); err != nil { 48 48 return nil, err 49 49 } 50 50 return &user, nil