Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserDuplicateEmail = errors.New("邮箱冲突") ErrUserNotFound = gorm.ErrRecordNotFound )
Functions ¶
Types ¶
type ProfileDAO ¶
type ProfileDAO struct {
// contains filtered or unexported fields
}
func NewProfileDAO ¶
func NewProfileDAO(db *gorm.DB) *ProfileDAO
func (*ProfileDAO) FindByUserId ¶
type User ¶
type User struct { Id int64 `gorm:"primaryKey, autoIncrement"` Email string `gorm:"unique"` Password string Ctime int64 Utime int64 }
User 直接对应数据库表结构 有些人叫做 entity,有些人叫做 model,有些人叫做 PO(persistent object)
type UserDAO ¶
type UserDAO struct {
// contains filtered or unexported fields
}
func NewUserDAO ¶
func (*UserDAO) FindByEmail ¶
Click to show internal directories.
Click to hide internal directories.