feat: add auth flow and login guard for api/web

This commit is contained in:
2026-02-27 11:07:25 +08:00
parent f2a1e2d6fe
commit 60ce70f532
15 changed files with 377 additions and 11 deletions

View 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"
}