gofiber-study/model/user/models/user.go

26 lines
1.2 KiB
Go
Raw Normal View History

2022-10-03 15:10:03 +08:00
package models
import (
2022-10-05 00:20:15 +08:00
"gofiber.study.skcks.cn/common/time"
2022-10-03 15:10:03 +08:00
)
type User struct {
Id string `xorm:"not null pk default '' VARCHAR(32)" json:"id"`
Account string `xorm:"not null default '' unique VARCHAR(255)" json:"account"`
Active bool `xorm:"not null default 0 TINYINT(1)" json:"active"`
Alias string `xorm:"not null default '' VARCHAR(255)" json:"alias"`
Contact string `xorm:"not null default '' VARCHAR(255)" json:"contact"`
Email string `xorm:"not null default '' unique VARCHAR(255)" json:"email"`
EmailVerify bool `xorm:"not null default 0 TINYINT(1)" json:"emailVerify"`
LastLoginTime time.Time `xorm:"not null index DATETIME(6)" json:"lastLoginTime"`
Memo string `xorm:"not null default '' VARCHAR(255)" json:"memo"`
Password string `xorm:"not null default '' VARCHAR(255)" json:"-"`
RegisterTime time.Time `xorm:"not null index DATETIME(6)" json:"registerTime"`
Salt string `xorm:"not null default '' VARCHAR(255)" json:"-"`
UserName string `xorm:"not null default '' unique VARCHAR(255)" json:"userName"`
}
func (m *User) TableName() string {
return "user"
}