ch11.2
This commit is contained in:
30
internal/models/users.go
Normal file
30
internal/models/users.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID int
|
||||
Name string
|
||||
Email string
|
||||
HashedPassword []byte
|
||||
Created time.Time
|
||||
}
|
||||
|
||||
type UserModel struct {
|
||||
DB *sql.DB
|
||||
}
|
||||
|
||||
func (m *UserModel) Insert(name, email, password string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UserModel) Authenticate(email, password string) (int, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func (m *UserModel) Exists(id int) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
Reference in New Issue
Block a user