quintodrome/model/user.go

25 lines
483 B
Go
Raw Normal View History

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