Добавлен основные классы для сервиса авторизаци
This commit is contained in:
22
internal/repository/repository.go
Normal file
22
internal/repository/repository.go
Normal 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),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user