User.go 641 B

1234567891011121314
  1. package models
  2. type User struct {
  3. ID int `xorm:"id unsigned int not null pk autoincr"`
  4. Account string `xorm:"varchar(20) notnull unique comment('账号登陆名')"`
  5. Name string `xorm:"varchar(10) notnull comment('用户名')"`
  6. Password string `xorm:"char(32) notnull comment('登陆密码,两次md5加盐,md5(md5(password+pmail) +pmail2023)')" json:"-"`
  7. Disabled int `xorm:"disabled unsigned int not null default(0) comment('0启用,1禁用')"`
  8. IsAdmin int `xorm:"is_admin unsigned int not null default(0) comment('0不是管理员,1是管理员')"`
  9. }
  10. func (p User) TableName() string {
  11. return "user"
  12. }