feat(user): 添加 GORM 代码生成工具并更新数据库配置
- 在项目中引入 GORM 相关依赖 - 添加 GORM代码生成工具 gen.go - 更新 MySQL 数据库配置 - 新增 .env 文件到 .gitignore
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Email string `gorm:"uniqueIndex;type:varchar(255) not null"`
|
||||
PasswordHashed string `gorm:"type:varchar(255) not null"`
|
||||
}
|
||||
Reference in New Issue
Block a user