2020-01-14 22:22:34 -05:00
|
|
|
package model
|
2020-01-14 16:11:27 -05:00
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
type User struct {
|
2020-01-19 20:40:18 -05:00
|
|
|
ID string
|
2020-01-20 09:54:29 -05:00
|
|
|
UserName string
|
2020-01-19 20:40:18 -05:00
|
|
|
Name string
|
2020-01-20 09:54:29 -05:00
|
|
|
Email string
|
2020-01-19 20:40:18 -05:00
|
|
|
Password string
|
|
|
|
|
IsAdmin bool
|
2020-01-19 21:39:37 -05:00
|
|
|
LastLoginAt *time.Time
|
|
|
|
|
LastAccessAt *time.Time
|
2020-01-19 20:40:18 -05:00
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
2020-01-14 16:11:27 -05:00
|
|
|
}
|
2020-01-19 22:36:15 -05:00
|
|
|
|
|
|
|
|
type UserRepository interface {
|
|
|
|
|
CountAll(...QueryOptions) (int64, error)
|
|
|
|
|
Get(id string) (*User, error)
|
|
|
|
|
Put(*User) error
|
2020-01-20 09:54:29 -05:00
|
|
|
FindByUsername(username string) (*User, error)
|
|
|
|
|
UpdateLastLoginAt(id string) error
|
2020-01-20 13:35:59 -05:00
|
|
|
UpdateLastAccessAt(id string) error
|
2020-01-19 22:36:15 -05:00
|
|
|
}
|