refactor: new persistence, more SQL, less ORM
This commit is contained in:
+13
-10
@@ -3,18 +3,21 @@ package model
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID string
|
||||
UserName string
|
||||
Name string
|
||||
Email string
|
||||
Password string
|
||||
IsAdmin bool
|
||||
LastLoginAt *time.Time
|
||||
LastAccessAt *time.Time
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
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"`
|
||||
}
|
||||
|
||||
type Users []User
|
||||
|
||||
type UserRepository interface {
|
||||
CountAll(...QueryOptions) (int64, error)
|
||||
Get(id string) (*User, error)
|
||||
|
||||
Reference in New Issue
Block a user