chore: rename field name

This commit is contained in:
deepzz0
2021-04-27 16:16:32 +08:00
parent 1815cea2cd
commit 6b74e1d208
17 changed files with 586 additions and 454 deletions

View File

@@ -3,17 +3,19 @@ package model
import "time"
// use snake_case as column name
// Account 博客账户
type Account struct {
Username string `gorm:"primaryKey"` // 用户名
Password string `gorm:"not null"` // 密码
Email string `gorm:"not null"` // 邮件地址
PhoneN string `gorm:"not null"` // 手机号
Address string `gorm:"not null"` // 地址信息
Username string `gorm:"column:username;primaryKey" bson:"username"` // 用户名
Password string `gorm:"column:password;not null" bson:"password"` // 密码
Email string `gorm:"column:email;not null" bson:"email"` // 邮件地址
PhoneN string `gorm:"column:phone_n;not null" bson:"phone_n"` // 手机号
Address string `gorm:"column:address;not null" bson:"address"` // 地址信息
LogoutTime time.Time `gorm:"default:null"` // 登出时间
LoginIP string `gorm:"default:null"` // 最近登录IP
LoginUA string `gorm:"default:null"` // 最近登录IP
LoginTime time.Time `gorm:"default:now()"` // 最近登录时间
CreateTime time.Time `gorm:"default:now()"` // 创建时间
LogoutAt time.Time `gorm:"column:logout_at;default:null" bson:"logout_at"` // 登出时间
LoginIP string `gorm:"column:login_ip;default:null" bson:"login_ip"` // 最近登录IP
LoginUA string `gorm:"column:login_ua;default:null" bson:"login_ua"` // 最近登录IP
LoginAt time.Time `gorm:"column:login_at;default:now()" bson:"login_at"` // 最近登录时间
CreatedAt time.Time `gorm:"column:creatd_at;default:now()" bson:"created_at"` // 创建时间
}