feat: add auth flow and login guard for api/web
This commit is contained in:
16
memora-api/internal/model/user.go
Normal file
16
memora-api/internal/model/user.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID int64 `json:"id" gorm:"primaryKey"`
|
||||
Email string `json:"email" gorm:"size:120;uniqueIndex;not null"`
|
||||
Name string `json:"name" gorm:"size:80;not null"`
|
||||
PasswordHash string `json:"-" gorm:"size:255;not null"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (User) TableName() string {
|
||||
return "users"
|
||||
}
|
||||
Reference in New Issue
Block a user