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

20 lines
1.5 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"
// PlatformAccount 对应 platform_account表示平台总后台登录账号。
type PlatformAccount struct {
Entity // 公共实体字段
Username string `gorm:"column:username;type:varchar(64);uniqueIndex;not null" json:"username"` // 登录用户名
DisplayName string `gorm:"column:display_name;type:varchar(64);not null;default:''" json:"display_name"` // 用户展示名称
Avatar string `gorm:"column:avatar;type:varchar(512);not null;default:''" json:"avatar"` // 头像资源地址
PasswordHash string `gorm:"column:password_hash;type:varchar(255);not null;default:''" json:"-"` // 密码哈希值
PlatformRoleCode string `gorm:"column:platform_role_code;type:varchar(64);not null;index" json:"platform_role_code"` // 平台角色编码
Phone string `gorm:"column:phone;type:varchar(32);not null;default:'';uniqueIndex:idx_platform_account_phone_nonempty,where:phone <> ''" json:"phone"` // 手机号,非空值唯一
}
func init() { database.AppendMigrate(&PlatformAccount{}) }
// TableName 返回与模型、文件名一致的单数数据表名。
func (table *PlatformAccount) TableName() string { return "platform_account" }