wz-golang-server/server/modules/user/entity/platform_user.go

29 lines
1.7 KiB
Go
Raw Permalink 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 entity 数据实体
package entity
import (
"time"
"gorm.io/datatypes"
)
// PlatformUser 平台用户关联信息
type PlatformUser struct {
ID int64 `gorm:"column:id;primaryKey;autoIncrement;comment:平台用户ID自增" json:"id"`
UserID int64 `gorm:"column:user_id;comment:关联t_user.id" json:"userId"`
PlatformType int8 `gorm:"column:platform_type;comment:平台类型1-微信小程序2-抖音小程序3-支付宝小程序" json:"platformType"`
PlatformOpenID string `gorm:"column:platform_openid;comment:平台唯一标识微信openid/抖音open_id" json:"platformOpenid"`
PlatformUnionID string `gorm:"column:platform_unionid;comment:平台统一标识微信unionid多小程序互通用" json:"platformUnionid"`
PlatformSessionKey string `gorm:"column:platform_session_key;comment:平台会话密钥微信session_key加密存储" json:"platformSessionKey"`
PlatformExtra datatypes.JSONMap `gorm:"column:platform_extra;comment:平台扩展字段如抖音的user_name、微信的city等" json:"platformExtra"`
LastLoginTime *time.Time `gorm:"column:last_login_time;comment:最后登录时间" json:"lastLoginTime"`
CreateTime time.Time `gorm:"column:create_time;autoCreateTime;comment:创建时间" json:"createTime"`
UpdateTime time.Time `gorm:"column:update_time;autoUpdateTime;comment:更新时间" json:"updateTime"`
DelFlag int8 `gorm:"column:del_flag;comment:软删除0-未删1-已删" json:"delFlag"`
}
// TableName 指定表名
func (PlatformUser) TableName() string {
return "t_platform_user"
}