sponge/internal/model/userExample.go

31 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// todo generate model codes to here
// delete the templates code start
package model
import (
"github.com/zhufuyi/sponge/pkg/mysql"
)
// UserExample object fields mapping table
type UserExample struct {
mysql.Model `gorm:"embedded"`
Name string `gorm:"column:name;NOT NULL" json:"name"` // 用户名
Password string `gorm:"column:password;NOT NULL" json:"password"` // 密码
Email string `gorm:"column:email;NOT NULL" json:"email"` // 邮件
Phone string `gorm:"column:phone;NOT NULL" json:"phone"` // 手机号码
Avatar string `gorm:"column:avatar;NOT NULL" json:"avatar"` // 头像
Age int `gorm:"column:age;NOT NULL" json:"age"` // 年龄
Gender int `gorm:"column:gender;NOT NULL" json:"gender"` // 性别1:男2:女,其他值:未知
Status int `gorm:"column:status;NOT NULL" json:"status"` // 账号状态1:未激活2:已激活3:封禁
LoginAt int64 `gorm:"column:login_at;NOT NULL" json:"login_at"` // 登录时间戳
}
// TableName get table name
func (table *UserExample) TableName() string {
return "user_example"
}
// delete the templates code end