Add user repo and keycloak
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type UserState struct {
|
||||
SomeValue string
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Id int `db:"id"`
|
||||
Email string `db:"email"`
|
||||
State UserState `db:"state"`
|
||||
Admin bool `db:"admin"`
|
||||
Password string `db:"password"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
func (s User) String() string {
|
||||
return fmt.Sprint("User{ ",
|
||||
"Id: ", s.Id, ", ",
|
||||
"Email: ", s.Email, ", ",
|
||||
"State: ", s.State, ", ",
|
||||
"Admin: ", s.Admin, ", ",
|
||||
"Password: ", s.Password, ", ",
|
||||
"CreatedAt: ", s.CreatedAt, ", ",
|
||||
"UpdatedAt: ", s.UpdatedAt, ", ",
|
||||
"}")
|
||||
}
|
||||
|
||||
func (s User) GetId() int {
|
||||
return s.Id
|
||||
}
|
||||
Reference in New Issue
Block a user