Adding Insert(), GetByEmail(), Update() UserModel's methods.
Some checks failed
Deploy Greenlight API / deploy (push) Failing after 51s

This commit is contained in:
Maxime Delporte
2025-11-25 13:44:54 +01:00
parent 5a4b7bceb0
commit 2bd0ae90bc
3 changed files with 114 additions and 0 deletions

View File

@@ -15,11 +15,13 @@ var (
// Models : Wraps the MovieModel. We'll add other models to this, like a UserModel and PermissionModel, as our build progresses.
type Models struct {
Movies MovieModel
Users UserModel
}
// NewModels : For ease of use, this method returns a Models struct containing the initialized MovieModel.
func NewModels(db *sql.DB) Models {
return Models{
Movies: MovieModel{DB: db},
Users: UserModel{DB: db},
}
}