Добавлен основные классы для сервиса авторизаци

This commit is contained in:
Ганеев Артем
2025-10-28 20:49:54 +03:00
parent def3552a67
commit 736b8031f8
26 changed files with 904 additions and 40 deletions

View File

@@ -0,0 +1,22 @@
package repository
import (
"authorization/internal"
"database/sql"
)
type UserResository interface {
CreateUser(user internal.User) (int, error)
GetUser(username, password string) (internal.User, error)
UpdateUserRole(username string, userrole internal.UserRole) (string, error)
}
type Repository struct {
UserResository
}
func NewRepository(db *sql.DB) *Repository {
return &Repository{
UserResository: NewUserPostgres(db),
}
}