navidrome/model/user.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
889 B
Go
Raw Permalink Normal View History

2020-01-15 04:22:34 +01:00
package model
2020-01-14 22:11:27 +01:00
import "time"
type User struct {
ID string `json:"id" orm:"column(id)"`
UserName string `json:"userName"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
IsAdmin bool `json:"isAdmin"`
LastLoginAt *time.Time `json:"lastLoginAt"`
LastAccessAt *time.Time `json:"lastAccessAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
// TODO ChangePassword string `json:"password"`
2020-01-14 22:11:27 +01:00
}
type Users []User
type UserRepository interface {
CountAll(...QueryOptions) (int64, error)
Get(id string) (*User, error)
Put(*User) error
FindFirstAdmin() (*User, error)
2020-03-01 21:45:41 +01:00
// FindByUsername must be case-insensitive
2020-01-20 15:54:29 +01:00
FindByUsername(username string) (*User, error)
UpdateLastLoginAt(id string) error
UpdateLastAccessAt(id string) error
}