This commit is contained in:
2026-06-21 19:29:42 +08:00
parent 4f6c24cc49
commit a84982e1f5
8 changed files with 320 additions and 6 deletions
+1
View File
@@ -33,6 +33,7 @@ type User struct {
Email string `gorm:"size:255" json:"email"`
Status int `gorm:"default:1" json:"status"`
Role string `gorm:"size:32;default:author" json:"role"`
Articles []Article `gorm:"foreignKey:AuthorID" json:"-"`
}
// SetPassword hashes the plain-text password with bcrypt and stores it.