Files
platforms/backend/api/internal/models/user_account.go

20 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.
package models
import "git.apinb.com/bsm-sdk/core/database"
// UserAccount 对应 user_account是业主客户唯一的档案和用户端登录账户。
type UserAccount struct {
Entity // 公共实体字段
Username string `gorm:"column:username;type:varchar(64);not null;uniqueIndex" json:"username"` // 登录名称
PasswordHash string `gorm:"column:password_hash;type:varchar(255);not null" json:"-"` // 密码哈希
Name string `gorm:"column:name;type:varchar(64);not null" json:"name"` // 客户姓名
Phone string `gorm:"column:phone;type:varchar(32);not null;default:'';index" json:"phone"` // 联系手机号
Avatar string `gorm:"column:avatar;type:varchar(512);not null;default:''" json:"avatar"` // 头像资源地址
RealName string `gorm:"column:real_name;type:varchar(64);not null;default:''" json:"real_name"` // 实名认证名称
}
func init() { database.AppendMigrate(&UserAccount{}) }
// TableName 返回与模型、文件名一致的单数数据表名。
func (table *UserAccount) TableName() string { return "user_account" }