/**
 * @Author: ZhaoYadong
 * @Date: 2024-02-20 16:57:29
 * @LastEditors: ZhaoYadong
 * @LastEditTime: 2024-03-20 17:17:49
 * @FilePath: /org/internal/models/staff.go
 */

package models

import (
	"time"

	"git.apinb.com/bsm-sdk/core/database"
	"git.apinb.com/bsm-sdk/core/types"
)

// Staff 店铺工作人员.
type MallStaff struct {
	types.Std_IICUDS
	Std_Store
	Name        string `gorm:"type:varchar(255);index;default:'';"`      // 姓名
	Account     string `gorm:"type:varchar(255);index;default:'';"`      // 登录账号
	Password    string `gorm:"type:varchar(255);default:'';"`            // 登录密码
	Profile     string `gorm:"type:varchar(255);default:'';"`            // 个人说明
	Phone       string `gorm:"type:varchar(20);uniqueIndex;default:'';"` // 手机号
	Email       string `gorm:"type:varchar(255);default:'';"`            // 邮箱
	Avatar      string `gorm:"type:varchar(255);default:'';"`            // 个人头像
	Role        string `gorm:"type:varchar(36);index;default:'';"`       // 角色类型: root 超级管理员、
	Salt        string `gorm:"type:varchar(255);default:'';"`            // 密码盐值
	LastLoginAt time.Time
}

func init() {
	database.AppendMigrate(&MallStaff{})
}

// TableName .
func (MallStaff) TableName() string {
	return "mall_staff" //对应数据库表名
}
